ArcGIS for Flex API version3.7 Tutorial: 6. Using Geocoder for geo-querying

Source: Internet
Author: User

Quick query of geographic location
The Geocoder component provides a quick, geographically-based query that can be queried to display the geographic location of a map by entering an address by adding a query input box. Using Geocoder to move the map display to the specified location area is faster than panning and blooming maps. This feature requires the use of the locator service (location services).


Prerequisites:
* Adobe Flash Builder 4.5.1 and later
* Used ArcGIS API for Flex is 3.2 and later


1 new project in FB, add ArcGIS API and reference Esri namespace
2 Add code to add a basemap:
<s:application xmlns:fx= "http://ns.adobe.com/mxml/2009" xmlns:s= "Library://ns.adobe.com/flex/spark" Xmlns:esri = "Http://www.esri.com/2008/ags" ><esri:map id= "Map" >   <esri:extent>      <esri: Webmercatorextent xmin= " -20119163" ymin= "1160734" xmax= " -1333999" ymax= "10416341"/>   </esri:extent>   <esri:ArcGISTiledMapServiceLayer/></esri:Map></s:Application>


Note: The basemap used in this example is the online tile service Http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer
3 Next, add the Geocoder component.
Note: If you do not set the URL for Geocoder, it will default to the ArcGIS Online World Geocoding Service. This URL can be set to any custom GeoCode service, or a layer that contains services. If you use your own GeoCode service, you need to configure the URL.
...   <esri:arcgistiledmapservicelayer/></esri:map><esri:geocoder   width= "30"   height= "   top= "horizontalcenter="   0 "map="   {map} "/></s:application>


4 Finally, save the running program
5 Enter a location and address to query
As shown in the following:


Results


Using the Geocoder component for geo-location queries does not require writing a large amount of code. This component has a lot of functionality. Remember the following steps.
* Add Map Basemap
* Add geocoder Component Configuration URL

ArcGIS for Flex API version3.7 Tutorial: 6. Using Geocoder for geo-querying

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.