[OpenLayers-Dev] Openlayers 2.5 doesn't draw vectors correctly in firefox and opera??? but ok in Explorer !!!

Esteban olm esteban.olm at gmail.com
Mon Mar 17 19:17:50 EDT 2008


Sorry, There was a break line, I wanted to say:

When I insert a marker in the marker layers it is correctly situed in the
map,
but when I insert a vector in the vector layer, ONLY IN EXPLORER is
drawn ok, in firefox and in opera the vector...

... layer doesn't fin correctly in the center of the marker (the point wich
represents the center of the marker is also a vertex of the vector).
And yes, I have centered the icon in the map :).
The problem is that the layer "moves" when I pan the map.
For exemple, I center a vertex of the vector (wich is a line
Barcelona-Sabadell) in the map screen.
When I pan the map, when more far away is this vertex of the vector from the
center of the map in the screen, more "out of place" is the vector regards
to its right position. (the vertex of the line Barcelona-Sabadell is
desplaced, so the vector line is not well drawn)

Sorry for this second message :)
Thanks!

Esteban


2008/3/18, Esteban olm <esteban.olm at gmail.com>:
>
> Hello,
>
> I'm sorry if my english is not very good :)
> (In this example I have omitted code to simplify, but the important
> code is here)
>
> I have a problem. I use OpenLayers 2.5, and I have created a map with
> Google Maps as base layer:
>
>          var Opciones = {
>              numZoomLevels: 18,
>              controls: [
>                new OpenLayers.Control.MouseDefaults()
>              ],
>              'numZoomLevels':this.ZOOM_MAX
>           };
>      // avoid pink tiles
>      OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
>      OpenLayers.Util.onImageLoadErrorColor = "transparent";
>      var map = new OpenLayers.Map( Div ,Opciones);
>
>
> I insert two more layers in the map: a marker layer and a vector layer.
>
>    var MarkerLayer = new OpenLayers.Layer.Markers(NombreMarkerLayer);
>    MarkerLayer.id = MIDLayer;
>    map.addLayer(MarkerLayer);
>
>    var VectorLayer = new OpenLayers.Layer.Vector(NombreVectorLayer);
>    VectorLayer.id = IDLayer;
>    map.addLayer(VectorLayer);
>
>
>
> Now I insert two markers:
>
> Sabadell, (Lat, Long)(41.548593, 2.10744)
> Barcelona, (Lat, Long)(41.387917, 2.169919)
>
> Now I create a polyline with two OpenLayer.Geometry.Point
>
> (X,Y) (2.10744, 41.548593)  <- Sabadell city
> (X,Y) (2.01044, 41.560953)  <- Barcelona city
>
> // create a style for the polyline
> ArrayPuntos <- Array with two OpenLayers.Geometry.Point
> var normalStyle = OpenLayers.Util.extend(
>    {},
>    OpenLayers.Feature.Vector.style["default"]
>    );
>    var Geometria = new OpenLayers.Feature.Vector(
>       new OpenLayers.Geometry.LineString(ArrayPuntos),
>       null, normalStyle);
>
>
> When I insert a marker in the marker layers it is correctly situed in the
> map,
> but when I insert a vector in the vector layer, ONLY IN EXPLORER is
> drawn ok, in firefox and in opera the vector layer.
>
> I have not where is the problem,
> PLEASE HELP!!
> Or is a reported bug??
>
> Maybe I have to set any options in the map?? (EPSG?) I don't know, please
> help.
> Thanks vey much
>
>
>
>    Esteban
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20080318/368ace6d/attachment.html


More information about the Dev mailing list