Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var rbu_layer
- $.getJSON("getdata.php", function(data) {
- var length = data.station_code.length;
- var station_code = [];
- var localid = feature.properties.localId;
- for (var i = 0; i < length; i++) {
- station_code[i] = data.station_code[i];
- if (station_code[i]==localid) {
- var popupContent = localid + "</br>" + station_code[i];
- }
- }
- });
- function onEachFeature(feature, layer) {
- if (feature.properties && feature.properties.popupContent) {
- layer.bindPopup(feature.properties.popupContent);
- }
- layer.bindPopup(popupContent);
- }
- var map = L.map('map').setView([51.505, -0.09], 3);
- rbu_layer = L.geoJSON(rbd, {
- onEachFeature: onEachFeature
- }).addTo(map);
- map.fitBounds(rbu_layer.getBounds());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement