Created
April 21, 2016 13:17
-
-
Save here-devblog-gists/4204c4dc003b5318eb67af3bd2a5eb45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void findPlaces(View view) { | |
// collect data to set options | |
GeoCoordinate myLocation = posManager.getPosition().getCoordinate(); | |
EditText editSteps = (EditText)findViewById(R.id.editSteps); | |
int noOfSteps; | |
try { | |
noOfSteps = Integer.valueOf(editSteps.getText().toString()); | |
} catch (NumberFormatException e) { | |
// if input is not a number set to default of 2500 | |
noOfSteps = 2500; | |
} | |
range = ((noOfSteps * 0.762f) / 2); | |
// create an exploreRequest and set options | |
ExploreRequest request = new ExploreRequest(); | |
request.setSearchArea(myLocation, (int)range); | |
request.setCollectionSize(50); | |
request.setCategoryFilter(new CategoryFilter().add(Category.Global.SIGHTS_MUSEUMS)); | |
try { | |
ErrorCode error = request.execute(new SearchRequestListener()); | |
if( error != ErrorCode.NONE ) { | |
// Handle request error | |
} | |
} catch (IllegalArgumentException ex) { | |
// Handle invalid create search request parameters | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment