Browse Source

Merge branch 'staging' of https://git.oslog.id/ordo/adw-gantt into dev-ibnu

pull/1/head
ibnu 1 year ago
parent
commit
35723c3510
  1. 22
      edit-mode/function/activityLocation.js

22
edit-mode/function/activityLocation.js

@ -43,6 +43,9 @@ function updateCurrentGeoJson() {
let shapes = [];
drawnItems.eachLayer(function (layer) {
let geojson = layer.toGeoJSON();
if (layer instanceof L.Circle) {
geojson.properties.radius = layer.getRadius();
}
shapes.push(geojson);
});
currentGeoJson = {
@ -50,8 +53,7 @@ function updateCurrentGeoJson() {
features: shapes
};
}
function openActivityMap(id)
{
function openActivityMap(id) {
currentIdAct = id;
map.invalidateSize();
$.ajax({
@ -70,7 +72,15 @@ function openActivityMap(id)
let lGeoJson = L.geoJSON(feature);
let layers = lGeoJson.getLayers();
layers.forEach(layer => {
let radius = layer.feature.properties.radius;
if (radius) {
let latlon = layer.getLatLng();
let circle = L.circle([latlon.lat, latlon.lng], { radius: radius });
addDrawnLayer(circle);
}
else {
addDrawnLayer(layer)
}
});
});
} else {
@ -234,8 +244,7 @@ $(document).ready(function () {
});
}
function submitLocation()
{
function submitLocation() {
let payload
if (currentGeoJson && currentGeoJson != "") {
@ -279,14 +288,13 @@ $(document).ready(function () {
});
});
function submitCircle(radius)
{
function submitCircle(radius) {
let circle = L.circle([circLat, circLong], { radius: radius });
let geojsoncircle = circle.toGeoJSON();
geojsoncircle.properties.radius = radius
currentGeoJson = geojsoncircle
// console.log("geojsoncircle", geojsoncircle);
addDrawnLayer(circle);
updateCurrentGeoJson();
map.addControl(drawnControlEdit);
$("#modal_radius").modal('hide');

Loading…
Cancel
Save