From 4ca4622aae3fdc248aec97d29b3c7862e3b1c143 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Mon, 13 Feb 2012 23:25:35 -0500 Subject: [PATCH] Added support to set the position of the zoom control --- src/control/Control.Zoom.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/control/Control.Zoom.js b/src/control/Control.Zoom.js index 38cfd8e2..b62cddb9 100644 --- a/src/control/Control.Zoom.js +++ b/src/control/Control.Zoom.js @@ -1,5 +1,9 @@ L.Control.Zoom = L.Class.extend({ + initialize: function () { + this._zoomPosition = L.Control.Position.TOP_LEFT; + }, + onAdd: function (map) { this._map = map; this._container = L.DomUtil.create('div', 'leaflet-control-zoom'); @@ -18,7 +22,11 @@ L.Control.Zoom = L.Class.extend({ }, getPosition: function () { - return L.Control.Position.TOP_LEFT; + return this._zoomPosition; + }, + + setPosition: function (position) { + this._zoomPosition = position; }, _createButton: function (title, className, fn, context) {