我相信默认情况下,4.13 Esri Javascript 地图将按当前地图视图范围搜索地址。问题是如果用户放大或缩小得太远,搜索结果会返回非常远的地址。这是我的代码:
function initESRIMap() {
require(["esri/Map", "esri/views/MapView", "esri/widgets/Search", "esri/layers/FeatureLayer", "esri/widgets/Popup", "esri/geometry/Extent", "esri/geometry/Geometry"], function (
Map,
MapView,
Search,
FeatureLayer,
Popup,
Extent,
Geometry
) {
var esriMap = new Map({
basemap: "streets",
});
var esriView = new MapView({
container: "map-div",
map: esriMap,
center: LatLong,
zoom: 11,
});
var search = new Search({
view: esriView,
});}
无论我的地图视图位置如何,我都希望能够获得相同的搜索结果。但是将结果限制在特定区域。因此,如果我正在查看另一个国家/地区,我仍然会从我的范围内看到搜索结果。