2014-11-08 159 views
0

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

我mapbox代码:

<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缺少

知道的任何帮助。

+0

您需要提供此问题的完整代码示例才能负责。 – tmcw 2014-11-09 17:45:00

+0

已被编辑谢谢 – UncleJune 2014-11-09 21:18:34

回答

2

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