Built with blockbuilder.org
Created
November 8, 2016 04:45
-
-
Save maptastik/a8ed721b183a113f1e34ab8d56cb0a5a to your computer and use it in GitHub Desktop.
Bing Map w/ GeoJSON
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
license: mit |
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
var usgsEarthquakeUrl = 'http://earthquake.usgs.gov/fdsnws/event/1/query?minmagnitude=3&format=geojson'; | |
function GetMap() { | |
var map = new Microsoft.Maps.Map('#myMap', { | |
credentials: ‘AlXPdK-o4cuvCuOi_uBF6wUJBEbe8x8o0U00Uk579z2IQFfFGK1uu4tnpXIDhM58’ | |
}); | |
Microsoft.Maps.loadModule('Microsoft.Maps.GeoJson', function () { | |
Microsoft.Maps.GeoJson.readFromUrl(usgsEarthquakeUrl, | |
function (shapes) { | |
//Add the shape(s) to the map. | |
map.entities.push(shapes); | |
}, 'callback'); | |
}); | |
} |
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></title> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<div id="myMap" style="position:relative;width:1200px;height:800px;"></div> | |
<script type='text/javascript' | |
src='http://www.bing.com/api/maps/mapcontrol?callback=GetMap' | |
async defer></script> | |
<script src="app.js" type='text/javascript'></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment