diff --git a/examples/zoom.html b/examples/zoom.html deleted file mode 100644 index 7b15297d05..0000000000 --- a/examples/zoom.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - OpenLayers Zoom Example - - - - - -

Zoom Control Example

-
zoom control
- -
Shows how to use a simple zoom control.
- -
-

The map above uses the default control configuration and style.

-

The map below uses the custom zoom elements and styling.

-
-
- in - out -
-
- -
-

This example demonstrates the use of a Zoom control.

-

- See the zoom.js source - for details. -

-
- - - - diff --git a/examples/zoom.js b/examples/zoom.js deleted file mode 100644 index 08694ccad4..0000000000 --- a/examples/zoom.js +++ /dev/null @@ -1,34 +0,0 @@ -var map = new OpenLayers.Map({ - div: "map", - layers: [new OpenLayers.Layer.OSM()], - controls: [ - new OpenLayers.Control.Navigation({ - dragPanOptions: { - enableKinetic: true - } - }), - new OpenLayers.Control.Attribution(), - new OpenLayers.Control.Zoom() - ], - center: [0, 0], - zoom: 1 -}); - -var map2 = new OpenLayers.Map({ - div: "map2", - layers: [new OpenLayers.Layer.OSM()], - controls: [ - new OpenLayers.Control.Navigation({ - dragPanOptions: { - enableKinetic: true - } - }), - new OpenLayers.Control.Attribution(), - new OpenLayers.Control.Zoom({ - zoomInId: "customZoomIn", - zoomOutId: "customZoomOut" - }) - ], - center: [0, 0], - zoom: 1 -}); diff --git a/lib/OpenLayers.js b/lib/OpenLayers.js index fdc91bd366..b67381d4b5 100644 --- a/lib/OpenLayers.js +++ b/lib/OpenLayers.js @@ -204,7 +204,6 @@ "OpenLayers/Control/Graticule.js", "OpenLayers/Control/TransformFeature.js", "OpenLayers/Control/SLDSelect.js", - "OpenLayers/Control/Zoom.js", "OpenLayers/Geometry.js", "OpenLayers/Geometry/Collection.js", "OpenLayers/Geometry/Point.js", diff --git a/lib/OpenLayers/Control/Zoom.js b/lib/OpenLayers/Control/Zoom.js deleted file mode 100644 index 2913cf3e48..0000000000 --- a/lib/OpenLayers/Control/Zoom.js +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for - * full list of contributors). Published under the Clear BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the - * full text of the license. */ - -/** - * @requires OpenLayers/Control.js - * @requires OpenLayers/Events/buttonclick.js - */ - -/** - * Class: OpenLayers.Control.Zoom - * The Zoom control is a pair of +/- links for zooming in and out. - * - * Inherits from: - * - - */ -OpenLayers.Control.Zoom = OpenLayers.Class(OpenLayers.Control, { - - /** - * APIProperty: zoomInText - * {String} - * Text for zoom-in link. Default is "+". - */ - zoomInText: "+", - - /** - * APIProperty: zoomInId - * {String} - * Instead of having the control create a zoom in link, you can provide - * the identifier for an anchor element already added to the document. - * By default, an element with id "olZoomInLink" will be searched for - * and used if it exists. - */ - zoomInId: "olZoomInLink", - - /** - * APIProperty: zoomOutText - * {String} - * Text for zoom-out link. Default is "-". - */ - zoomOutText: "-", - - /** - * APIProperty: zoomOutId - * {String} - * Instead of having the control create a zoom out link, you can provide - * the identifier for an anchor element already added to the document. - * By default, an element with id "olZoomOutLink" will be searched for - * and used if it exists. - */ - zoomOutId: "olZoomOutLink", - - /** - * Method: draw - * - * Returns: - * {DOMElement} A reference to the DOMElement containing the zoom links. - */ - draw: function() { - var div = OpenLayers.Control.prototype.draw.apply(this), - links = this.getOrCreateLinks(div), - zoomIn = links.zoomIn, - zoomOut = links.zoomOut, - bind = OpenLayers.Function.bind; - - this.events.register("buttonclick", this, this.onZoomClick); - this.zoomInLink = zoomIn; - this.zoomOutLink = zoomOut; - return div; - }, - - /** - * Method: getOrCreateLinks - * - * Parameters: - * el - {DOMElement} - * - * Return: - * {Object} Object with zoomIn and zoomOut properties referencing links. - */ - getOrCreateLinks: function(el) { - var zoomIn = document.getElementById(this.zoomInId), - zoomOut = document.getElementById(this.zoomOutId), - eventElement = zoomOut ? zoomOut.parentNode : this.div; - this.events.attachToElement(eventElement); - if (!zoomIn) { - zoomIn = document.createElement("a"); - zoomIn.href = "#zoomIn"; - zoomIn.appendChild(document.createTextNode(this.zoomInText)); - zoomIn.className = "olControlZoomIn"; - el.appendChild(zoomIn); - } - OpenLayers.Element.addClass(zoomIn, "olButton"); - if (!zoomOut) { - zoomOut = document.createElement("a"); - zoomOut.href = "#zoomOut"; - zoomOut.appendChild(document.createTextNode(this.zoomOutText)); - zoomOut.className = "olControlZoomOut"; - el.appendChild(zoomOut); - } - OpenLayers.Element.addClass(zoomOut, "olButton"); - return { - zoomIn: zoomIn, zoomOut: zoomOut - }; - }, - - /** - * Method: onZoomClick - * Called when zoomin/out link is clicked. - */ - onZoomClick: function(evt) { - var propagate = true, - button = evt.buttonElement; - if (button === this.zoomInLink) { - this.map.zoomIn(); - propagate = false; - } else if (button === this.zoomOutLink) { - this.map.zoomOut(); - propagate = false; - } - return propagate; - }, - - /** - * Method: destroy - * Clean up. - */ - destroy: function() { - if (this.zoomInLink) { - this.zoomInLink.onclick = null; - delete this.zoomInLink; - } - if (this.zoomOutLink) { - this.zoomOutLink.onclick = null; - delete this.zoomOutLink; - } - OpenLayers.Control.prototype.destroy.apply(this); - }, - - CLASS_NAME: "OpenLayers.Control.Zoom" -}); diff --git a/tests/Control/Zoom.html b/tests/Control/Zoom.html deleted file mode 100644 index 724fe4a5df..0000000000 --- a/tests/Control/Zoom.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - -
- - diff --git a/tests/list-tests.html b/tests/list-tests.html index 7c4cb1d402..92ebdec19a 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -45,7 +45,6 @@
  • Control/WMTSGetFeatureInfo.html
  • Control/PanPanel.html
  • Control/SLDSelect.html
  • -
  • Control/Zoom.html
  • Events.html
  • Events/buttonclick.html
  • Extras.html
  • diff --git a/theme/default/style.css b/theme/default/style.css index aa0a2c6bb6..c695689ff7 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -429,43 +429,6 @@ span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { background-position: -26px -24px; } -div.olControlZoom { - position: absolute; - top: 8px; - left: 8px; -} -div.olControlZoom a { - display: block; - margin: 2px; - padding: 0 4px; - color: white; - font-size: 18px; - font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; - font-weight: bold; - text-decoration: none; - text-align: center; - height: 22px; - width: 15px; - line-height: 22px; - background: #666666; /* fallback for IE - IE6 requires background shorthand*/ - background: rgba(0, 0, 0, 0.3); - border: 1px solid; - border-color: #ffffff; /* fallback for IE */ - border-color: rgba(255, 255, 255, 0.6); - filter: alpha(opacity=60); -} -div.olControlZoom a:hover { - background: #444444; /* fallback for IE */ - background: rgba(0, 0, 0, 0.5); - filter: alpha(opacity=80); -} -a.olControlZoomIn { - border-radius: 5px 5px 0 0; -} -a.olControlZoomOut { - border-radius: 0 0 5px 5px; -} - /** * Animations */