[OpenLayers-Users] How to prevent overview map update while
overview control is minimized
Andreas Hocevar
ahocevar at opengeo.org
Thu Jul 14 08:07:31 EDT 2011
Hi,
when creating subclasses, don't forget to call the superclass's method
when you override methods, e.g.
minimizeControl: function() {
// do your custom stuff
// ...
// call super
OpenLayers.Control.OverviewMap.prototype.minimizeControl.apply(this,
arguments);
},
Having said that, a better approach than changing the
isSuitableOverview method would be to unregister and register the
moveend events in maximizeControl/minimizeControl.
And of course, if you accomplish this, a ticket with a patch would be
greatly appreciated, since this sounds like a bug.
Andreas.
On Tue, Jul 5, 2011 at 3:57 PM, Franz Buchinger <fbuchinger at gmail.com> wrote:
> Hi,
>
> as a performance improvement I want to prevent the overview map from
> updating when it is closed. My approach is to redefine the
> isSuitableOverview method when the control is closed or opened. However,
> this doesn't work as expected, as no overview control at all is shown.
>
> Any ideas?
>
> OpenLayers.Control.MyOverviewMap =
> OpenLayers.Class(OpenLayers.Control.OverviewMap, {
>
> //refresh overview map with every map request
> isSuitableOverview: function() {
> return true;
> },
> minimizeControl: function (){
> //do not update overview map when it is minimized
> this.isSuitableOverview = function (){
> return true;
> }
> },
> maximizeControl: function (){
> //update overview map when it is maximized
> this.isSuitableOverview = function (){
> return false;
> }
> });
>
> Franz
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list