Sorry, There was a break line, I wanted to say:<br><br>When I insert a marker in the marker layers it is correctly situed in the map,<br> but when I insert a vector in the vector layer, ONLY IN EXPLORER is<br> drawn ok, in firefox and in opera the vector...<br>
<br>... 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).<br>And yes, I have centered the icon in the map :). <br>The problem is that the layer "moves" when I pan the map. <br>
For exemple, I center a vertex of the vector (wich is a line Barcelona-Sabadell) in the map screen. <br>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)<br>
<br>Sorry for this second message :)<br>Thanks!<br><br>Esteban<br><br><br><div><span class="gmail_quote">2008/3/18, Esteban olm <<a href="mailto:esteban.olm@gmail.com">esteban.olm@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br> <br> I'm sorry if my english is not very good :)<br> (In this example I have omitted code to simplify, but the important<br> code is here)<br> <br> I have a problem. I use OpenLayers 2.5, and I have created a map with<br>
Google Maps as base layer:<br> <br> var Opciones = {<br> numZoomLevels: 18,<br> controls: [<br> new OpenLayers.Control.MouseDefaults()<br> ],<br> 'numZoomLevels':this.ZOOM_MAX<br>
};<br> // avoid pink tiles<br> OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;<br> OpenLayers.Util.onImageLoadErrorColor = "transparent";<br> var map = new OpenLayers.Map( Div ,Opciones);<br> <br>
<br> I insert two more layers in the map: a marker layer and a vector layer.<br> <br> var MarkerLayer = new OpenLayers.Layer.Markers(NombreMarkerLayer);<br> MarkerLayer.id = MIDLayer;<br> map.addLayer(MarkerLayer);<br>
<br> var VectorLayer = new OpenLayers.Layer.Vector(NombreVectorLayer);<br> VectorLayer.id = IDLayer;<br> map.addLayer(VectorLayer);<br> <br> <br> <br> Now I insert two markers:<br> <br> Sabadell, (Lat, Long)(41.548593, 2.10744)<br>
Barcelona, (Lat, Long)(41.387917, 2.169919)<br> <br> Now I create a polyline with two OpenLayer.Geometry.Point<br> <br> (X,Y) (2.10744, 41.548593) <- Sabadell city<br> (X,Y) (2.01044, 41.560953) <- Barcelona city<br>
<br> // create a style for the polyline<br> ArrayPuntos <- Array with two OpenLayers.Geometry.Point<br> var normalStyle = OpenLayers.Util.extend(<br> {},<br> OpenLayers.Feature.Vector.style["default"]<br>
);<br> var Geometria = new OpenLayers.Feature.Vector(<br> new OpenLayers.Geometry.LineString(ArrayPuntos),<br> null, normalStyle);<br> <br> <br> When I insert a marker in the marker layers it is correctly situed in the map,<br>
but when I insert a vector in the vector layer, ONLY IN EXPLORER is<br> drawn ok, in firefox and in opera the vector layer.<br> <br> I have not where is the problem,<br> PLEASE HELP!!<br> Or is a reported bug??<br> <br> Maybe I have to set any options in the map?? (EPSG?) I don't know, please help.<br>
Thanks vey much<br> <br><br> <br> Esteban<br> </blockquote></div><br>