How do I build LocatorFindParameters to return central map points first?

3253
1
06-08-2015 07:15 AM
DanielleKnight
New Contributor

We upgraded from ArcGISRuntime for Java 10.2 to 10.2.4, and we noticed that the Locator.find() method seems to be acting differently. With 10.2, it prioritized locations in the middle of the map before others. Now, we are getting results in the upper half of the map first. I looked through the API and found LocatorFindParameters.setLocation() and LocatorFindParameters.setDistance(), but neither seemed to affect the results.

So the question is what code would help prioritize the center of the map first? Could this be a map package issue?

Here's the code we're using for this:

LocatorFindParameters params = new LocatorFindParameters( address );
params.setLocation( map.getFullExtent().getCenter(), map.getSpatialReference() );//verified that it does return the correct center point
params.setDistance( 15000 );//the prioritized results are returned outside of this range
params.setMaxLocations( 26 );//returns the locations at the center of the map if set higher (so it's finding the locations)
params.setOutSR( map.getSpatialReference() );

ArrayList<String> outFields = new ArrayList<String>();
outFields.add( "*" );
params.setOutFields( outFields );

List<LocatorGeocodeResult> results = locator.find( params );

Any help with this will be much appreciated!

Thanks!

0 Kudos
1 Reply
MatthewSimmons
New Contributor

I had assumed they broke it in the new release. setLocation() and setDistance() don't seem to prioritize finding results anymore...

0 Kudos