使用Mapbox.js实现测量工具

时间:2014-11-08 18:58:41

标签: leaflet mapbox

我需要帮助用Mapox.js地图实现leaflet.js测量工具。显然这个工具尚未使用mapbox进行测试。 我面临的问题是引用leaflet.js来使用测量工具导致Mapbox.js引用不起作用。 有人可以在我的mapbox.js应用程序中提供一些帮助吗?

我的地图框代码:

<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />

测量工具代码:

<link rel="stylesheet" href="http://erichsen-group.com/demoland/taylorpeterh/lib/leaflet-0.6.4/leaflet.css" />
<script src="http://erichsen-group.com/demoland/taylorpeterh/lib/leaflet-0.6.4/leaflet-src.js"></script>
<script src="http://erichsen-group.com/demoland/taylorpeterh/lib/jquery-1.6.4.min.js"></script>
<script src="http://erichsen-group.com/demoland/taylorpeterh/src/L.MeasuringTool.js"></script>

收到错误:L.mapbox缺失

任何帮助表示感谢。

1 个答案:

答案 0 :(得分:2)

Mapbox.js包含Leaflet,但您在页面上再次包含Leaflet,覆盖Mapbox.js。答案是不再包括Leaflet。

相关问题