我做的使用谷歌maps.The当前位置的项目在新设备中显示旧设备不能正常工作,但不能在较早的2.3 device.How做所示我在旧设备中显示当前位置。谷歌地图:当前位置蓝泡泡未显示,当前位置按钮
我的代码:
public void initialiseMap()
{
if (googleMap == null) {
googleMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(
R.id.map)).getMap();
}
// check if map is created successfully or not
if (googleMap == null) {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
else
{
googleMap.setMyLocationEnabled(true);
googleMap.getUiSettings().setMyLocationButtonEnabled(true);
googleMap.getUiSettings().setCompassEnabled(true);
// UiSettings uiSettings = googleMap.getUiSettings();
// uiSettings.setMyLocationButtonEnabled(true);
}
//locationManager.requestLocationUpdates(provider, 20000, 0, this);
LatLng latLng = new LatLng(current_latitude, current_longitude);
googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
// Zoom in the Google Map
//googleMap.animateCamera(CameraUpdateFactory.zoomTo(15));
googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 11.5f));
}
我一直在使用一个支持libarary将help..Can有人澄清这一点也请听到。
我已添加支持库。 – user3837228