Skip to content

Commit

Permalink
Merge pull request #1 from shievaniR/Srijena
Browse files Browse the repository at this point in the history
Added custom icon
  • Loading branch information
shievaniR authored Aug 1, 2020
2 parents f62caa5 + ea7b8bf commit 2984f93
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,45 @@
}).addTo(map);

var myData;
function onPoint(geoJsonPoint, latlng) {

if (geoJsonPoint.properties.radio == 'GSM') {
var smallIcon = new L.Icon({
iconSize: [27,27],
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: 'icons/GSMtower.png'
});
}

if (geoJsonPoint.properties.radio == 'UMTS') {
var smallIcon = new L.Icon({
iconSize: [27, 27],
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: 'icons/UMTStower.png'
});
}

if (geoJsonPoint.properties.radio == 'LTE') {
var smallIcon = new L.Icon({
iconSize: [27, 27],
iconAnchor: [13, 27],
popupAnchor: [1, -24],
iconUrl: 'icons/LTEradiotower.png'
});
}

var marker = L.marker(latlng, { icon: smallIcon })

marker.bindPopup("Cellid : " + geoJsonPoint.properties.cell.toString() + "<br/>Latitude : " + geoJsonPoint.properties.lat.toString() + "<br/>Longtitude : " + geoJsonPoint.properties.lat.toString());
return marker
}


L.uGeoJSONLayer({
endpoint: "https://kitsihbboxapi.herokuapp.com/data",
endpoint: "https://kitsihbboxapi.herokuapp.com/data",
pointToLayer: onPoint,
}).addTo(map);


Expand Down

0 comments on commit 2984f93

Please sign in to comment.