javascript api 空间分析功能地理编码

This example allows you to enter an address, then displays the location of matching addresses. This is commonly known as geocoding. In the ArcGIS JavaScript API, you use theLocator class to perform geocoding.

这个例子允许你输入一个地址,然后展现匹配的位置。这通常被叫做地理编码。

The Locator constructor requires the URL of an ArcGIS Server geocode service. A geocode service represents an address locator that has been made available on the server. This example uses the ESRI_Geocode_USA service on the ESRI sample server. You can use the Services Directory to discover the URL to your own geocode service.

Locator构造函数需要ArcGIS Server的geocode service的URL。geocode service代表一个在服务器上可用的位置定位器。

When the user clicks the Locate button, the locate function is called. This function parses the address text entered by the user into a four-item array. The four items (address, city, state, and zip) correspond to the address fields defined in the locator. You can discover these address fields by looking up the geocode service in the Services Directory. For example, this page shows the four address fields for the geocode service used in this example.

当用户点击Locate按钮,定位函数被调用。这个个函数解析用户输入的位置文本为四元素的数组。这个四个元素(address,city,state和zip)匹配locator中定义的字段。你可以发现这些地址字段通过查看在服务目录中的geocode service

The locator begins searching for matches when the addressToLocations method is called:

locator.addressToLocations(address);

Reverse geocoding determines the address of a given point on a map. This sample shows how to do reverse geocoding with the ArcGIS JavaScript API.

反地理编码决定地图上一个给定的点地址

原文地址:https://www.cnblogs.com/zhangjun1130/p/1999661.html