Last active
March 21, 2017 21:59
-
-
Save pvernier/7881630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Wifis Barranco</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="/site_media/js/Leaflet/leaflet.css" /> | |
<!--[if lte IE 8]><link rel="stylesheet" href="../leaflet.ie.css" /><![endif]--> | |
</head> | |
<body> | |
<div id="map" style="width: 600px; height: 400px"></div> | |
<script src="/site_media/js/Leaflet/leaflet.js"></script> | |
<script src="/site_media/js/demo/wifis_barranco.geojson" type="text/javascript"></script> | |
<script> | |
var map = L.map('map').setView([-12.1473, -77.021], 16); | |
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', { | |
maxZoom: 18, | |
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, ©<a href="https://cartodb.com/attributions">CartoDB</a>' | |
}).addTo(map); | |
function onEachFeature(feature, layer) { | |
var popupContent = "<p>Número de wifis detectados:</p>"; | |
if (feature.properties && feature.properties.num_wifis) { | |
popupContent += feature.properties.num_wifis; | |
} | |
layer.bindPopup(popupContent); | |
} | |
L.geoJson(wifis, { | |
onEachFeature: onEachFeature | |
}).addTo(map); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment