Javascript API space analysis function-geocode

Source: Internet
Author: 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.

In this example, you can enterAddressAnd then display the matchedLocation. This is usually called geocode.

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.

The locator constructor requires the URL of the geocode service of ArcGIS Server. Geocode service represents a location locator available on the server.

When the user clicks the locate button,LocateFunction 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.

When you click the locate button, the positioning function is called. This function parses the location text entered by the user as an array of four elements. The four elements (address, city, state, and zip) match the fields defined in locator. You can find these address fields by viewing the geocode service in the service directory

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.

Anti-geographic Code determines address of a given vertex .

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.