maptastik
11/8/2016 - 4:45 AM

Bing Map w/ GeoJSON

Bing Map w/ GeoJSON

<!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>
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');
        });
    }