|
|
@ -97,12 +97,28 @@ var Map = function (parent) { |
|
|
|
L.tileLayer.gaodeOther().addTo(this.map); |
|
|
|
|
|
|
|
$('.leaflet-control-attribution').hide(); |
|
|
|
this.map.on('mousemove', this.OnMapMove.bind(this)) |
|
|
|
}; |
|
|
|
|
|
|
|
this.CenterMap = function (lat, lng) { |
|
|
|
this.map.setView([lat, lng], 11); |
|
|
|
}; |
|
|
|
|
|
|
|
this.OnMapMove = function (e) { |
|
|
|
$('.latlng').text('当前经纬度:{0}, {1}'.format(this.getLatLng(e.latlng.lng), this.getLatLng(e.latlng.lat))) |
|
|
|
}; |
|
|
|
|
|
|
|
this.getLatLng = function (value) { |
|
|
|
value = value.toString() |
|
|
|
let index = value.indexOf('.') |
|
|
|
if (index !== -1) { |
|
|
|
value = value.substring(0, 6 + index + 1) |
|
|
|
} else { |
|
|
|
value = value.substring(0) |
|
|
|
} |
|
|
|
return parseFloat(value).toFixed(6) |
|
|
|
} |
|
|
|
|
|
|
|
this.OnParticleButtonClick = function () { |
|
|
|
// Toggle switch on/off
|
|
|
|
var parent = $(event.target).parent(); |
|
|
|