Finish ModifCampiDiRacc
This commit is contained in:
@@ -72,6 +72,10 @@ const _mappaCampiDiRaccolta = {
|
||||
icon: "bookmark",
|
||||
markerColor: "blue"
|
||||
}),
|
||||
gtIcon: L.AwesomeMarkers.icon({
|
||||
icon: "bookmark",
|
||||
markerColor: "red"
|
||||
}),
|
||||
|
||||
isUserPersonale() {
|
||||
return this.module.get_dataSource("isUserPersonale");
|
||||
@@ -386,12 +390,30 @@ const _mappaCampiDiRaccolta = {
|
||||
}
|
||||
});
|
||||
|
||||
let gtMarker;
|
||||
|
||||
$("#gtCoords").on("click", function () {
|
||||
const lat = $("#lat").val();
|
||||
const lng = $("#lng").val();
|
||||
|
||||
if (lat && lng) {
|
||||
self.map.panTo([lat, lng]);
|
||||
if (gtMarker) {
|
||||
gtMarker.remove();
|
||||
}
|
||||
|
||||
self.map.flyTo([lat, lng], 20);
|
||||
|
||||
gtMarker = L.marker([lat, lng], {
|
||||
icon: self.gtIcon
|
||||
});
|
||||
|
||||
gtMarker.on("click", function () {
|
||||
gtMarker.remove();
|
||||
|
||||
gtMarker = null;
|
||||
});
|
||||
|
||||
self.layerCampiDiRaccolta.addLayer(gtMarker);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1306,19 +1328,19 @@ const _mappaCampiDiRaccolta = {
|
||||
$otherBtns.disabled(isAssigningPos);
|
||||
|
||||
if (isAssigningPos) {
|
||||
if (!assignedPos) {
|
||||
let latLngFromAddress;
|
||||
|
||||
try {
|
||||
latLngFromAddress = await _pvmAjax.getLatLngFromLocation(`${data.destinatario.indirizzo} - ${data.destinatario.citta} (${data.destinatario.prov})`)
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
if (latLngFromAddress?.latLng) {
|
||||
self.map.panTo(latLngFromAddress.latLng);
|
||||
}
|
||||
}
|
||||
// if (!assignedPos) {
|
||||
// let latLngFromAddress;
|
||||
//
|
||||
// try {
|
||||
// latLngFromAddress = await _pvmAjax.getLatLngFromLocation(`${data.destinatario.indirizzo} - ${data.destinatario.citta} (${data.destinatario.prov})`)
|
||||
// } catch (e) {
|
||||
// console.error(e);
|
||||
// }
|
||||
//
|
||||
// if (latLngFromAddress?.latLng) {
|
||||
// self.map.panTo(latLngFromAddress.latLng);
|
||||
// }
|
||||
// }
|
||||
|
||||
$this.addClass("btn-default").removeClass("btn-success");
|
||||
$this.html("Annulla");
|
||||
|
||||
Reference in New Issue
Block a user