[OpenLayers-Users] markers changing position on zoom

JuKiM rifins at gmail.com
Thu Apr 29 07:04:18 EDT 2010


P.S. Can this be related to the new version 2.9?

Thanks!!

2010/4/29 JuKiM <rifins at gmail.com>

> 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/01b6746b/attachment.html


More information about the Users mailing list