1
0
forked from MTSR/mapserver
mapserver/server/static/js/CoordinatesDisplay.js

22 lines
498 B
JavaScript
Raw Normal View History

2019-02-01 14:58:26 +03:00
'use strict';
2019-01-29 10:36:46 +03:00
2019-02-01 14:58:26 +03:00
// coord display
var CoordinatesDisplay = L.Control.extend({
onAdd: function(map) {
var div = L.DomUtil.create('div', 'leaflet-bar leaflet-custom-display');
function update(ev){
var latlng = ev.latlng;
div.innerHTML = "X:" + parseInt(latlng.lng) + " Z:" + parseInt(latlng.lat);
}
2019-01-29 10:36:46 +03:00
2019-02-01 14:58:26 +03:00
map.on('mousemove', update);
map.on('click', update);
map.on('touch', update);
2019-01-29 10:36:46 +03:00
2019-02-01 14:58:26 +03:00
return div;
},
2019-01-29 10:36:46 +03:00
2019-02-01 14:58:26 +03:00
onRemove: function(map) {
2019-01-29 10:57:35 +03:00
}
2019-02-01 14:58:26 +03:00
});