无法从地图加载功能

时间:2015-11-06 17:15:39

标签: javascript mapbox

加载地图的图块来自错误的地方:http://a.tiles.mapbox.com/v4/melbourneuni.hetjfw29/features.json?access_tok ... ldW5pIiwiYSI6ImNpZzc4YmNvdTBrdzR0dWx6cW1tZG00d2UifQ.T4kFqEpykbTCepilYVeL_g。如何解决这个问题?

<html>
<head>
<meta charset=utf-8 />
<title>getMap</title>
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.2.2/mapbox.js'>    </script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.2.2/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'>
</div>
<script>
L.mapbox.accessToken = 'pk.eyJ1IjoibWVsYm91cm5ldW5pIiwiYSI6ImNpZzc4YmNvdTBrdzR0dWx6cW1tZG00d2UifQ.T4kFqEpykbTCepilYVeL_g';
var map = L.mapbox.map('map', 'mapbox.streets', {attributionControl: true});
var featureLayer = L.mapbox.featureLayer().addTo(map);
featureLayer.loadID('melbourneuni.3fd31dc5');
featureLayer.on('ready', function(){
// navigate the GeoJSON to get to the coordinates
var geojson = this.getGeoJSON();});
</script>
</body>
</html>
</script>
</body>
</html>

0 个答案:

没有答案
相关问题