android - Google map doesn't show correct location -
not long ago updated map class on app utilize google maps android api v2. in app utilize class location save current location. when tried add together marker location on map code:
log.e(tag,"adding user_marker @ lat = " + common.curlocation.getlatitude() + ",lng = " + common.curlocation.getlongitude()); user_curr_position = new latlng(common.curlocation.getlatitude(), common.curlocation.getlatitude()); muser_curr_position_marker = mmap.addmarker(new markeroptions().position(user_curr_position).title("your position").draggable(true));
it gave me wrong location (somewhere in deep sea). checked not entering wrong parameter taking lat , long log ("adding user_marker @ lat=32.165603,lng=34.81224") , found right location on google maps (on internet). can tell me doing wrong ?
well, passing in user's latitude in longitude.
user_curr_position = new latlng(common.curlocation.getlatitude(), common.curlocation.getlatitude());
it needs be
user_curr_position = new latlng(common.curlocation.getlatitude(), common.curlocation.getlongitude());
android google-maps google-maps-api-2
No comments:
Post a Comment