我正在开发一个农贸市场应用程序。我在设置恰到好处的地图时遇到了一些麻烦。我想要地图
现在看来它的工作方式是,每次打开应用程序时它总是缩放到同一个位置。即使我在市场上。
任何建议都将受到赞赏。
我已经从我项目中的maps.java文件附加了我的locationmanager。如果有帮助,我可以发布整个java文件。
LocationManager locationManager = (LocationManager)getSystemService
(Context.LOCATION_SERVICE);
Location location = locationManager.getLastKnownLocation
(LocationManager.PASSIVE_PROVIDER);
Location centLocation = new Location("");
centLocation.setLongitude(43.074691);
centLocation.setLatitude(-89.384152);
if(location != null) {
if (location.distanceTo(centLocation) < 250)
moveToLocation(new LatLng(location.getLatitude(), location.getLongitude()), 20, 1);
else
moveToLocation(new LatLng(43.0746443789058, -89.3860458564343), 20, 1);
}
else
{
moveToLocation(new LatLng(43.0746443789058, -89.3860458564343), 20, 1);
AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
&#13;