[OpenLayers-Users] problems with IE7 map.zoomToExtent(box);

Luis Ortiz (lortiz) lortiz at compegps.com
Mon Apr 6 10:49:43 EDT 2009



We found a drawing problems with IE7.

When we do this methods:


var box = new OpenLayers.Bounds(-9.393635,35.085571,4.369524,43.867627);
// left, bottom,right, top
box.transform(map.displayProjection,map.getProjectionObject());
map.zoomToExtent(box);


We see that in firefox is working well. Map is zoom & centered in this box.

But in IE7 not.

See images:

with firefox:
http://img151.imageshack.us/img151/1327/mozscreenshot41.jpg


with IE7:
http://img151.imageshack.us/img151/2310/mozscreenshot42.jpg




You can see that at first load of this page is seen this (gphy is not
well placed, only are loaded half of the inside tiles and the map seems
not well placed), but if you move the map in IE7 then this effect
desappear and work well. Only happend onload.

I tryied to change the parameteres option of loaded layers but still
happends.

Here are the loaded layers & options.

var options = {
		eventListeners: {
			"moveend": mapEvent,
	        "zoomend": mapEvent
    	},
        projection: new OpenLayers.Projection("EPSG:900913"),
        displayProjection: new OpenLayers.Projection("EPSG:4326"),
        units: "m",
        numZoomLevels: 18,
        maxResolution: 156543.0339,
        maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                         20037508, 20037508.34),
        controls: []                
    };

map = new OpenLayers.Map("map", options);

//control elements to be added
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.KeyboardDefaults());
map.addControl(new OpenLayers.Control.ScaleLine());
map.addControl(new OpenLayers.Control.LayerSwitcher());

        
//basic VMap0 layer
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS","http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );

var aStyleMap = new OpenLayers.StyleMap();
aStyleMap.addUniqueValueRules("default", "visibility", {'visible':{fillColor: "#ff7a7a", strokeColor: "#ff0000"}});
aStyleMap.addUniqueValueRules("default", "zindex", {"low":{graphicZIndex: 50}, "high":{graphicZindex: 100}});
var gmap = new OpenLayers.Layer.Google("Google Streets",{'sphericalMercator': true} );
var gsat = new OpenLayers.Layer.Google("Google Satellite",{type: G_SATELLITE_MAP, 'sphericalMercator': true, numZoomLevels: 22});
var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: G_HYBRID_MAP, 'sphericalMercator': true});
var gphy = new OpenLayers.Layer.Google("Google Physical",{type: G_PHYSICAL_MAP, 'sphericalMercator': true});



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090406/de18a82c/attachment.html


More information about the Users mailing list