[android][ios][macOS] Implement bindings for Map::cameraForGeometry. On macOS, also added -[MGLMapView setCamera: withDuration: animationTimingFunction: edgePadding: completionHandler:] for parity with iOS
This commit is contained in:
@@ -291,6 +291,11 @@ jni::Object<CameraPosition> NativeMapView::getCameraForLatLngBounds(jni::JNIEnv&
|
||||
return CameraPosition::New(env, map->cameraForLatLngBounds(mbgl::android::LatLngBounds::getLatLngBounds(env, jBounds), insets));
|
||||
}
|
||||
|
||||
jni::Object<CameraPosition> NativeMapView::getCameraForGeometry(jni::JNIEnv& env, jni::Object<geojson::Geometry> jGeometry, double bearing) {
|
||||
auto geometry = geojson::Geometry::convert(env, jGeometry);
|
||||
return CameraPosition::New(env, map->cameraForGeometry(geometry, insets, bearing));
|
||||
}
|
||||
|
||||
void NativeMapView::setReachability(jni::JNIEnv&, jni::jboolean reachable) {
|
||||
if (reachable) {
|
||||
mbgl::NetworkStatus::Reachable();
|
||||
@@ -949,6 +954,7 @@ void NativeMapView::registerNative(jni::JNIEnv& env) {
|
||||
METHOD(&NativeMapView::getLatLng, "nativeGetLatLng"),
|
||||
METHOD(&NativeMapView::setLatLng, "nativeSetLatLng"),
|
||||
METHOD(&NativeMapView::getCameraForLatLngBounds, "nativeGetCameraForLatLngBounds"),
|
||||
METHOD(&NativeMapView::getCameraForGeometry, "nativeGetCameraForGeometry"),
|
||||
METHOD(&NativeMapView::setReachability, "nativeSetReachability"),
|
||||
METHOD(&NativeMapView::resetPosition, "nativeResetPosition"),
|
||||
METHOD(&NativeMapView::getPitch, "nativeGetPitch"),
|
||||
|
||||
Reference in New Issue
Block a user