Get actual location google maps v2 ANDROID -
Get actual location google maps v2 ANDROID -
i want current position googlemap object, i'm doing this:
private void setupmap() { mmap.setmylocationenabled(true); final location location = mmap.getmylocation(); log.w("status", "yes"); if (location != null) { log.w("status", "no"); latlng = new latlng(location.getlatitude(), location.getlongitude()); } mmap.setonmylocationchangelistener(new googlemap.onmylocationchangelistener() { @override public void onmylocationchange(location loc) { loc = location; mmap.movecamera(cameraupdatefactory.newlatlngzoom(latlng, map_zoom)); mmap.addmarker(new markeroptions().position(new latlng(loc.getlatitude(), loc.getlongitude())).title("it's me!")); } }); }
i don't know if have utilize tool current position, because location null. of course of study sec log never showing.
according documentation have utilize location api .instead of using getmylocation or can mylocatonlayer utilize locationapi . , getmylocation deprecated.
android google-maps location
Comments
Post a Comment