google maps - Android Update Current Location -
so here method getting user saved location , move camera location:
private void updateplaces(){ locman = (locationmanager)getsystemservice(context.location_service); location lastloc = locman.getlastknownlocation(locationmanager.network_provider); double lat = lastloc.getlatitude(); double lng = lastloc.getlongitude(); latlng lastlatlng = new latlng(lat, lng); if(usermarker!=null) usermarker.remove(); usermarker = themap.addmarker(new markeroptions() .position(lastlatlng) .title("you here") .icon(bitmapdescriptorfactory.fromresource(usericon)) .snippet("your last recorded location")); themap.animatecamera(cameraupdatefactory.newlatlng(lastlatlng), 3000, null); }
how can modify code in order new position once, compare , camera it?
thank in advance.
i don't understand question, if run method updateplaces()
ones getlastknownlocation
once , updates user marker once. please more explanatory on trying achieve?
Comments
Post a Comment