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

Hey everybody.

I work with GeoServer using Apache Tomcat in NetBeans. What I want is using OpenStreetMap as base map of my data. So I added this code:

layer = new OpenLayers.Layers.OSM(); map.addLayer([layer, layer1, layer2]);

before adding this code everything works perfectly, but now when I try to execute my HTML page, fireBug shows the folowing error

TypeError: OpenLayers.Layer.OSM is not a constructor. osm = new OpenLayers.Layer.OSM();

Thanks for your collaboration :)

This question is marked "community wiki".

asked 23 Jul '14, 16:34

Aissm12's gravatar image

Aissm12
1112
accept rate: 0%

edited 24 Jul '14, 00:34

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

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:

×122
×15
×9

question asked: 23 Jul '14, 16:34

question was seen: 3,486 times

last updated: 24 Jul '14, 00:34

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