How to show current location pin on ArcGIS map offline in android

المشرف العام

Administrator
طاقم الإدارة
I'm showing an ArcGIS offline map using Geo-database in android. Now, I want to show current location marker on map for this I'm using the below code-

mMapView.setOnStatusChangedListener(new OnStatusChangedListener() {

/** * */ private static final long serialVersionUID = 1L; public void onStatusChanged(Object source, STATUS status) { if (source == mMapView && status == STATUS.INITIALIZED) { LocationService ls = mMapView.getLocationService(); ls.setAutoPan(false); ls.setLocationListener(new LocationListener() { boolean locationChanged = false; // Zooms to the current location when first GPS fix // arrives. public void onLocationChanged(Location loc) { if (!locationChanged) { locationChanged = true; double locy = loc.getLatitude(); double locx = loc.getLongitude(); Point wgspoint = new Point(locx, locy); Point mapPoint = (Point) GeometryEngine.project(wgspoint, SpatialReference.create(4326), mMapView.getSpatialReference()); Unit mapUnit = mMapView.getSpatialReference().getUnit(); double zoomWidth = Unit.convertUnits( SEARCH_RADIUS, Unit.create(LinearUnit.Code.MILE_US), mapUnit); Envelope zoomExtent = new Envelope(mapPoint, zoomWidth, zoomWidth); mMapView.setExtent(zoomExtent); } But here, I'm unable to import com.esri.android.map.LocationService;
Please suggest me how can I import this package in my project?

And also suggest me that can we use import android.location.LocationManager
to show current location marker on the map?

Thanks



أكثر...
 
أعلى