[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:04:40 EDT 2008
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
More information about the Dev
mailing list