Locator Package and flex api mobile

722
5
01-06-2014 09:09 AM
KomanDiabate
New Contributor III
Hello All,
I'm working on a mobile project where I am trying to use a locator package locally using flex. However it looks like I am getting an error when the package is trying to geocode the address. Is it possible to use locator package in flex api? Has anybody try to do this before Can someone please enlighten me on this issue.
Thanks in advance.


<esri:Locator id="locator"   
 url="{File.applicationDirectory.resolvePath('.....gcpk')}"/>


Failure:
[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: app:/%5Bobject%20File%5D/findAddressCandidates?outFields=%2A&f=json&SingleLine=703%20W%2E%20California%20Ave%2E%20Vista%20CA%2092083" errorID=2032]. URL: [object File]/findAddressCandidates?outFields=%2A&f=json&SingleLine=703%20W%2E%20California%20Ave%2E%20Vista%20CA%2092083"]
Tags (2)
0 Kudos
5 Replies
KomanDiabate
New Contributor III
Looks Like ESRI flex Api doesn't support Locator Package.
Weird....
0 Kudos
MikeDahm
Occasional Contributor
Yes you can use the locator package in the Flex API. 
https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/tasks/Locator.html

The Geocode an address sample shows how to use it:
https://developers.arcgis.com/en/flex/sample-code/geocode-an-address.htm

It took some doing for me to get it to work, I had problems getting my custom Geocode Service to work and tool a little bit to figure out how to use it within the map spatial reference.  It appears that your url for the service is not working. Can you post more of your code to show how you are calling the geocode locator?
0 Kudos
LloydHeberlie
Occasional Contributor
Hello All,
I'm working on a mobile project where I am trying to use a locator package locally using flex. However it looks like I am getting an error when the package is trying to geocode the address. Is it possible to use locator package in flex api? Has anybody try to do this before Can someone please enlighten me on this issue.
Thanks in advance.


<esri:Locator id="locator"   
 url="{File.applicationDirectory.resolvePath('.....gcpk')}"/>


Failure:
[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: app:/%5Bobject%20File%5D/findAddressCandidates?outFields=%2A&f=json&SingleLine=703%20W%2E%20California%20Ave%2E%20Vista%20CA%2092083" errorID=2032]. URL: [object File]/findAddressCandidates?outFields=%2A&f=json&SingleLine=703%20W%2E%20California%20Ave%2E%20Vista%20CA%2092083"]



Hi Koman,

While the Flex API does support geocoding, the resource must be an ArcGIS REST API web service.  There is NOT an option to use a local resource such as a locator package, similar to how this would be accomplished using the native app options (iOS, Android, etc) that leverage the ArcGIS Runtime SDKs.

Hope this helps answer your question,
0 Kudos
KomanDiabate
New Contributor III
Hi Heberlie and thanks for the reply but....

Is the Flex API team planning to support this?
Since Flex api now support tile package it will just make sense to start thinking about these packages as a whole.
Thanks
0 Kudos
LloydHeberlie
Occasional Contributor
Hi Heberlie and thanks for the reply but....

Is the Flex API team planning to support this?
Since Flex api now support tile package it will just make sense to start thinking about these packages as a whole.
Thanks


Hi Koman,

There are no plans to implement the functionality similar to the ArcGIS Runtime SDKs (iOS, Android, Windows Phone) inside of the ArcGIS API for Flex.
0 Kudos