Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltMONOLITE authored Dec 4, 2023
1 parent 1da74d7 commit de404f7
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function addGeoms(data) {

let geomStyle = { color: "black", fillColor: "#adbab7", weight: 2 };
let geomHoverStyle = { color: "green", fillColor: "#1e751e", weight: 4 };
let popup = L.popup();

L.geoJSON(fc, {
onEachFeature: function (feature, layer) {
layer.on({
Expand All @@ -73,22 +73,23 @@ function addGeoms(data) {
e.target.setStyle(geomHoverStyle);
},
click: function (e) {
map.fitBounds(e.target.getBounds());
L.DomEvent.stopPropagation(e);
// Create a popup content string
/* Create a popup content string*/
var popupContent = "<b>" + e.target.feature.properties.name + "</b><br>" + e.target.feature.properties.description;

// Create a popup and set its content
popup
//* Create a popup and set its content*//
var popup = L.popup()
.setLatLng(e.latlng)
.setContent(popupContent);
popup.openOn(map);
}
});
},
style: geomStyle,
}).addTo(map);
map.setView(e.latlng, 12);
/* Open the popup on the map*/
popup.openOn(map);
},
});
},
style: geomStyle,
}).addTo(map);
}


function addPoints(data) {
data = data.data;
let pointGroupLayer = L.layerGroup().addTo(map);
Expand All @@ -106,6 +107,8 @@ function addGeoms(data) {

//// add condition
if (data[row].include === "y" || data[row].include === "2_Registered" || data[row].include === "1_Admin") {


if (markerType == "circleMarker") {
marker = L.circleMarker([data[row].lat, data[row].lon], {
radius: markerRadius,
Expand All @@ -130,7 +133,6 @@ function addGeoms(data) {

marker.on({
click: function (e) {
L.DomEvent.stopPropagation(e);
map.setView(e.latlng, map.getZoom() + 2);
},
});
Expand All @@ -145,8 +147,8 @@ function addGeoms(data) {
});
if (!markerType.includes("circle")) {
marker.setIcon(icon);
}
}
}
}
}
function parseGeom(gj) {
// FeatureCollection
Expand Down

0 comments on commit de404f7

Please sign in to comment.