var geojsonData = {
“type”: “FeatureCollection”,
“features”: [
{
“type”: “Feature”,
“geometry”: {
“type”: “LineString”,
“coordinates”: [
[-96.69920624999997, 32.99712162000003],
[-96.69882135999995, 32.99712461000007]
]
},
“properties”: {
“name”: “Atmos Pipeline”,
“description”: “Length: 110.93 ft”
}
}
]
};
var map = L.map(‘map’).setView([32.997123, -96.699014], 17);
L.tileLayer(‘https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png’, {
attribution: ‘© OpenStreetMap contributors’
}).addTo(map);
L.geoJSON(geojsonData, {
style: function(feature) {
switch (feature.geometry.type) {
case ‘LineString’: return {color: “magenta”, weight: 5};
case ‘Polygon’: return {color: “grey”, weight: 2, dashArray: “5, 5”};
}
},
onEachFeature: function (feature, layer) {
var popupContent = feature.properties.description || feature.properties.name;
layer.bindPopup(popupContent);
}
}).addTo(map);
