[android] - add binding integration for Map::setLatLngbounds, add example (#8622)

This commit is contained in:
Tobrun
2017-04-13 16:06:09 +02:00
committed by GitHub
parent 0810192163
commit 21f54cc506
10 changed files with 206 additions and 3 deletions

View File

@@ -43,6 +43,7 @@
#include "bitmap.hpp"
#include "run_loop_impl.hpp"
#include "java/util.hpp"
#include "geometry/lat_lng_bounds.hpp"
namespace mbgl {
namespace android {
@@ -354,6 +355,14 @@ void NativeMapView::setStyleJson(jni::JNIEnv& env, jni::String json) {
map->setStyleJSON(jni::Make<std::string>(env, json));
}
void NativeMapView::setLatLngBounds(jni::JNIEnv& env, jni::Object<mbgl::android::LatLngBounds> jBounds) {
if (jBounds) {
map->setLatLngBounds(mbgl::android::LatLngBounds::getLatLngBounds(env, jBounds));
} else {
map->setLatLngBounds(mbgl::LatLngBounds::world());
}
}
void NativeMapView::cancelTransitions(jni::JNIEnv&) {
map->cancelTransitions();
}
@@ -1560,7 +1569,8 @@ void NativeMapView::registerNative(jni::JNIEnv& env) {
METHOD(&NativeMapView::removeSourceById, "nativeRemoveSourceById"),
METHOD(&NativeMapView::removeSource, "nativeRemoveSource"),
METHOD(&NativeMapView::addImage, "nativeAddImage"),
METHOD(&NativeMapView::removeImage, "nativeRemoveImage")
METHOD(&NativeMapView::removeImage, "nativeRemoveImage"),
METHOD(&NativeMapView::setLatLngBounds, "nativeSetLatLngBounds")
);
}