[OpenLayers-Users] Can't get overview map in the right scale

Linde Ackermans roselinda.ackermans at ec.europa.eu
Fri Jun 26 08:10:02 EDT 2009


Hey,

I need some help with the overview map control. My overview map initializes
with the wrong scale, namely the second scale (thus 5000000 in the case of
the example below, in stead of 20000000 ), whatever I try to configure. 
How can I get there ?


This is my code:

  	var map = new OpenLayers.Map('center', {
    	    projection: "EPSG:3035"
    	    ,units: 'm'
            ,numZoomLevels: 7
            ,maxExtent: bounds
            ,tileSize: tilesize
            ,scales: [ 20000000,5000000,2500000,1000000,500000,250000,100000
]
            ,resolutions:
[5291.663809168211,1322.9159522920527,661.4579761460263,264.5831904584105,132.29159522920526,66.14579761460263,26.458319045841044]
            ,controls: [new OpenLayers.Control.PanZoomBar()]
        });
 
	var bg = new  OpenLayers.Layer.TileCache("Background",
"http://...","layername",{isBaseLayer:true});

 	var ovmapoptions = {
	    projection: "EPSG:3035"
    	    ,units: 'm'
            ,maxExtent: bounds
            ,tileSize: tilesize
            ,scales: [ 20000000,5000000,2500000,1000000,500000,250000,100000
]
            ,resolutions:
[5291.663809168211,1322.9159522920527,661.4579761460263,264.5831904584105,132.29159522920526,66.14579761460263,26.458319045841044]
	    ,layers: [bg]
	};

	map.addControl(new OpenLayers.Control.OverviewMap(
		{div: OpenLayers.Util.getElement('overview'),
		size: new OpenLayers.Size(200, 128),
		autoPan: true,
		mapOptions: ovmapoptions}));


Thanks.
Linde



-- 
View this message in context: http://n2.nabble.com/Can%27t-get-overview-map-in-the-right-scale-tp3161154p3161154.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list