I'm trying to map several points in the map, all of them are cities, I used the example from the example in ArcGIS Geocode an Address, and I locate it well, but I just can map ONE at a time.

In this section :

public var lugares:Array = new Array("GUADALAJARA", "ECATEPEC"); //Cities from Mexico
var parameters:AddressToLocationsParameters = new AddressToLocationsParameters();
//parameters such as 'SingleLine' are dependent upon the locator service used.
//parameters.address = { SingleLine: onelineaddress };
parameters.addresses = lugares ;
// Use outFields to get back extra information
// The exact fields available depends on the specific locator service used.
parameters.outFields = [ "Loc_name" ];
locator.addressesToLocations(parameters, new AsyncResponder(onResult, onFault));

when I changed the instructions to plural parameters.addresses = lugares and locator.addressesToLocations It displays an error that a Token must be added and 499 error code,I added token:Object = null but nothing, that error I googled it and it says that the locator service may have permissions... Does anyone has another link? I can't find it, or another solution to map cities? There is going to be more than 2 cities, (just 4 my test I used 2, but it will be maybe hundreds obtained from DB).

1 Answer 1


You are getting the token required message as you're effectively trying to perform a batch geocode against the Esri world locator service and that requires credits (see http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r300000003000000 for more detail).

You can iterate through your addresses as single geocodes to workaround this restriction or you can use an organisational account when running the batch geocode and use some of your ArcGIS Online credits. You can do this as a one off operation if your data is static.

Since you are looking at cities you may be better using an existing map service that contains them e.g. http://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_Cities/FeatureServer

  • Hello davetimmins, do you have an example or a link how to work with url of cities that you gave me in flex? I mean is it like locator = url, then how I pass the cities that I want to map and if exist them map them and if they don't exist don't do nothing, any ideas? please
    – jompi
    Jan 9, 2015 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.