geocoder.setInput() 和 geocoder.query() 之间的区别?
Difference between geocoder.setInput() and geocoder.query()?
MapboxGeocoder
提供了 seInput
和 query
方法,这两种方法都可用于在自动完成下拉列表中设置初始地址。但问题是既设置输入又获取相似的位置并显示结果。是否可以只设置输入值而不显示地点建议列表?
But the problem is both sets the input and fetch similar locations and show the results
与用于“设置和查询输入”的查询不同,setInput仅设置输入。
var geocoder = new MapboxGeocoder({
accessToken: mapboxgl.accessToken,
mapboxgl: mapboxgl,
});
map.addControl(geocoder);
geocoder.setInput("New York");
MapboxGeocoder
提供了 seInput
和 query
方法,这两种方法都可用于在自动完成下拉列表中设置初始地址。但问题是既设置输入又获取相似的位置并显示结果。是否可以只设置输入值而不显示地点建议列表?
But the problem is both sets the input and fetch similar locations and show the results
与用于“设置和查询输入”的查询不同,setInput仅设置输入。
var geocoder = new MapboxGeocoder({
accessToken: mapboxgl.accessToken,
mapboxgl: mapboxgl,
});
map.addControl(geocoder);
geocoder.setInput("New York");