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 leaflet
|
||||
//= require leaflet.osm
|
||||
//= require leaflet.zoom
|
||||
//= require leaflet.extend
|
||||
//= require leaflet.locationfilter
|
||||
//= require i18n/translations
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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'})
|
||||
|
|
|
@ -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);
|
||||
};
|
|
@ -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 () {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue