javascript api 空間分析功能-地理編碼

來源:互聯網
上載者:User

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.

反地理編碼決定地圖上一個給定的點地址

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.