private Boolean updateCenter() { WritableMap properties = getProperties(); if (properties.hasKey(PROP_CENTER)) { try { CameraUpdate cameraUpdate; Double lng = properties.getMap(PROP_CENTER).getDouble("lng"); Double lat = properties.getMap(PROP_CENTER).getDouble("lat"); if (properties.hasKey(PROP_ZOOM_LEVEL)) { int zoomLevel = properties.getInt(PROP_ZOOM_LEVEL); mlastZoom = zoomLevel; Log.i(REACT_CLASS, "Zoom: " + Integer.toString(properties.getInt(PROP_ZOOM_LEVEL))); cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lng), zoomLevel); } else { Log.i(REACT_CLASS, "Default Zoom."); /* * Changed from cameraUpdate = CameraUpdateFactory.newLatLng(new LatLng(lat, lng)); * as it gave me "zoom" Bugs (defaulted to zoom factor 2) as soon as I put in * "real" LNG and LAT values... */ cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lng), mlastZoom); } map.animateCamera(cameraUpdate); return true; } catch (Exception e) { // ERROR! e.printStackTrace(); return false; } } else { return false; } }