SHARE
TWEET

Untitled

a guest Jun 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var rbu_layer
  2. $.getJSON("getdata.php", function(data) {
  3.         var length = data.station_code.length;
  4.         var station_code = [];
  5.         var localid = feature.properties.localId;
  6.         for (var i = 0; i < length; i++) {
  7.             station_code[i] = data.station_code[i];
  8.             if (station_code[i]==localid) {
  9.                 var popupContent = localid + "</br>" + station_code[i];
  10.             }
  11.         }
  12. });
  13. function onEachFeature(feature, layer) {
  14.  
  15.     if (feature.properties && feature.properties.popupContent) {
  16.         layer.bindPopup(feature.properties.popupContent);
  17.     }
  18.     layer.bindPopup(popupContent);
  19. }
  20. var map = L.map('map').setView([51.505, -0.09], 3);
  21.  
  22. rbu_layer = L.geoJSON(rbd, {
  23.     onEachFeature: onEachFeature
  24. }).addTo(map);
  25. map.fitBounds(rbu_layer.getBounds());
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top