[OpenLayers-Dev] change default size of the overview map controller

Frédéric Junod frederic.junod at camptocamp.com
Wed Dec 5 10:14:45 EST 2007


Le Wed, 5 Dec 2007 14:55:17 +0000,
"Val Cartei" <val.cartei at gmail.com> a écrit :

> Why changing the size of the overview map controller doesn't cause the
> overviewmap to resize itself?
> 
> /* set the new width, height */
> var size = {w: newWidth, h:newHeight};
> var options = {size: new OpenLayers.Size(size)};
> /* add new control to the map*/
> map.addControl(new OpenLayers.Control.OverviewMap(options));
> 
> 

Your size object is incorrect, it should be:

var options = {size: new OpenLayers.Size(newWidth, newHeight)};
map.addControl(new OpenLayers.Control.OverviewMap(options));

see: http://dev.openlayers.org/apidocs/files/OpenLayers/BaseTypes/Size-js.html

Regards,

fredj
-- 
Frédéric Junod
Camptocamp SA



More information about the Dev mailing list