Leafletjs L.Control.Geocoder.nominatim(),按钮运行代码

时间:2016-06-19 22:58:38

标签: leaflet

我需要一个工作例子,因为这个鳕鱼生成的文本框没有按钮来运行代码。那么如何才能让按钮运行代码呢?



var geocoder = L.Control.Geocoder.nominatim();

L.Routing.control({
geocoder: geocoder,
waypoints: [
    L.latLng(null, "here my current position, data from GPS"),
    L.latLng(null, "here address as string, input from the user")
],
show: false,

routeWhileDragging: false,

}).addTo(map);




1 个答案:

答案 0 :(得分:0)

您希望使用地理编码服务将文本地址转换为坐标对。见http://leafletjs.com/plugins.html#geocoding