Add buttons to the PanZoom control which currently allow you to zoom to any level. Add a 'zoomTo' function that
allows you to specify a level. This will need to be refactored: Possibly the zoom control will become part of a subclass of PanZoom, "largePanZoom", which has a smaller set of controls. Also add a DEFAULT_ZOOM_LEVELS setting, and an accesssor for said setting. git-svn-id: http://svn.openlayers.org/trunk/openlayers@23 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
OpenLayers.Map = Class.create();
|
||||
OpenLayers.Map.prototype = {
|
||||
|
||||
// int zoom levels, used to draw zoom dragging control
|
||||
DEFAULT_ZOOM_LEVELS: 16,
|
||||
|
||||
// OpenLayers.Bounds
|
||||
DEFAULT_FULL_EXTENT: new OpenLayers.Bounds(-90, -180, 90, 180),
|
||||
|
||||
@@ -170,6 +173,10 @@ OpenLayers.Map.prototype = {
|
||||
getFullExtent: function () {
|
||||
return this.DEFAULT_FULL_EXTENT;
|
||||
},
|
||||
|
||||
getZoomLevels: function() {
|
||||
return this.DEFAULT_ZOOM_LEVELS;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
@@ -244,6 +251,15 @@ OpenLayers.Map.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* zoomTo
|
||||
* Set Zoom To int
|
||||
*/
|
||||
zoomTo: function(zoom) {
|
||||
this.zoom = zoom;
|
||||
this.moveToNewExtent(true);
|
||||
},
|
||||
|
||||
/**
|
||||
* zoomOut
|
||||
* Decrease zoom level by one.
|
||||
|
||||
Reference in New Issue
Block a user