Add an autoPan property to the overview map. Set this to true if you want the extent marker to return to the center of the overview map after you drag it. Thanks for the patch jachym. r=me (closes #1770)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8805 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-02-03 00:52:07 +00:00
parent 3edb925487
commit 742b066aa7

View File

@@ -78,24 +78,33 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: minRatio
* {Float} The ratio of the overview map resolution to the main map
* resolution at which to zoom farther out on the overview map.
* resolution at which to zoom farther out on the overview map.
*/
minRatio: 8,
/**
* APIProperty: maxRatio
* {Float} The ratio of the overview map resolution to the main map
* resolution at which to zoom farther in on the overview map.
* resolution at which to zoom farther in on the overview map.
*/
maxRatio: 32,
/**
* APIProperty: mapOptions
* {Object} An object containing any non-default properties to be sent to
* the overview map's map constructor. These should include any non-default
* options that the main map was constructed with.
* the overview map's map constructor. These should include any
* non-default options that the main map was constructed with.
*/
mapOptions: null,
/**
* APIProperty: autoPan
* {Boolean} Always pan the overview map, so the extent marker remains in
* the center. Default is false. If true, when you drag the extent
* marker, the overview map will update itself so the marker returns
* to the center.
*/
autoPan: true,
/**
* Property: handlers
@@ -387,7 +396,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
this.createMap();
}
if(!this.isSuitableOverview()) {
if(this.autoPan || !this.isSuitableOverview()) {
this.updateOverview();
}