+ Reply to Thread
Results 1 to 2 of 2

Thread: Reverse Geocode Android

  1. #1
    Jacky Nguyen
    Join Date
    Jul 2013
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Reverse Geocode Android

    I am new to ArcGIS and I am working on Geocode and reverse geocode.
    I use the sample project Place Search and i want to add reverse geocode function that after we provide the address, we put a graphic on the layer showing where we are at. When a user tap on the graphic, i want to show the street name of that location by using Toast.makeText, but i am unable to.
    Here is my code:

    Code:
    private void identityLocation(float x, float y)
    	{
    		searchFeature(x, y);
    		
    		if(identifyGraphic !=null)
    		{
    			
    			Point mapPoint = mMapView.toMapPoint(x,y);
    			Point currentPoint = (Point) GeometryEngine.project(mapPoint, SpatialReference.create(4326), mMapView.getSpatialReference());
    			try {
    				locRev = locator.reverseGeocode(currentPoint, 2000.0);
    				s = locRev.getAddressFields().get("StreetName");				
    			} catch (Exception e) {
    				e.printStackTrace();
    			}		
    			Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();			
    		}
    Can someone please help. Thank you

  2. #2
    Dan ONeill
    Join Date
    Jan 2010
    Posts
    147
    Points
    69
    Answers Provided
    13


    0

    Default Re: Reverse Geocode Android

    Answer provide in cross-post here.
    Regards:
    Dan O'Neill
    ESRI Java Development Team

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts