Keep measurement info windows open

This commit is contained in:
Zakary Timson 2019-08-24 12:45:40 -04:00
parent ab8fc7dd3b
commit f641867551
2 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,7 @@ export class MapService {
]}).addTo(this.map);
this.measurements.push({line: line, decoration: decoration});
let distance = distanceInM(latlng1.lat, latlng1.lng, latlng2.lat, latlng2.lng);
line.bindPopup(`${distance > 1000 ? Math.round(distance / 100) / 10 : Math.round(distance)} ${distance > 1000 ? 'k' : ''}m`).openPopup();
line.bindPopup(`${distance > 1000 ? Math.round(distance / 100) / 10 : Math.round(distance)} ${distance > 1000 ? 'k' : ''}m`, {autoClose: false, closeOnClick: false}).openPopup();
line.on('click', () => { if(this.deleteMode) this.delete(line, decoration);});
return {line: line, decoration: decoration};
}

View File

@ -12,11 +12,11 @@ if (environment.production) {
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
// Add touch events to leaflet
// leaflet ===========================================
declare const L;
// Touch support
L.Map.mergeOptions({touchExtend: true});
L.Map.TouchExtend = L.Handler.extend({
initialize: function (map) {
this._map = map;