[OpenLayers-Users] markers changing position on zoom
JuKiM
rifins at gmail.com
Thu Apr 29 07:02:06 EDT 2010
Hi,
I have a baselayer of google maps, and some markers displayed on it.
Then there is an option to draw a line between all the markers, and then
there is another option, of drawing arrows indicating the direction..
My problem is that when I draw the line with the arrows, when I zoom in/out,
the arrows don't stay at place..
If I zoom out one time, and then I zoom in, the arrows are again in the same
place..
If I zoom out one time, move the map, and zoom in, the arrows are displaced
respect the markers..
This is happening in firefox, in IE7 the arrows mantains correctly
I add the layer of the markers like this:
function ResetLyrArrow() {
if (lyrArrowLine) {
lyrArrowLine.destroy();
}
lyrArrowLine = new OpenLayers.Layer.Vector('', {
styleMap: new OpenLayers.StyleMap({
"default": {
"externalGraphic": "images/arrow.png",
"graphicWidth": 11,
"graphicHeight": 11,
"graphicYOffset": -5,
"graphicXOffset": 0,
"rotation": "${angle}"
}
})
});
lyrArrowLine.displayInLayerSwitcher = false;
if (map) {
map.addLayers([lyrArrowLine]);
}
}
Maybe, the layer has to be created with sphericalmercator?
Thanks a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100429/8ed9f16a/attachment.html
More information about the Users
mailing list