[OpenLayers-Dev] map broken for yahoo/ve...but not wms

mikani gina.m.dang at lmco.com
Mon Jul 13 01:47:16 EDT 2009




mikani wrote:
> 
> My map, for some reason only show one tile image when I switch to
> different layer.
> Can't figure out out... can you help plz...
> Also, it just crashes in IE, and there are no obvious errors that i
> notice...
> 
> 

OP here.  Unfortunately I don't have any url...
But below's my sample code.
I have a simpleTest function as below, and when it gets submitted, i'm
trying to reset the map to whatever the previous bbox was... it brings back
the correct getExtent, but it displays blank tiles and no maps.  

first function is:
function simpleLayer(divName){

			var options = {
                restrictedExtent: extent
            }
            map = new OpenLayers.Map(divName, options);

            var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                          "http://labs.metacarta.com/wms/vmap0",
                          {layers: 'basic'} );
            var ve = new OpenLayers.Layer.VirtualEarth( "VE");

            map.addLayers([wms, ve]);

            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
            //map.setCenter(extent, 1);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.addControl(new OpenLayers.Control.MousePosition());
        	map.addControl(new OpenLayers.Control.Permalink());
        	map.addControl(new OpenLayers.Control.PanZoomBar());
        	map.addControl(new OpenLayers.Control.OverviewMap());
        	map.fractionalZoom = true;
            map.zoomTo(Math.round(map.zoom));
            //alert('ln168.  simpleLayer().  bbox: 
'+map.getExtent().toBBOX());
            return map;

}
....
second one is:
if (pos>=0)
	{
		...
		boundbox = xxx;
		...
    	//var bounds = new OpenLayers.Bounds(boundbox);
    	//alert('bounds: '+ bounds);
    	//map.zoomToExtent(bounds, true);
    	//alert('getCenter:  '+map.getCenter());
    	map.zoomToExtent(new OpenLayers.Bounds(boundbox));
    	//alert('getCenter:  '+map.getCenter());
    	//map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
    	alert('ln1156.  after reset.  map.getExtent().toBBOX():
'+map.getExtent().toBBOX()); 
    }
	else
	{
            if (!map.getCenter()) map.zoomToMaxExtent();
    	}

Appreciate any help!

-- 
View this message in context: http://n2.nabble.com/map-broken-for-yahoo-ve...but-not-wms-tp3248917p3248965.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.



More information about the Dev mailing list