custom mouse position styling
This commit is contained in:
@@ -149,15 +149,10 @@ var MousePositionControl = L.Control.extend({
|
||||
|
||||
onAdd: function () {
|
||||
var container = L.DomUtil.create('div', 'mouse-position-display');
|
||||
container.style.background = 'rgba(255,255,255,0.85)';
|
||||
container.style.padding = '2px 8px';
|
||||
container.style.fontSize = '12px';
|
||||
container.style.borderRadius = '4px';
|
||||
container.style.fontFamily = 'monospace';
|
||||
container.innerHTML = 'Lat: — | Lng: —';
|
||||
container.innerHTML = 'Lat: , Lng: ';
|
||||
|
||||
map.on('mousemove', function (e) {
|
||||
container.innerHTML = 'Lat: ' + e.latlng.lat.toFixed(5) + ' | Lng: ' + e.latlng.lng.toFixed(5);
|
||||
container.innerHTML = 'Lat: ' + e.latlng.lat.toFixed(5) + ', Lng: ' + e.latlng.lng.toFixed(5);
|
||||
});
|
||||
|
||||
return container;
|
||||
|
||||
Reference in New Issue
Block a user