[OpenLayers-Users] problems with the overview map
Tim Schaub
noreply at geocartic.com
Thu Feb 15 11:11:46 EST 2007
Lars Schrader wrote:
> One another problem: Is at right, that the layer for the overview map must be
> a base layer?
The map for the overview control is just the same as any other map - so
you can add whatever layers you choose. Just construct the control with
options like:
var options = {mapOptions: {layers: [layer0, layer1, layer2]}};
Note that these layers should be constructed specifically for the
overview map (and not already added to the main map). You can clone
layers already added to the main map before adding them to the overview
map (this is done by default for the main map's base layer if you don't
pass the overview map any layers at all).
Also, if you want to do things with your overview map after you have
added the control, just assign it to some variable that you can later
access:
var ov = new OpenLayers.Control.OverviewMap(options);
// now you can get the control's map with ov.ovmap
Tim
>
> Greetings, Lars
>
> Am Mittwoch, 14. Februar 2007 18:25 schrieb Tim Schaub:
>> Lars Schrader wrote:
>>> What I want to have is a OverviewMap, which always shows the complete
>>> area of interest (the complete WMS-Layer). No Zoom-In and no Zoom-Out.
>>> Only the red rectangle should change his position.
>> The numZoomLevels has to be set on the mapOptions property of the
>> control's options.
>>
>> var options = {mapOptions: {numZoomLevels: 1}};
>> map.addControl(new OpenLayers.Control.OverviewMap(options));
>>
>> This is also true of any other options that you want to set on the
>> overview map control's map. For example, instead of setting maxExtent
>> as a property of the control, it needs to be set as a property of the
>> control's map - this is done with the mapOptions property of the control.
>>
>> This is a bit confusing without looking at an example. Take a look at
>> the examples on the wiki page
>> (http://trac.openlayers.org/wiki/Control/OverviewMap#Customprojectionsexten
>> tsetc.)
>>
>> Write back if you still have trouble.
>>
>> Tim
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list