[OpenLayers-Users] problems with the overview map

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Wed Feb 14 13:22:12 EST 2007


Hi Lars,

I've had the most luck with overriding the isSuitableOverview function 
to always return true, example is:

    overviewmap = new OpenLayers.Control.OverviewMap( {layers: [overviewlayer0,overviewlayer1], div: $('miniMapContainer'), 'size': new OpenLayers.Size(174, 204), isSuitableOverview: function() {return true;}, mapOptions: options});


    map.addControl(overviewmap);


Best regards,
Bart

Lars Schrader schreef:
> Hello,
>
> I`ve got a problem with the OverviewMap. I have read some postings from the 
> list and the entry in the wiki, but I can´t find a solution for my problem.
>
> 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.
>
> I have send the non-default options from the main map to the constructor of 
> the overview.
>
> I thought, that the entry 'numZoomLevels: 1' can solve the problem with the 
> 'No Zoom-In and no Zoom-Out', but it doesn´t work.
>
> How can I define a Bounding Box for the OverviewMap, which always shows the 
> complete view of the OverviewMap-Layer (that´s the maxExtent-Entry in the 
> code)? 
>
> Hope anybody can help me. 
>
> Greetings, Lars  
>
>
>
>         var optionsOverview = {div: $('overviewdiv')
>                                 , projection: "EPSG:31467"
>                                 , units: 'm'
>                                 , maxExtent:new 
> OpenLayers.Bounds(3344905,5685539,3663844,5970992)
>                                 , resolutions: [35,30,25,20,12,9,6,4,2,1] 
>                                 , layers:[overviewMap.clone()]
>                                 , 'size': new OpenLayers.Size(300,300) 
>                                 //, minRatio: 8
>                                 //, maxRatio: 32
>                                 , numZoomLevels: 1
>                                 };
>             
>             var ovControl = new 
> OpenLayers.Control.OverviewMap(optionsOverview);
>
>             ovControl.isSuitableOverview = function() {
>                                          return false;
>             };
>             
>             map.addControl(ovControl);
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
>   


-- 
Bart van den Eijnden
OSGIS, Open Source GIS
bartvde at osgis.nl
http://www.osgis.nl




More information about the Users mailing list