Skip to content

Instantly share code, notes, and snippets.

@jueyang
Forked from anonymous/map.geojson
Last active December 20, 2015 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jueyang/6122842 to your computer and use it in GitHub Desktop.
Save jueyang/6122842 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet' />
<![endif]-->
<script src='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div id='map'></div>
</body>
<script>
var map = L.mapbox.map('map', 'examples.map-y7l23tes')
.setView([37.9, -77], 5);
var geojson = [];
var circle = function(geoJsonFeature,options,popup){
L.geoJson(geoJsonFeature,{
pointToLayer:function(feature,latlng){
return L.circleMarker(latlng,options
).bindPopup(popup,{
closeButton: false,
offset:(100,0)
})
}
}).addTo(markers
).addTo(map);
};
$.getJSON('map.geojson',function(data){
console.log(data);
L.featureGroup();
});
</script>
</html>
Display the source blob
Display the rendered blob
Raw
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"title": "I'm small",
"radius":100
},
"geometry": {
"type": "Point",
"coordinates": [
-74.35546875,
40.78054143186031
]
}
},
{
"type": "Feature",
"properties": {
"title":"I'm okay",
"radius":200
},
"geometry": {
"type": "Point",
"coordinates": [
-77.6953125,
38.134556577054134
]
}
},
{
"type": "Feature",
"properties": {
"title":"I'll rule y'all",
"radius":300
},
"geometry": {
"type": "Point",
"coordinates": [
-84.814453125,
40.91351257612758
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment