Monday, October 30, 2006

'load' GEvent of overview map

Oh yes. I took time to enhance the event test page. I will publish 2.0 beta very soon. During testing I made some discovery.

It has been a common practice to apply a small delay when setting the initial map type or position of overview map.

I happened to find a GEvent 'load' that is probably intended for the purpose.

var ovMap=new GOverviewMapControl();
map.addControl(ovMap);
var mini=map.getOverviewMap();

GEvent.addListener(mini,"load",function(){
mini.setZoom(14);
mini.setMapType(G_SATELLITE_MAP);
});
Seems to work perfect.

No comments: