Is it possible in Android Google maps to change default location from South Africa to Australia?

北城以北 提交于 2019-12-10 14:40:39

问题


I want to confirm one thing in Google maps that is why Google maps always showing South Africa as default location... Can't we change Australia as Default one. If GPRS enabled I can trace the current location if not i want to show Sidney in Australia . Is it possible ???


回答1:


Google Maps will show the user's current location if you ask for it.

You can also manually set the "default" location by moving the map to give a particular location.

CameraUpdate point = CameraUpdateFactory.newLatLng(new LatLng(53, 2));

// moves camera to coordinates
map.moveCamera(point);
// animates camera to coordinates
map.animateCamera(point);

Best to use moveCamera rather than animateCamera for the default position.

The reason you are seeing South Africa is because the map defaults to (0,0) when initialised without any extra data, so it doesn't have somewhere to point to other than it's default. (0,0) happens to be near Africa.

Use moveCamera before the map is shown to the user and it will be showing wherever you have selected by default.



来源:https://stackoverflow.com/questions/21530315/is-it-possible-in-android-google-maps-to-change-default-location-from-south-afri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!