NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello !

I would like to start with a simple map example and I am here: http://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example

There is somethings basically wrong: The OSM library mentioned, "OpenLayers.js" does not exists. If you go to their webseite, you'll lost in space, because there are hundreds of scripts, but not that mentioned one.

Any help would be great !

Thanks anyway and best regards,

Manfred

asked 19 Nov '15, 04:51

mabra77's gravatar image

mabra77
11112
accept rate: 0%

edited 19 Nov '15, 06:15

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


the www.openstreetmap.org website currently uses leaflet as the library for slippy maps instead of OpenLayers. You can follow the example here instead: http://leafletjs.com/examples/quick-start.html

permanent link

answered 19 Nov '15, 06:11

PlaneMad's gravatar image

PlaneMad
28237
accept rate: 33%

edited 19 Nov '15, 19:19

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

In general people prefer to use Leaflet as it is somewhat less complex than OpenLayers and works better on mobile devices. Chris Hill wrote a few how-tos for Leaflet on this blog (e.g. http://chris-osm.blogspot.co.uk/2013/11/using-leaflet-v07_21.html): these are probably better documented and easier to follow than the wiki.

permanent link

answered 19 Nov '15, 11:00

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

I have put up a note on https://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example#Instructions - with a download link for version two (which the example seems to be based on). The example works - I have just tried it. A example for the current version 3 is at http://openlayers.org/en/v3.11.1/doc/quickstart.html

permanent link

answered 19 Nov '15, 06:26

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554
accept rate: 18%

edited 19 Nov '15, 06:54

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

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:

×293
×122
×35
×9
×4

question asked: 19 Nov '15, 04:51

question was seen: 3,498 times

last updated: 19 Nov '15, 19:19

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum