6
3

How can I create a multiple markers on openstreetmap? and how can I interact with them with ajax?

asked 12 Dec '10, 11:51

godard59's gravatar image

godard59
91124
accept rate: 0%

edited 24 Feb '11, 11:25

Pieren's gravatar image

Pieren
9.7k2075157


6 Answers:
7

You can't add multiple markers on the OpenStreetMap.org homepage. For point & click solutions you might like uMap,geocommmons, StaticMap, and others, but for more power and flexibility it's worth learning a few javascript tricks:

Check out: this multiple markers example

  • It uses the open source JavaScript library called OpenLayers (There's an equivalent example for leafletJS)
  • The map is initialised with a basemap layer from the default OpenStreetMap tile server (other tileservers and alternative renderings of OpenStreetMap data are available)
  • It adds a 'Vector' layer, where the markers are defined.
  • It needs a marker image file placed in a 'img' folder alongside
  • It adds three markers. If you were adding more, you might want to do this by defining an array first, and then looping through this as in this example
  • As an exampe of event handling, it detects the event of selecting the marker, and calls 'createPopup'
permanent link

answered 15 Dec '10, 14:39

Harry%20Wood's gravatar image

Harry Wood
9.3k2486126
accept rate: 13%

edited 12 Dec '14, 00:19

Thank you all, Harry I saw OpenLayers library I Like the example of the three marker, but i need add more. Can you give me an example how to integrate an array in this code ?, Or there is an example on OpenLayers library?

(16 Dec '10, 09:44) godard59

How about you learn javascript or pay somebody to code it for you? Looping over an array in javascript is not really openstreetmap related.

(24 Feb '11, 18:12) petschge
1

I'm updating my old answer here to link to 'uMap' as a newer point and click approach. Also linking my array looping example to answer godard69's question (4 years late!)

(15 Sep '14, 23:40) Harry Wood
2

This is not yet possible for the slippy map on the front page. But you can check out OpenLayers which is an open source javascript slippy map that you can deploy on your own site.

permanent link

answered 12 Dec '10, 12:05

Gnonthgol's gravatar image

Gnonthgol ♦
13.6k15101198
accept rate: 16%

edited 15 Dec '10, 13:28

ChrisH's gravatar image

ChrisH
4.1k134262

2

The short answer is that we don't provide a mechanism to do that directly on the web site, but that doing so isn't hard at all if you have a little web development experience (which it seems you do). All you need to do is use OpenLayers and use OSM as your background layer.

Here's a URL of a talk I prepared for State of the Map US 2010 (but never got to present), which will take you through the basics of web development using OSM:

http://www.emacsen.net/osm/osm-web-tutorial.pdf

If you go through that presentation, you should hopefully have a good foundation on how to use OSM on your site.

permanent link

answered 15 Dec '10, 11:49

emacsen's gravatar image

emacsen
1.2k1423
accept rate: 13%

1

Leaving aside the "ajax" bit, you may find that http://open.mapquest.com/ (or other country site) does what you want - it uses OSM data, has a slightly different rendering to OSM's mapnik, but does have a rudimentary "stick a marker here" logic.

permanent link

answered 24 Feb '11, 14:44

SomeoneElse's gravatar image

SomeoneElse ♦
33.0k65343778
accept rate: 16%

edited 24 Feb '11, 14:45

The map rendering Mapquest Open may be more familiar to people who are used to the Thomas Guide or AAA's maps who haven't ever seen Ordnance Survey.

(24 Feb '11, 17:03) Paul Johnson
0

logistics app debugging tool - This tool allows you visualize/plot multiple points (lat, long)/(latitude, longitude) on the map. It also allows you to specify a shape (circle/square/marker), a color and a comment for each of the points. Only lat, long for each line is mandatory. Providing color, shape and comment is optional.

permanent link

answered 26 Apr '18, 10:21

pointing44's gravatar image

pointing44
1
accept rate: 0%

-3

You can display a map with multiple markers on copypastemap.com link text by simply copying and pasting spreadsheet data.

The alternatives are geobatch and fusion tables.

permanent link
This answer is marked "community wiki".

answered 14 Aug '12, 23:52

Jarek's gravatar image

Jarek
1
accept rate: 0%

1

I don't think this answer machtes the question. The question aims at using it for AJAX programming. And it expects OpenStreetMap as a base layer.

(15 Aug '12, 08:32) Roland Olbricht

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×79
×47
×5

question asked: 12 Dec '10, 11:51

question was seen: 65,313 times

last updated: 28 Apr, 11:12

powered by OSQA