]> git.openstreetmap.org Git - rails.git/commitdiff
Use custom zoom control everywhere
authorJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 13 Jun 2013 22:19:03 +0000 (15:19 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Thu, 18 Jul 2013 17:45:16 +0000 (10:45 -0700)
app/assets/javascripts/application.js
app/assets/javascripts/browse.js
app/assets/javascripts/changeset.js
app/assets/javascripts/diary_entry.js
app/assets/javascripts/index.js
app/assets/javascripts/leaflet.zoom.js [moved from app/assets/javascripts/leaflet.customzoom.js with 79% similarity]
app/assets/javascripts/user.js
config/locales/en.yml

index f5022683b8050fec55c3c346664e835996c566a0..0ee6dc8806a7c94607619259352e92970668b58f 100644 (file)
@@ -5,6 +5,7 @@
 //= require augment
 //= require leaflet
 //= require leaflet.osm
+//= require leaflet.zoom
 //= require leaflet.extend
 //= require leaflet.locationfilter
 //= require i18n/translations
index c39e8382c6dc8d1ab445bfcf97770614cee3f0f5..2d9c4b46f785cb441ad78aff97a38a9d8bd53d98 100644 (file)
@@ -5,7 +5,7 @@ $(document).ready(function () {
     zoomControl: false
   }).addLayer(new L.OSM.Mapnik());
 
-  L.control.zoom({position: 'topright'})
+  L.OSM.zoom()
     .addTo(map);
 
   $("#small_map").on("resized", function () {
index 7f21ae7440d1386b78269299e22b023621adf307..26c2351fa30086cde2fd5cdffc94d171633b1578 100644 (file)
@@ -6,7 +6,7 @@ $(document).ready(function () {
     zoomControl: false
   }).addLayer(new L.OSM.Mapnik());
 
-  L.control.zoom({position: 'topright'})
+  L.OSM.zoom()
     .addTo(map);
 
   $("#changeset_list_map").on("resized", function () {
index e17f59ad2fcde45205e43364b0d9677ccd3f1dd0..7c420b671b679901230be1b041a336e0bec676b4 100644 (file)
@@ -27,7 +27,7 @@ $(document).ready(function () {
       zoomControl: false
     }).addLayer(new L.OSM.Mapnik());
 
-    L.control.zoom({position: 'topright'})
+    L.OSM.zoom()
       .addTo(map);
 
     $("#map").on("resized", function () {
index 7988541a680fb4b12d8d13d044a544d2cae49ff4..6ea27623084a384d8c5c0122efe5937e234b06ea 100644 (file)
@@ -1,6 +1,5 @@
 //= require_self
 //= require leaflet.sidebar
-//= require leaflet.customzoom
 //= require leaflet.locate
 //= require leaflet.layers
 //= require leaflet.key
@@ -56,7 +55,7 @@ $(document).ready(function () {
     map.invalidateSize();
   });
 
-  L.control.customZoom({position: 'topright'})
+  L.OSM.zoom({position: 'topright'})
     .addTo(map);
 
   L.control.locate({position: 'topright'})
similarity index 79%
rename from app/assets/javascripts/leaflet.customzoom.js
rename to app/assets/javascripts/leaflet.zoom.js
index 091a97199852f1105ae1139c66695484a5da71fb..80b4ab1bcedf1e6cfbdf5d92213b222d0081f46e 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * L.Control.CustomZoom is used for the default zoom buttons on the map.
- */
-
-L.Control.CustomZoom = L.Control.extend({
+L.OSM.Zoom = L.Control.extend({
        options: {
-               position: 'topleft'
+               position: 'topright'
        },
 
        onAdd: function (map) {
@@ -14,9 +10,9 @@ L.Control.CustomZoom = L.Control.extend({
                this._map = map;
 
                this._zoomInButton  = this._createButton(
-                       '', 'Zoom in',  zoomName + 'in',  container, this._zoomIn,  this);
+                       '', I18n.t('javascripts.map.zoom.in'),  zoomName + 'in',  container, this._zoomIn,  this);
                this._zoomOutButton = this._createButton(
-                       '', 'Zoom out', zoomName + 'out', container, this._zoomOut, this);
+                       '', I18n.t('javascripts.map.zoom.out'), zoomName + 'out', container, this._zoomOut, this);
 
                map.on('zoomend zoomlevelschange', this._updateDisabled, this);
 
@@ -71,6 +67,6 @@ L.Control.CustomZoom = L.Control.extend({
        }
 });
 
-L.control.customZoom = function (options) {
-       return new L.Control.CustomZoom(options);
+L.OSM.zoom = function (options) {
+       return new L.OSM.Zoom(options);
 };
index 4e646771247c93dad7c67cbe4cd49fd76c85ae0d..b5520aa36e42373ab3fdde9bb693e5c1a0ce56cc 100644 (file)
@@ -4,7 +4,7 @@ $(document).ready(function () {
     zoomControl: false
   }).addLayer(new L.OSM.Mapnik());
 
-  L.control.zoom({position: 'topright'})
+  L.OSM.zoom()
     .addTo(map);
 
   $("#map").on("resized", function () {
index 8be56bd3dbb7117f6bb147b8bd32179f63ae6c45..ad7dc3a51edb4d1854d44050c43ce201f34d5973 100644 (file)
@@ -2046,6 +2046,9 @@ en:
       title: "Map Key"
       tooltip: "Key for the map"
     map:
+      zoom:
+        in: Zoom In
+        out: Zoom Out
       base:
         standard: Standard
         cycle_map: Cycle Map