Use custom zoom control everywhere
This commit is contained in:
parent
9d5b81094c
commit
de5a225a95
8 changed files with 15 additions and 16 deletions
|
@ -5,6 +5,7 @@
|
||||||
//= require augment
|
//= require augment
|
||||||
//= require leaflet
|
//= require leaflet
|
||||||
//= require leaflet.osm
|
//= require leaflet.osm
|
||||||
|
//= require leaflet.zoom
|
||||||
//= require leaflet.extend
|
//= require leaflet.extend
|
||||||
//= require leaflet.locationfilter
|
//= require leaflet.locationfilter
|
||||||
//= require i18n/translations
|
//= require i18n/translations
|
||||||
|
|
|
@ -5,7 +5,7 @@ $(document).ready(function () {
|
||||||
zoomControl: false
|
zoomControl: false
|
||||||
}).addLayer(new L.OSM.Mapnik());
|
}).addLayer(new L.OSM.Mapnik());
|
||||||
|
|
||||||
L.control.zoom({position: 'topright'})
|
L.OSM.zoom()
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
$("#small_map").on("resized", function () {
|
$("#small_map").on("resized", function () {
|
||||||
|
|
|
@ -6,7 +6,7 @@ $(document).ready(function () {
|
||||||
zoomControl: false
|
zoomControl: false
|
||||||
}).addLayer(new L.OSM.Mapnik());
|
}).addLayer(new L.OSM.Mapnik());
|
||||||
|
|
||||||
L.control.zoom({position: 'topright'})
|
L.OSM.zoom()
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
$("#changeset_list_map").on("resized", function () {
|
$("#changeset_list_map").on("resized", function () {
|
||||||
|
|
|
@ -27,7 +27,7 @@ $(document).ready(function () {
|
||||||
zoomControl: false
|
zoomControl: false
|
||||||
}).addLayer(new L.OSM.Mapnik());
|
}).addLayer(new L.OSM.Mapnik());
|
||||||
|
|
||||||
L.control.zoom({position: 'topright'})
|
L.OSM.zoom()
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
$("#map").on("resized", function () {
|
$("#map").on("resized", function () {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//= require_self
|
//= require_self
|
||||||
//= require leaflet.sidebar
|
//= require leaflet.sidebar
|
||||||
//= require leaflet.customzoom
|
|
||||||
//= require leaflet.locate
|
//= require leaflet.locate
|
||||||
//= require leaflet.layers
|
//= require leaflet.layers
|
||||||
//= require leaflet.key
|
//= require leaflet.key
|
||||||
|
@ -56,7 +55,7 @@ $(document).ready(function () {
|
||||||
map.invalidateSize();
|
map.invalidateSize();
|
||||||
});
|
});
|
||||||
|
|
||||||
L.control.customZoom({position: 'topright'})
|
L.OSM.zoom({position: 'topright'})
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
L.control.locate({position: 'topright'})
|
L.control.locate({position: 'topright'})
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
/*
|
L.OSM.Zoom = L.Control.extend({
|
||||||
* L.Control.CustomZoom is used for the default zoom buttons on the map.
|
|
||||||
*/
|
|
||||||
|
|
||||||
L.Control.CustomZoom = L.Control.extend({
|
|
||||||
options: {
|
options: {
|
||||||
position: 'topleft'
|
position: 'topright'
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function (map) {
|
onAdd: function (map) {
|
||||||
|
@ -14,9 +10,9 @@ L.Control.CustomZoom = L.Control.extend({
|
||||||
this._map = map;
|
this._map = map;
|
||||||
|
|
||||||
this._zoomInButton = this._createButton(
|
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(
|
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);
|
map.on('zoomend zoomlevelschange', this._updateDisabled, this);
|
||||||
|
|
||||||
|
@ -71,6 +67,6 @@ L.Control.CustomZoom = L.Control.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
L.control.customZoom = function (options) {
|
L.OSM.zoom = function (options) {
|
||||||
return new L.Control.CustomZoom(options);
|
return new L.OSM.Zoom(options);
|
||||||
};
|
};
|
|
@ -4,7 +4,7 @@ $(document).ready(function () {
|
||||||
zoomControl: false
|
zoomControl: false
|
||||||
}).addLayer(new L.OSM.Mapnik());
|
}).addLayer(new L.OSM.Mapnik());
|
||||||
|
|
||||||
L.control.zoom({position: 'topright'})
|
L.OSM.zoom()
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
|
|
||||||
$("#map").on("resized", function () {
|
$("#map").on("resized", function () {
|
||||||
|
|
|
@ -2046,6 +2046,9 @@ en:
|
||||||
title: "Map Key"
|
title: "Map Key"
|
||||||
tooltip: "Key for the map"
|
tooltip: "Key for the map"
|
||||||
map:
|
map:
|
||||||
|
zoom:
|
||||||
|
in: Zoom In
|
||||||
|
out: Zoom Out
|
||||||
base:
|
base:
|
||||||
standard: Standard
|
standard: Standard
|
||||||
cycle_map: Cycle Map
|
cycle_map: Cycle Map
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue