chellymehdi / vopenlayers

Automatically exported from code.google.com/p/vopenlayers
0 stars 0 forks source link

WMS layer on top of OSM/Google layer #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create OSM layer
2.Create WMS layer
3. Add both to map

What is the expected output? What do you see instead?
Expected : OSM layer displayed with WMS layer on top.
Output : Only OSM layer is displayed.

What version of the product are you using? On what operating system?
0.6

Please provide any additional information below.

Original issue reported on code.google.com by john.k.m...@gmail.com on 27 Jun 2011 at 2:42

GoogleCodeExporter commented 9 years ago
Hi,

What is the WMS server and its setup? Can the WMS server return the map in 
spherial mercator? Also make sure that the WMS server knows the right "alias" 
for it. Some know 900913, some 1002113.

At least getMapWithUsHighWaysOnTopOfWebMercator() and getMapWithCustomStyle() 
methods in VolApplication (in project under test directory) does this.

Original comment by matti.ta...@gmail.com on 11 Jul 2011 at 8:57

GoogleCodeExporter commented 9 years ago
Hi,
I found the solution to this problem.

http://stackoverflow.com/questions/5324781/background-layer-in-epsg900913-causes
-wms-overlays-to-fail

The WMS server is GeoServer.
I tried passing the options when creating the OpenLayersMap object but it seems 
the options were not being recognized. The problem persisted.
I then hard coded the max extent bounds and it worked.

Attached is the MapOverlay class.

Original comment by john.k.m...@gmail.com on 22 Jul 2011 at 7:24

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

Couldn't you use the server side API to feed init parameters for the map? Like 
this:

myMap.setJsMapOptions("{maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 
20037508, 20037508)}");

If there is a lot of use for maxExtent parameter, we could add a better typed 
Java API, similar to setRestrictedExtent.

cheers,
matti

Original comment by matti.ta...@gmail.com on 16 Aug 2011 at 8:27