[OpenLayers-Dev] Problems Mixing WMS, Google, and Vector Layers
Peterson Eric-EEP002
Eric.Peterson at motorola.com
Wed Jun 13 13:45:37 EDT 2007
I'm working on an application that uses either WMS or Google as a base
layer, with Vector and Marker layer overlays. My application draws
markers on the Marker layer, then draws a Vector layer with points at
the same exact locations as the markers but connected by lines.
I noticed some odd behavior when I switch base maps using the
LayerSwitcher control. It seems as though Google Maps uses a different
aspect ratio for its tiles than the WMS implementation - toggling
between the two layers shows that the features on the tiles in the
Google layer do not precisely line up with the features on the tiles in
the WMS layer (Google tiles seem "narrower" than the WMS ones). Since
these two layers are never seen at the same time, this is generally not
a problem.
What is a problem is this: when I switch from WMS to Google, the markers
appear above the identical feature regardless of the base map. Because
the aspect ratio changes, switching layers without panning the map
causes the markers to appear to "jump" from one spot on the screen to
another as the base map changes. This is exactly the behavior I expect.
However, the points of the lines drawn on the Vector layer do not shift
along with the markers on the Marker layer - the Vector layer features
remain fixed on the screen.
The difference between the Vector layer points and Marker layer markers
seems to be in vertical position (latitude) only - the lines appear
either too high or too low on the Google map relative to the markers.
Horizontal position (longitude) seems to be correct.
The upshot is that the lines are in the correct positions when WMS is
the base layer, but they are in the wrong positions (not connected to
the markers) when Google is used as the base. Panning the map causes the
markers to remain in the correct positions regardless of base map. But
the vector features float around as the map is panned, not staying in
fixed positions relative to the features on the tiles.
Has anyone else noticed this behavior? Am I doing something wrong? Any
ideas for a fix?
-eP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20070613/224567a7/attachment.html
More information about the Dev
mailing list