Turf JS 的新手,一直在研究通过 MapBox API 进行集成。使用默认的 MapBox.Outdoors 地图并一直遵循一些示例 TurfJS 文档http://turfjs.org/docs/#point但似乎无法将我的观点绘制在地图上。非常感谢任何建议,错误似乎在我与 FeatureLayer.setGeoJSON 相关的代码列表行中,但我无法弄清楚。如果我将最后一行保持活动状态,则地图不会加载,如果我将其注释掉,地图会加载但没有显示图钉?
<BODY>
<div id='map'></div>
<script>
L.mapbox.accessToken = 'pk.eyJ1IjoibWFya2d1ayIsImEiOiJjaXNsd2VhMG8wMDdrMzNybmticDJhdnZsIn0.KXcvejg6QplSsAlj8aimjA';
var point = turf.point([35.463453, -97.514914], {
"title": "OKC Thunder",
"description": "100 W Reno Ave, Oklahoma City",
"marker-color": "#6BC65F",
"marker-size": "large",
"marker-symbol": "basketball"
});
var map = L.mapbox.map('map', 'mapbox.outdoors').setView([35.463453, -97.514914], 19);
.featureLayer.setGeoJSON(point); // If I comment this line out the map loads with no pin. If I leave this line active the map doesn't load at all?
</SCRIPT>
</BODY>