i'm using huawei map kit in my app, i'm following the steps mentioned in their documentation..the map loads and just moves me to ivory coast every time..i don't understand why
my code
private HuaweiMap hMap;
private MapView mMapView;
double lat;
double lng;
private static final String MAPVIEW_BUNDLE_KEY = "MapViewBundleKey";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
Log.i("TAG", "onCreate");
Intent i=getIntent();
double lat=i.getExtras().getDouble("lat");
double lng=i.getExtras().getDouble("lng");
mMapView = findViewById(R.id.mapView);
Bundle mapViewBundle = null;
if (savedInstanceState != null) {
mapViewBundle = savedInstanceState.getBundle(MAPVIEW_BUNDLE_KEY);
}
MapsInitializer.setApiKey("the api key");
mMapView.onCreate(mapViewBundle);
//get map instance
mMapView.getMapAsync(this);
}
@Override
public void onMapReady(HuaweiMap map) {
//get map instance in a callback method
Log.d("TAG", "onMapReady: ");
hMap = map;
hMap.getUiSettings().setZoomControlsEnabled(true);
hMap.getUiSettings().setZoomGesturesEnabled(true);
hMap.getUiSettings().setMyLocationButtonEnabled(true); //this button doesn't show on screen either
LatLng location = new LatLng(lat, lng);
hMap.addMarker(new MarkerOptions().position(location));
CameraPosition cameraPosition = new CameraPosition(location,8,2.2f,31.5f);
hMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
hMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
}
i'm using google maps in the same app (for phones that use gms) and using almost the same approach and everything works perfectly fine with the google map.. please help