Change Android package and class names away from mapbox (#1201)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -139,8 +139,8 @@ run-android-benchmark-$1-%: android-benchmark-$1
|
||||
# Run the test app on connected android device with specified abi
|
||||
.PHONY: run-android-$1
|
||||
run-android-$1:
|
||||
-adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
|
||||
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:install$(BUILDTYPE) && adb shell am start -n com.mapbox.mapboxsdk.testapp/.activity.FeatureOverviewActivity
|
||||
-adb uninstall org.maplibre.testapp 2> /dev/null
|
||||
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:install$(BUILDTYPE) && adb shell am start -n org.maplibre.testapp/.activity.FeatureOverviewActivity
|
||||
|
||||
# Build test app instrumentation tests apk and test app apk for specified abi
|
||||
.PHONY: android-ui-test-$1
|
||||
@@ -150,12 +150,12 @@ android-ui-test-$1:
|
||||
# Run test app instrumentation tests on a connected android device or emulator with specified abi
|
||||
.PHONY: run-android-ui-test-$1
|
||||
run-android-ui-test-$1:
|
||||
-adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
|
||||
-adb uninstall org.maplibre.testapp 2> /dev/null
|
||||
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest
|
||||
|
||||
# Run Java Instrumentation tests on a connected android device or emulator with specified abi and test filter
|
||||
run-android-ui-test-$1-%:
|
||||
-adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
|
||||
-adb uninstall org.maplibre.testapp 2> /dev/null
|
||||
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="$$*"
|
||||
|
||||
# Symbolicate native stack trace with the specified abi
|
||||
@@ -166,17 +166,17 @@ android-ndk-stack-$1:
|
||||
# Run render tests with pixelmatch
|
||||
.PHONY: run-android-render-test-$1
|
||||
run-android-render-test-$1: $(BUILD_DEPS)
|
||||
-adb uninstall com.mapbox.mapboxsdk.testapp 2> /dev/null
|
||||
-adb uninstall org.maplibre.testapp 2> /dev/null
|
||||
# delete old test results
|
||||
rm -rf build/render-test/mapbox/
|
||||
rm -rf build/render-test/maplibre/
|
||||
# copy test definitions & ignore file to test app assets folder, clear old ones first
|
||||
rm -rf MapboxGLAndroidSDKTestApp/src/main/assets/integration
|
||||
cp -r metrics/integration MapboxGLAndroidSDKTestApp/src/main/assets
|
||||
cp platform/node/test/ignores.json MapboxGLAndroidSDKTestApp/src/main/assets/integration/ignores.json
|
||||
# run RenderTest.java to generate static map images
|
||||
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="com.mapbox.mapboxsdk.testapp.render.RenderTest"
|
||||
$(MLN_ANDROID_GRADLE) -Pmapbox.abis=$2 :MapboxGLAndroidSDKTestApp:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class="org.maplibre.testapp.render.RenderTest"
|
||||
# pull generated images from the device
|
||||
adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/mapbox/render" build/render-test
|
||||
adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/maplibre/render" build/render-test
|
||||
# copy expected result and run pixelmatch
|
||||
python scripts/run-render-test.py
|
||||
# remove test definitions from assets
|
||||
@@ -229,7 +229,7 @@ android-ui-test:
|
||||
#Run instrumentations tests on MicroSoft App Center, ${devices} can be "xiaomi","huawei","OnePlus","htc"
|
||||
.PHONY: run-android-test-app-center
|
||||
run-android-test-app-center:
|
||||
appcenter test run espresso --app "Mapbox-mobile/Maps-sdk" --devices "Mapbox-mobile/${devices}" --app-path MapboxGLAndroidSDKTestApp/build/outputs/apk/debug/MapboxGLAndroidSDKTestApp-debug.apk --test-series "master" --locale "en_US" --build-dir MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/debug --token ${APPCENTER_ACCESS_TOKEN}
|
||||
appcenter test run espresso --app "MapLibre-mobile/Maps-sdk" --devices "MapLibre-mobile/${devices}" --app-path MapboxGLAndroidSDKTestApp/build/outputs/apk/debug/MapboxGLAndroidSDKTestApp-debug.apk --test-series "master" --locale "en_US" --build-dir MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/debug --token ${APPCENTER_ACCESS_TOKEN}
|
||||
|
||||
# Uploads the compiled Android SDK to Maven Central Staging
|
||||
.PHONY: run-android-publish
|
||||
@@ -239,7 +239,7 @@ run-android-publish:
|
||||
# Dump system graphics information for the test app
|
||||
.PHONY: android-gfxinfo
|
||||
android-gfxinfo:
|
||||
adb shell dumpsys gfxinfo com.mapbox.mapboxsdk.testapp reset
|
||||
adb shell dumpsys gfxinfo org.maplibre.testapp reset
|
||||
|
||||
# Runs checkstyle and lint on the java code
|
||||
.PHONY: android-check
|
||||
@@ -307,6 +307,6 @@ clean:
|
||||
-rm -rf ./MapboxGLAndroidSDK/build \
|
||||
./MapboxGLAndroidSDK/.externalNativeBuild \
|
||||
./MapboxGLAndroidSDKTestApp/build \
|
||||
./MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/activity/gen \
|
||||
./MapboxGLAndroidSDKTestApp/src/androidTest/java/org/maplibre/android/testapp/activity/gen \
|
||||
./MapboxGLAndroidSDK/src/main/assets \
|
||||
./MapboxGLAndroidSDKTestApp/src/main/assets/integration
|
||||
|
||||
@@ -95,7 +95,7 @@ android {
|
||||
jniDebuggable true
|
||||
}
|
||||
}
|
||||
namespace 'com.mapbox.mapboxsdk'
|
||||
namespace 'org.maplibre.android'
|
||||
lint {
|
||||
checkAllWarnings true
|
||||
disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission', 'WrongThreadInterprocedural'
|
||||
|
||||
@@ -11,12 +11,11 @@
|
||||
-dontnote com.google.gson.**
|
||||
|
||||
# dontnote for keeps the entry point x but not the descriptor class y
|
||||
-dontnote com.mapbox.mapboxsdk.maps.MapboxMap$OnFpsChangedListener
|
||||
-dontnote com.mapbox.mapboxsdk.style.layers.PropertyValue
|
||||
-dontnote com.mapbox.mapboxsdk.maps.MapboxMap
|
||||
-dontnote com.mapbox.mapboxsdk.maps.MapboxMapOptions
|
||||
-dontnote com.mapbox.mapboxsdk.log.LoggerDefinition
|
||||
-dontnote com.mapbox.mapboxsdk.location.engine.LocationEnginePriority
|
||||
-dontnote org.maplibre.android.maps.MapLibreMap$OnFpsChangedListener
|
||||
-dontnote org.maplibre.android.style.layers.PropertyValue
|
||||
-dontnote org.maplibre.android.maps.MapLibreMap
|
||||
-dontnote org.maplibre.android.maps.MapLibreMapOptions
|
||||
-dontnote org.maplibre.android.log.LoggerDefinition
|
||||
|
||||
# config for okhttp 3.11.0, https://github.com/square/okhttp/pull/3354
|
||||
-dontwarn javax.annotation.**
|
||||
|
||||
@@ -96,8 +96,8 @@ add_library(mapbox-gl SHARED
|
||||
${PROJECT_SOURCE_DIR}/java/util.hpp
|
||||
${PROJECT_SOURCE_DIR}/java_types.cpp
|
||||
${PROJECT_SOURCE_DIR}/java_types.hpp
|
||||
${PROJECT_SOURCE_DIR}/mapbox.cpp
|
||||
${PROJECT_SOURCE_DIR}/mapbox.hpp
|
||||
${PROJECT_SOURCE_DIR}/maplibre.cpp
|
||||
${PROJECT_SOURCE_DIR}/maplibre.hpp
|
||||
${PROJECT_SOURCE_DIR}/map/camera_position.cpp
|
||||
${PROJECT_SOURCE_DIR}/map/camera_position.hpp
|
||||
${PROJECT_SOURCE_DIR}/map/image.cpp
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace android {
|
||||
|
||||
class Marker : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/annotations/Marker"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/annotations/Marker"; };
|
||||
|
||||
static mbgl::Point<double> getPosition(jni::JNIEnv&, const jni::Object<Marker>&);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace android {
|
||||
|
||||
class Polygon : private MultiPoint {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/annotations/Polygon"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/annotations/Polygon"; };
|
||||
|
||||
static mbgl::FillAnnotation toAnnotation(jni::JNIEnv&, const jni::Object<Polygon>&);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace android {
|
||||
|
||||
class Polyline : private MultiPoint {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/annotations/Polyline"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/annotations/Polyline"; };
|
||||
|
||||
static mbgl::LineAnnotation toAnnotation(jni::JNIEnv&, const jni::Object<Polyline>&);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace android {
|
||||
|
||||
class ConnectivityListener : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/net/NativeConnectivityListener"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/net/NativeConnectivityListener"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "file_source.hpp"
|
||||
|
||||
#include "attach_env.hpp"
|
||||
#include "mapbox.hpp"
|
||||
#include "maplibre.hpp"
|
||||
|
||||
#include <mbgl/actor/actor.hpp>
|
||||
#include <mbgl/actor/scheduler.hpp>
|
||||
@@ -33,8 +33,8 @@ FileSource::FileSource(jni::JNIEnv& _env,
|
||||
[](const mbgl::ResourceOptions& resourceOptions, const mbgl::ClientOptions& clientOptions) {
|
||||
auto env{android::AttachEnv()};
|
||||
std::unique_ptr<mbgl::FileSource> assetFileSource;
|
||||
if (android::Mapbox::hasInstance(*env)) {
|
||||
auto assetManager = android::Mapbox::getAssetManager(*env);
|
||||
if (android::MapLibre::hasInstance(*env)) {
|
||||
auto assetManager = android::MapLibre::getAssetManager(*env);
|
||||
assetFileSource = std::make_unique<AssetManagerFileSource>(
|
||||
*env, assetManager, resourceOptions.clone(), clientOptions.clone());
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ namespace android {
|
||||
*/
|
||||
class FileSource {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/storage/FileSource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/storage/FileSource"; };
|
||||
|
||||
struct ResourceTransformCallback {
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/storage/"
|
||||
return "org/maplibre/android/storage/"
|
||||
"FileSource$ResourceTransformCallback";
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
struct ResourcesCachePathChangeCallback {
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/storage/"
|
||||
return "org/maplibre/android/storage/"
|
||||
"FileSource$ResourcesCachePathChangeCallback";
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace android {
|
||||
|
||||
class LatLng : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/geometry/LatLng"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/geometry/LatLng"; };
|
||||
|
||||
static jni::Local<jni::Object<LatLng>> New(jni::JNIEnv&, const mbgl::LatLng&);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace android {
|
||||
|
||||
class LatLngBounds : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/geometry/LatLngBounds"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/geometry/LatLngBounds"; };
|
||||
|
||||
static jni::Local<jni::Object<LatLngBounds>> New(jni::JNIEnv&, mbgl::LatLngBounds);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace android {
|
||||
|
||||
class LatLngQuad : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/geometry/LatLngQuad"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/geometry/LatLngQuad"; };
|
||||
|
||||
static jni::Local<jni::Object<LatLngQuad>> New(jni::JNIEnv&, std::array<mbgl::LatLng, 4>);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace android {
|
||||
|
||||
class ProjectedMeters : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/geometry/ProjectedMeters"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/geometry/ProjectedMeters"; };
|
||||
|
||||
static jni::Local<jni::Object<ProjectedMeters>> New(jni::JNIEnv&, double, double);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ private:
|
||||
|
||||
class HTTPRequest : public AsyncRequest {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/http/NativeHttpRequest"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/http/NativeHttpRequest"; };
|
||||
|
||||
HTTPRequest(jni::JNIEnv&, const Resource&, FileSource::Callback);
|
||||
~HTTPRequest();
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
class StringUtils {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/utils/StringUtils"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/utils/StringUtils"; };
|
||||
|
||||
static jni::Local<jni::String> unaccent(jni::JNIEnv&, const jni::String&);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "java_types.hpp"
|
||||
#include "map_renderer.hpp"
|
||||
#include "map_renderer_runnable.hpp"
|
||||
#include "mapbox.hpp"
|
||||
#include "maplibre.hpp"
|
||||
#include "native_map_view.hpp"
|
||||
#include "util/tile_server_options.hpp"
|
||||
#ifndef MBGL_MODULE_OFFLINE_DISABLE
|
||||
@@ -162,7 +162,7 @@ void registerNatives(JavaVM* vm) {
|
||||
Logger::registerNative(env);
|
||||
|
||||
// AssetManager
|
||||
Mapbox::registerNative(env);
|
||||
MapLibre::registerNative(env);
|
||||
|
||||
// Util
|
||||
DefaultStyle::registerNative(env);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace android {
|
||||
|
||||
class Logger {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/log/Logger"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/log/Logger"; };
|
||||
static void registerNative(jni::JNIEnv &);
|
||||
|
||||
static void log(jni::JNIEnv &, EventSeverity severity, const std::string &msg);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace android {
|
||||
|
||||
class CameraPosition : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/camera/CameraPosition"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/camera/CameraPosition"; };
|
||||
|
||||
static jni::Local<jni::Object<CameraPosition>> New(jni::JNIEnv&, mbgl::CameraOptions, float pixelRatio);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace android {
|
||||
|
||||
class Image : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/maps/Image"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/maps/Image"; };
|
||||
|
||||
static mbgl::style::Image getImage(jni::JNIEnv&, const jni::Object<Image>&);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class AndroidRendererBackend;
|
||||
*/
|
||||
class MapRenderer : public Scheduler {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/maps/renderer/MapRenderer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/maps/renderer/MapRenderer"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace android {
|
||||
*/
|
||||
class MapRendererRunnable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/maps/renderer/MapRendererRunnable"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/maps/renderer/MapRendererRunnable"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "mapbox.hpp"
|
||||
|
||||
namespace mbgl {
|
||||
namespace android {
|
||||
|
||||
jni::Local<jni::Object<AssetManager>> Mapbox::getAssetManager(jni::JNIEnv& env) {
|
||||
static auto& javaClass = jni::Class<Mapbox>::Singleton(env);
|
||||
auto method = javaClass.GetStaticMethod<jni::Object<AssetManager>()>(env, "getAssetManager");
|
||||
return javaClass.Call(env, method);
|
||||
}
|
||||
|
||||
jboolean Mapbox::hasInstance(jni::JNIEnv& env) {
|
||||
static auto& javaClass = jni::Class<Mapbox>::Singleton(env);
|
||||
auto method = javaClass.GetStaticMethod<jboolean()>(env, "hasInstance");
|
||||
return javaClass.Call(env, method);
|
||||
}
|
||||
|
||||
void Mapbox::registerNative(jni::JNIEnv& env) {
|
||||
jni::Class<Mapbox>::Singleton(env);
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
} // namespace mbgl
|
||||
23
platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.cpp
Normal file
23
platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "maplibre.hpp"
|
||||
|
||||
namespace mbgl {
|
||||
namespace android {
|
||||
|
||||
jni::Local<jni::Object<AssetManager>> MapLibre::getAssetManager(jni::JNIEnv& env) {
|
||||
static auto& javaClass = jni::Class<MapLibre>::Singleton(env);
|
||||
auto method = javaClass.GetStaticMethod<jni::Object<AssetManager>()>(env, "getAssetManager");
|
||||
return javaClass.Call(env, method);
|
||||
}
|
||||
|
||||
jboolean MapLibre::hasInstance(jni::JNIEnv& env) {
|
||||
static auto& javaClass = jni::Class<MapLibre>::Singleton(env);
|
||||
auto method = javaClass.GetStaticMethod<jboolean()>(env, "hasInstance");
|
||||
return javaClass.Call(env, method);
|
||||
}
|
||||
|
||||
void MapLibre::registerNative(jni::JNIEnv& env) {
|
||||
jni::Class<MapLibre>::Singleton(env);
|
||||
}
|
||||
|
||||
} // namespace android
|
||||
} // namespace mbgl
|
||||
@@ -7,9 +7,9 @@
|
||||
namespace mbgl {
|
||||
namespace android {
|
||||
|
||||
class Mapbox {
|
||||
class MapLibre {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/Mapbox"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/MapLibre"; };
|
||||
static jboolean hasInstance(jni::JNIEnv&);
|
||||
static jni::Local<jni::Object<AssetManager>> getAssetManager(jni::JNIEnv&);
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
@@ -1005,7 +1005,7 @@ void NativeMapView::addLayer(JNIEnv& env, jlong nativeLayerPtr, const jni::Strin
|
||||
before ? std::optional<std::string>(jni::Make<std::string>(env, before)) : std::optional<std::string>());
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1031,7 +1031,7 @@ void NativeMapView::addLayerAbove(JNIEnv& env, jlong nativeLayerPtr, const jni::
|
||||
if (index + 1 > layers.size()) {
|
||||
// Not found
|
||||
jni::ThrowNew(env,
|
||||
jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"),
|
||||
jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"),
|
||||
std::string("Could not find layer: ").append(siblingId).c_str());
|
||||
return;
|
||||
} else if (index + 1 < layers.size()) {
|
||||
@@ -1044,7 +1044,7 @@ void NativeMapView::addLayerAbove(JNIEnv& env, jlong nativeLayerPtr, const jni::
|
||||
layer->addToStyle(map->getStyle(), before);
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1059,7 +1059,7 @@ void NativeMapView::addLayerAt(JNIEnv& env, jlong nativeLayerPtr, jni::jint inde
|
||||
if (index > numLayers || index < 0) {
|
||||
Log::Error(Event::JNI, "Index out of range: " + std::to_string(index));
|
||||
jni::ThrowNew(env,
|
||||
jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"),
|
||||
jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"),
|
||||
std::string("Invalid index").c_str());
|
||||
return;
|
||||
}
|
||||
@@ -1069,7 +1069,7 @@ void NativeMapView::addLayerAt(JNIEnv& env, jlong nativeLayerPtr, jni::jint inde
|
||||
layer->addToStyle(map->getStyle(), layers.at(index)->getID());
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1145,7 +1145,7 @@ void NativeMapView::addSource(JNIEnv& env, const jni::Object<Source>& obj, jlong
|
||||
source->addToMap(env, obj, *map, *rendererFrontend);
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/sources/CannotAddSourceException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/sources/CannotAddSourceException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class MapRenderer;
|
||||
|
||||
class NativeMapView : public MapObserver {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/maps/NativeMapView"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/maps/NativeMapView"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
class ListOfflineRegionsCallback {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineManager$ListOfflineRegionsCallback";
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
class CreateOfflineRegionCallback {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineManager$CreateOfflineRegionCallback";
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
class MergeOfflineRegionsCallback {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineManager$MergeOfflineRegionsCallback";
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
struct FileSourceCallback {
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineManager$FileSourceCallback";
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
static void onError(jni::JNIEnv&, const jni::Object<OfflineManager::FileSourceCallback>&, const jni::String&);
|
||||
};
|
||||
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/offline/OfflineManager"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/offline/OfflineManager"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
class OfflineRegionObserver {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineRegion$OfflineRegionObserver";
|
||||
};
|
||||
};
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
class OfflineRegionStatusCallback {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineRegion$OfflineRegionStatusCallback";
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
class OfflineRegionDeleteCallback {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineRegion$OfflineRegionDeleteCallback";
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
class OfflineRegionInvalidateCallback {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineRegion$OfflineRegionInvalidateCallback";
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
class OfflineRegionUpdateMetadataCallback {
|
||||
public:
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineRegion$OfflineRegionUpdateMetadataCallback";
|
||||
};
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
std::optional<mbgl::OfflineRegionMetadata>);
|
||||
};
|
||||
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/offline/OfflineRegion"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/offline/OfflineRegion"; };
|
||||
|
||||
OfflineRegion(jni::JNIEnv&, jni::jlong, const jni::Object<FileSource>&);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace android {
|
||||
|
||||
class OfflineRegionDefinition {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/offline/OfflineRegionDefinition"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/offline/OfflineRegionDefinition"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
@@ -20,7 +20,7 @@ class OfflineTilePyramidRegionDefinition {
|
||||
public:
|
||||
using SuperTag = OfflineRegionDefinition;
|
||||
static constexpr auto Name() {
|
||||
return "com/mapbox/mapboxsdk/offline/"
|
||||
return "org/maplibre/android/offline/"
|
||||
"OfflineTilePyramidRegionDefinition";
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
class OfflineGeometryRegionDefinition {
|
||||
public:
|
||||
using SuperTag = OfflineRegionDefinition;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/offline/OfflineGeometryRegionDefinition"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/offline/OfflineGeometryRegionDefinition"; };
|
||||
|
||||
static jni::Local<jni::Object<OfflineRegionDefinition>> New(jni::JNIEnv&,
|
||||
const mbgl::OfflineGeometryRegionDefinition&);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace android {
|
||||
|
||||
class OfflineRegionError {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/offline/OfflineRegionError"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/offline/OfflineRegionError"; };
|
||||
|
||||
static jni::Local<jni::Object<OfflineRegionError>> New(jni::JNIEnv&, mbgl::Response::Error);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace android {
|
||||
|
||||
class OfflineRegionStatus {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/offline/OfflineRegionStatus"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/offline/OfflineRegionStatus"; };
|
||||
|
||||
static jni::Local<jni::Object<OfflineRegionStatus>> New(jni::JNIEnv&, mbgl::OfflineRegionStatus status);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
using PointForFn = mbgl::MapSnapshotter::PointForFn;
|
||||
using LatLngForFn = mbgl::MapSnapshotter::LatLngForFn;
|
||||
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/snapshotter/MapSnapshot"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/snapshotter/MapSnapshot"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ void MapSnapshotter::addLayerAt(JNIEnv& env, jlong nativeLayerPtr, jni::jint ind
|
||||
if (index > numLayers || index < 0) {
|
||||
Log::Error(Event::JNI, "Index out of range: " + std::to_string(index));
|
||||
jni::ThrowNew(env,
|
||||
jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"),
|
||||
jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"),
|
||||
std::string("Invalid index").c_str());
|
||||
}
|
||||
// Insert it below the current at that index
|
||||
@@ -208,7 +208,7 @@ void MapSnapshotter::addLayerAt(JNIEnv& env, jlong nativeLayerPtr, jni::jint ind
|
||||
layer->addToStyle(snapshotter->getStyle(), layers.at(index)->getID());
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ void MapSnapshotter::addLayerBelow(JNIEnv& env, jlong nativeLayerPtr, const jni:
|
||||
below ? std::optional<std::string>(jni::Make<std::string>(env, below)) : std::optional<std::string>());
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ void MapSnapshotter::addLayerAbove(JNIEnv& env, jlong nativeLayerPtr, const jni:
|
||||
if (index > snapshotterLayers.size()) {
|
||||
// Not found
|
||||
jni::ThrowNew(env,
|
||||
jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"),
|
||||
jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"),
|
||||
std::string("Could not find layer: ").append(siblingId).c_str());
|
||||
} else if (index < snapshotterLayers.size()) {
|
||||
// Place before the sibling
|
||||
@@ -259,7 +259,7 @@ void MapSnapshotter::addLayerAbove(JNIEnv& env, jlong nativeLayerPtr, const jni:
|
||||
newLayer->addToStyle(snapshotter->getStyle(), before);
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/layers/CannotAddLayerException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ void MapSnapshotter::addSource(JNIEnv& env, const jni::Object<Source>& obj, jlon
|
||||
source->addToStyle(env, obj, snapshotter->getStyle());
|
||||
} catch (const std::runtime_error& error) {
|
||||
jni::ThrowNew(
|
||||
env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/sources/CannotAddSourceException"), error.what());
|
||||
env, jni::FindClass(env, "org/maplibre/android/style/sources/CannotAddSourceException"), error.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace android {
|
||||
|
||||
class MapSnapshotter final : public mbgl::MapSnapshotterObserver {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/snapshotter/MapSnapshotter"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/snapshotter/MapSnapshotter"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace android {
|
||||
using SuperTag = jni::ObjectTag;
|
||||
class Formatted : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/types/Formatted"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/types/Formatted"; };
|
||||
|
||||
static jni::Local<jni::Object<Formatted>> New(jni::JNIEnv &, const style::expression::Formatted &value);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace android {
|
||||
|
||||
class FormattedSection : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/types/FormattedSection"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/types/FormattedSection"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class BackgroundLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/BackgroundLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/BackgroundLayer"; };
|
||||
|
||||
BackgroundLayer(jni::JNIEnv&, jni::String&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class CircleLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/CircleLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/CircleLayer"; };
|
||||
|
||||
CircleLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace android {
|
||||
class CustomLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/CustomLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/CustomLayer"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class FillExtrusionLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/FillExtrusionLayer"; };
|
||||
|
||||
FillExtrusionLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class FillLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/FillLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/FillLayer"; };
|
||||
|
||||
FillLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class HeatmapLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/HeatmapLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/HeatmapLayer"; };
|
||||
|
||||
HeatmapLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class HillshadeLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/HillshadeLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/HillshadeLayer"; };
|
||||
|
||||
HillshadeLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace android {
|
||||
|
||||
class Layer {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/Layer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/Layer"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ class <%- camelize(type) %>Layer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/location/<%- camelize(type) %>Layer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/location/<%- camelize(type) %>Layer"; };
|
||||
<% } else { -%>
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/<%- camelize(type) %>Layer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/<%- camelize(type) %>Layer"; };
|
||||
<% } -%>
|
||||
|
||||
<% if (type === 'background' || type === 'location-indicator') { -%>
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class LineLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/LineLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/LineLayer"; };
|
||||
|
||||
LineLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class LocationIndicatorLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/location/LocationIndicatorLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/location/LocationIndicatorLayer"; };
|
||||
|
||||
LocationIndicatorLayer(jni::JNIEnv&, jni::String&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class RasterLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/RasterLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/RasterLayer"; };
|
||||
|
||||
RasterLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
class SymbolLayer : public Layer {
|
||||
public:
|
||||
using SuperTag = Layer;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/SymbolLayer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/SymbolLayer"; };
|
||||
|
||||
SymbolLayer(jni::JNIEnv&, jni::String&, jni::String&);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ using namespace style;
|
||||
|
||||
class Light : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/light/Light"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/light/Light"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace android {
|
||||
|
||||
class Position : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/light/Position"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/light/Position"; };
|
||||
|
||||
static jni::Local<jni::Object<Position>> fromPosition(jni::JNIEnv&, jfloat, jfloat, jfloat);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace android {
|
||||
class CustomGeometrySource : public Source {
|
||||
public:
|
||||
using SuperTag = Source;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/CustomGeometrySource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/CustomGeometrySource"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ struct Update {
|
||||
class GeoJSONSource : public Source {
|
||||
public:
|
||||
using SuperTag = Source;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/GeoJsonSource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/GeoJsonSource"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Bitmap;
|
||||
class ImageSource : public Source {
|
||||
public:
|
||||
using SuperTag = Source;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/ImageSource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/ImageSource"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace android {
|
||||
class RasterDEMSource : public Source {
|
||||
public:
|
||||
using SuperTag = Source;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/RasterDemSource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/RasterDemSource"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace android {
|
||||
class RasterSource : public Source {
|
||||
public:
|
||||
using SuperTag = Source;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/RasterSource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/RasterSource"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace android {
|
||||
|
||||
class Source : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/Source"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/Source"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace android {
|
||||
class UnknownSource : public Source {
|
||||
public:
|
||||
using SuperTag = Source;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/UnknownSource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/UnknownSource"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace android {
|
||||
class VectorSource : public Source {
|
||||
public:
|
||||
using SuperTag = Source;
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/VectorSource"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/sources/VectorSource"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace android {
|
||||
|
||||
class TransitionOptions : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/TransitionOptions"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/style/layers/TransitionOptions"; };
|
||||
|
||||
static jni::Local<jni::Object<TransitionOptions>> fromTransitionOptions(jni::JNIEnv&,
|
||||
jlong duration,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/*
|
||||
android::LocalGlyphRasterizer is the JNI wrapper of
|
||||
com/mapbox/mapboxsdk/text/LocalGlyphRasterizer
|
||||
org/maplibre/android/text/LocalGlyphRasterizer
|
||||
|
||||
mbgl::LocalGlyphRasterizer is the portable interface
|
||||
Both implementations are in local_glyph_rasterizer.cpp
|
||||
@@ -17,7 +17,7 @@ namespace android {
|
||||
|
||||
class LocalGlyphRasterizer {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/text/LocalGlyphRasterizer"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/text/LocalGlyphRasterizer"; };
|
||||
|
||||
static void registerNative(jni::JNIEnv&);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace android {
|
||||
|
||||
class DefaultStyle : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/util/DefaultStyle"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/util/DefaultStyle"; };
|
||||
|
||||
static jni::Local<jni::Object<DefaultStyle>> New(jni::JNIEnv&, const mbgl::util::DefaultStyle&);
|
||||
static mbgl::util::DefaultStyle getDefaultStyle(jni::JNIEnv&, const jni::Object<DefaultStyle>&);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace android {
|
||||
|
||||
class TileServerOptions : private mbgl::util::noncopyable {
|
||||
public:
|
||||
static constexpr auto Name() { return "com/mapbox/mapboxsdk/util/TileServerOptions"; };
|
||||
static constexpr auto Name() { return "org/maplibre/android/util/TileServerOptions"; };
|
||||
|
||||
static jni::Local<jni::Object<TileServerOptions>> New(jni::JNIEnv&, const mbgl::TileServerOptions&);
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Annotation API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.annotations;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Attribution API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.attribution;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Camera API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.camera
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Constant API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.constants;
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.mapbox.mapboxsdk.exceptions;
|
||||
|
||||
import com.mapbox.mapboxsdk.WellKnownTileServer;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* A MapboxConfigurationException is thrown by MapboxMap when the SDK hasn't been properly initialised.
|
||||
* <p>
|
||||
* This occurs either when {@link com.mapbox.mapboxsdk.Mapbox} is not correctly initialised or the provided apiKey
|
||||
* through {@link com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String, WellKnownTileServer)} isn't valid.
|
||||
* </p>
|
||||
*
|
||||
* @see com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String, WellKnownTileServer)
|
||||
*/
|
||||
public class MapboxConfigurationException extends RuntimeException {
|
||||
|
||||
/**
|
||||
* Creates a Mapbox configuration exception thrown by MapboxMap when the SDK hasn't been properly initialised.
|
||||
*/
|
||||
public MapboxConfigurationException() {
|
||||
super("\nUsing MapView requires calling Mapbox.getInstance(Context context, String apiKey, "
|
||||
+ "WellKnownTileServer wellKnownTileServer) before inflating or creating the view.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Mapbox configuration exception thrown by MapboxMap when the SDK hasn't been properly initialised.
|
||||
*/
|
||||
public MapboxConfigurationException(@NonNull String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Exception API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.exceptions;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Geometry API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.geometry
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapbox.geojson.Feature;
|
||||
import com.mapbox.geojson.Point;
|
||||
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_COMPASS_BEARING;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_GPS_BEARING;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_LOCATION_STALE;
|
||||
|
||||
class LayerFeatureProvider {
|
||||
|
||||
@NonNull
|
||||
Feature generateLocationFeature(@Nullable Feature locationFeature, boolean isStale) {
|
||||
if (locationFeature != null) {
|
||||
return locationFeature;
|
||||
}
|
||||
locationFeature = Feature.fromGeometry(Point.fromLngLat(0.0, 0.0));
|
||||
locationFeature.addNumberProperty(PROPERTY_GPS_BEARING, 0f);
|
||||
locationFeature.addNumberProperty(PROPERTY_COMPASS_BEARING, 0f);
|
||||
locationFeature.addBooleanProperty(PROPERTY_LOCATION_STALE, isStale);
|
||||
return locationFeature;
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapbox.geojson.Feature;
|
||||
import com.mapbox.mapboxsdk.style.layers.CircleLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.Layer;
|
||||
import com.mapbox.mapboxsdk.style.layers.Property;
|
||||
import com.mapbox.mapboxsdk.style.layers.SymbolLayer;
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions;
|
||||
import com.mapbox.mapboxsdk.style.sources.GeoJsonSource;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.ACCURACY_LAYER;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_LAYER;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_LAYER;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_LAYER;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.LOCATION_SOURCE;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_ACCURACY_ALPHA;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_ACCURACY_COLOR;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_ACCURACY_RADIUS;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_BACKGROUND_ICON;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_BACKGROUND_STALE_ICON;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_BEARING_ICON;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_COMPASS_BEARING;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_FOREGROUND_ICON;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_FOREGROUND_ICON_OFFSET;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_FOREGROUND_STALE_ICON;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_GPS_BEARING;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_LOCATION_STALE;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_SHADOW_ICON_OFFSET;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PULSING_CIRCLE_LAYER;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.SHADOW_ICON;
|
||||
import static com.mapbox.mapboxsdk.location.LocationComponentConstants.SHADOW_LAYER;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.get;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.literal;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.match;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.stop;
|
||||
import static com.mapbox.mapboxsdk.style.expressions.Expression.switchCase;
|
||||
import static com.mapbox.mapboxsdk.style.layers.Property.ICON_ROTATION_ALIGNMENT_MAP;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circleColor;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circleOpacity;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circlePitchAlignment;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circleRadius;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circleStrokeColor;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconAllowOverlap;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconIgnorePlacement;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconImage;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconOffset;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconRotate;
|
||||
import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconRotationAlignment;
|
||||
|
||||
class LayerSourceProvider {
|
||||
|
||||
private static final String EMPTY_STRING = "";
|
||||
|
||||
@NonNull
|
||||
GeoJsonSource generateSource(Feature locationFeature) {
|
||||
return new GeoJsonSource(
|
||||
LOCATION_SOURCE,
|
||||
locationFeature,
|
||||
new GeoJsonOptions().withMaxZoom(16)
|
||||
);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
Layer generateLayer(@NonNull String layerId) {
|
||||
SymbolLayer layer = new SymbolLayer(layerId, LOCATION_SOURCE);
|
||||
layer.setProperties(
|
||||
iconAllowOverlap(true),
|
||||
iconIgnorePlacement(true),
|
||||
iconRotationAlignment(ICON_ROTATION_ALIGNMENT_MAP),
|
||||
iconRotate(
|
||||
match(literal(layerId), literal(0f),
|
||||
stop(FOREGROUND_LAYER, get(PROPERTY_GPS_BEARING)),
|
||||
stop(BACKGROUND_LAYER, get(PROPERTY_GPS_BEARING)),
|
||||
stop(SHADOW_LAYER, get(PROPERTY_GPS_BEARING)),
|
||||
stop(BEARING_LAYER, get(PROPERTY_COMPASS_BEARING))
|
||||
)
|
||||
),
|
||||
iconImage(
|
||||
match(literal(layerId), literal(EMPTY_STRING),
|
||||
stop(FOREGROUND_LAYER, switchCase(
|
||||
get(PROPERTY_LOCATION_STALE), get(PROPERTY_FOREGROUND_STALE_ICON),
|
||||
get(PROPERTY_FOREGROUND_ICON))),
|
||||
stop(BACKGROUND_LAYER, switchCase(
|
||||
get(PROPERTY_LOCATION_STALE), get(PROPERTY_BACKGROUND_STALE_ICON),
|
||||
get(PROPERTY_BACKGROUND_ICON))),
|
||||
stop(SHADOW_LAYER, literal(SHADOW_ICON)),
|
||||
stop(BEARING_LAYER, get(PROPERTY_BEARING_ICON))
|
||||
)
|
||||
),
|
||||
iconOffset(
|
||||
match(literal(layerId), literal(new Float[] {0f, 0f}),
|
||||
stop(literal(FOREGROUND_LAYER), get(PROPERTY_FOREGROUND_ICON_OFFSET)),
|
||||
stop(literal(SHADOW_LAYER), get(PROPERTY_SHADOW_ICON_OFFSET))
|
||||
)
|
||||
)
|
||||
);
|
||||
return layer;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
Layer generateAccuracyLayer() {
|
||||
return new CircleLayer(ACCURACY_LAYER, LOCATION_SOURCE)
|
||||
.withProperties(
|
||||
circleRadius(get(PROPERTY_ACCURACY_RADIUS)),
|
||||
circleColor(get(PROPERTY_ACCURACY_COLOR)),
|
||||
circleOpacity(get(PROPERTY_ACCURACY_ALPHA)),
|
||||
circleStrokeColor(get(PROPERTY_ACCURACY_COLOR)),
|
||||
circlePitchAlignment(Property.CIRCLE_PITCH_ALIGNMENT_MAP)
|
||||
);
|
||||
}
|
||||
|
||||
Set<String> getEmptyLayerSet() {
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
LocationLayerRenderer getSymbolLocationLayerRenderer(LayerFeatureProvider featureProvider,
|
||||
boolean isStale) {
|
||||
return new SymbolLocationLayerRenderer(this, featureProvider, isStale);
|
||||
}
|
||||
|
||||
LocationLayerRenderer getIndicatorLocationLayerRenderer() {
|
||||
return new IndicatorLocationLayerRenderer(this);
|
||||
}
|
||||
|
||||
Layer generateLocationComponentLayer() {
|
||||
LocationIndicatorLayer layer = new LocationIndicatorLayer(FOREGROUND_LAYER);
|
||||
layer.setLocationTransition(new TransitionOptions(0, 0));
|
||||
layer.setProperties(
|
||||
LocationPropertyFactory.perspectiveCompensation(0.9f),
|
||||
LocationPropertyFactory.imageTiltDisplacement(4f)
|
||||
);
|
||||
return layer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a {@link CircleLayer} to the map to support the {@link LocationComponent} pulsing UI functionality.
|
||||
*
|
||||
* @return a {@link CircleLayer} with the correct data-driven styling. Tilting the map will keep the pulsing
|
||||
* layer aligned with the map plane.
|
||||
*/
|
||||
@NonNull
|
||||
Layer generatePulsingCircleLayer() {
|
||||
return new CircleLayer(PULSING_CIRCLE_LAYER, LOCATION_SOURCE)
|
||||
.withProperties(
|
||||
circlePitchAlignment(Property.CIRCLE_PITCH_ALIGNMENT_MAP)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
|
||||
import android.animation.TypeEvaluator;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
|
||||
class MapboxLatLngAnimator extends MapboxAnimator<LatLng> {
|
||||
|
||||
MapboxLatLngAnimator(@NonNull LatLng[] values, @NonNull AnimationsValueChangeListener updateListener,
|
||||
int maxAnimationFps) {
|
||||
super(values, updateListener, maxAnimationFps);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
TypeEvaluator provideEvaluator() {
|
||||
return new LatLngEvaluator();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Location layer component camera and render modes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.location.modes;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Location layer component.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Log API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.log;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Maps API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.maps;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android EGL API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.maps.renderer.egl;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android GLSurfaceView API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.maps.renderer.glsurfaceview;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Renderer API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.maps.renderer;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android TextureView API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.maps.renderer.textureview;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Widgets API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.maps.widgets;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Modular Http API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.module.http;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Modular Library Loader API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.module.loader;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Network API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.net;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Offline API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.offline
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Snapshotter API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.snapshotter
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Storage API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.storage;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Expression API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.style.expressions;
|
||||
@@ -1,262 +0,0 @@
|
||||
<%
|
||||
const type = locals.type;
|
||||
const properties = locals.properties;
|
||||
const doc = locals.doc;
|
||||
-%>
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
<% } else { -%>
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
<% } -%>
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
<% if (type === 'symbol') { -%>
|
||||
import com.mapbox.mapboxsdk.style.types.Formatted;
|
||||
import com.mapbox.mapboxsdk.style.types.FormattedSection;
|
||||
<% } -%>
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
import com.mapbox.mapboxsdk.style.layers.Layer;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* <%- doc %>
|
||||
*
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers-<%- type %>">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
<% if (type === 'location-indicator') { -%>
|
||||
class <%- camelize(type) %>Layer extends Layer {
|
||||
<% } else { -%>
|
||||
public class <%- camelize(type) %>Layer extends Layer {
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* Creates a <%- camelize(type) %>Layer.
|
||||
*
|
||||
* @param nativePtr pointer used by core
|
||||
*/
|
||||
@Keep
|
||||
<%- camelize(type) %>Layer(long nativePtr) {
|
||||
super(nativePtr);
|
||||
}
|
||||
|
||||
<% if (type === 'background' || type === 'location-indicator') { -%>
|
||||
/**
|
||||
* Creates a <%- camelize(type) %>Layer.
|
||||
*
|
||||
* @param layerId the id of the layer
|
||||
*/
|
||||
public <%- camelize(type) %>Layer(String layerId) {
|
||||
super();
|
||||
initialize(layerId);
|
||||
}
|
||||
|
||||
@Keep
|
||||
protected native void initialize(String layerId);
|
||||
|
||||
<% } else { -%>
|
||||
/**
|
||||
* Creates a <%- camelize(type) %>Layer.
|
||||
*
|
||||
* @param layerId the id of the layer
|
||||
* @param sourceId the id of the source
|
||||
*/
|
||||
public <%- camelize(type) %>Layer(String layerId, String sourceId) {
|
||||
super();
|
||||
initialize(layerId, sourceId);
|
||||
}
|
||||
|
||||
@Keep
|
||||
protected native void initialize(String layerId, String sourceId);
|
||||
|
||||
/**
|
||||
* Set the source layer.
|
||||
*
|
||||
* @param sourceLayer the source layer to set
|
||||
*/
|
||||
public void setSourceLayer(String sourceLayer) {
|
||||
checkThread();
|
||||
nativeSetSourceLayer(sourceLayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the source Layer.
|
||||
*
|
||||
* @param sourceLayer the source layer to set
|
||||
* @return This
|
||||
*/
|
||||
@NonNull
|
||||
public <%- camelize(type) %>Layer withSourceLayer(String sourceLayer) {
|
||||
setSourceLayer(sourceLayer);
|
||||
return this;
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
<% if (type !== 'background' && type !== 'location-indicator' && type !== 'custom') { -%>
|
||||
/**
|
||||
* Get the source id.
|
||||
*
|
||||
* @return id of the source
|
||||
*/
|
||||
@NonNull
|
||||
public String getSourceId() {
|
||||
checkThread();
|
||||
return nativeGetSourceId();
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
<% if (type !== 'background' && type !== 'location-indicator' && type !== 'raster' && type !== 'hillshade') { -%>
|
||||
/**
|
||||
* Get the source layer.
|
||||
*
|
||||
* @return sourceLayer the source layer to get
|
||||
*/
|
||||
@NonNull
|
||||
public String getSourceLayer() {
|
||||
checkThread();
|
||||
return nativeGetSourceLayer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a single expression filter.
|
||||
*
|
||||
* @param filter the expression filter to set
|
||||
*/
|
||||
public void setFilter(@NonNull Expression filter) {
|
||||
checkThread();
|
||||
nativeSetFilter(filter.toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a single expression filter.
|
||||
*
|
||||
* @param filter the expression filter to set
|
||||
* @return This
|
||||
*/
|
||||
@NonNull
|
||||
public <%- camelize(type) %>Layer withFilter(@NonNull Expression filter) {
|
||||
setFilter(filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single expression filter.
|
||||
*
|
||||
* @return the expression filter to get
|
||||
*/
|
||||
@Nullable
|
||||
public Expression getFilter() {
|
||||
checkThread();
|
||||
JsonElement jsonElement = nativeGetFilter();
|
||||
if (jsonElement != null) {
|
||||
return Expression.Converter.convert(jsonElement);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
/**
|
||||
* Set a property or properties.
|
||||
*
|
||||
* @param properties the var-args properties
|
||||
* @return This
|
||||
*/
|
||||
@NonNull
|
||||
public <%- camelize(type) %>Layer withProperties(@NonNull PropertyValue<?>... properties) {
|
||||
setProperties(properties);
|
||||
return this;
|
||||
}
|
||||
|
||||
// Property getters
|
||||
<% for (const property of properties) { -%>
|
||||
|
||||
/**
|
||||
* Get the <%- camelize(property.name) %> property
|
||||
*
|
||||
* @return property wrapper value around <%- propertyType(property) %>
|
||||
*/
|
||||
@NonNull
|
||||
@SuppressWarnings("unchecked")
|
||||
public PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() {
|
||||
checkThread();
|
||||
return (PropertyValue<<%- propertyType(property) %>>) new PropertyValue("<%- property.name %>", nativeGet<%- camelize(property.name) %>());
|
||||
}
|
||||
<% if (property.type == 'color') { -%>
|
||||
|
||||
/**
|
||||
* <%- property.doc %>
|
||||
*
|
||||
* @return int representation of a rgba string color
|
||||
* @throws RuntimeException thrown if property isn't a value
|
||||
*/
|
||||
@ColorInt
|
||||
public int get<%- camelize(property.name) %>AsInt() {
|
||||
checkThread();
|
||||
PropertyValue<<%- propertyType(property) %>> value = get<%- camelize(property.name) %>();
|
||||
if (value.isValue()) {
|
||||
return rgbaToColor(value.getValue());
|
||||
} else {
|
||||
throw new RuntimeException("<%- property.name %> was set as a Function");
|
||||
}
|
||||
}
|
||||
<% } -%>
|
||||
<% if (property.transition) { -%>
|
||||
|
||||
/**
|
||||
* Get the <%- camelize(property.name) %> property transition options
|
||||
*
|
||||
* @return transition options for <%- propertyType(property) %>
|
||||
*/
|
||||
@NonNull
|
||||
public TransitionOptions get<%- camelize(property.name) %>Transition() {
|
||||
checkThread();
|
||||
return nativeGet<%- camelize(property.name) %>Transition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the <%- camelize(property.name) %> property transition options
|
||||
*
|
||||
* @param options transition options for <%- propertyType(property) %>
|
||||
*/
|
||||
public void set<%- camelize(property.name) %>Transition(@NonNull TransitionOptions options) {
|
||||
checkThread();
|
||||
nativeSet<%- camelize(property.name) %>Transition(options.getDuration(), options.getDelay());
|
||||
}
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
|
||||
<% for (const property of properties) { -%>
|
||||
@NonNull
|
||||
@Keep
|
||||
private native Object nativeGet<%- camelize(property.name) %>();
|
||||
|
||||
<% if (property.transition) { -%>
|
||||
@NonNull
|
||||
@Keep
|
||||
private native TransitionOptions nativeGet<%- camelize(property.name) %>Transition();
|
||||
|
||||
@Keep
|
||||
private native void nativeSet<%- camelize(property.name) %>Transition(long duration, long delay);
|
||||
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
@Override
|
||||
@Keep
|
||||
protected native void finalize() throws Throwable;
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Style Layer API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
@@ -1,115 +0,0 @@
|
||||
<%
|
||||
const paintProperties = locals.paintProperties;
|
||||
const layoutProperties = locals.layoutProperties;
|
||||
const locationIndicator = locals.locationIndicator;
|
||||
-%>
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
<% if (locationIndicator) { -%>
|
||||
package com.mapbox.mapboxsdk.location;
|
||||
<% } else { -%>
|
||||
package com.mapbox.mapboxsdk.style.layers;
|
||||
<% } -%>
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.expressions.Expression;
|
||||
import com.mapbox.mapboxsdk.style.types.Formatted;
|
||||
import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString;
|
||||
<% if (locationIndicator) { -%>
|
||||
import com.mapbox.mapboxsdk.style.layers.LayoutPropertyValue;
|
||||
import com.mapbox.mapboxsdk.style.layers.PaintPropertyValue;
|
||||
import com.mapbox.mapboxsdk.style.layers.Property;
|
||||
import com.mapbox.mapboxsdk.style.layers.PropertyValue;
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* Constructs paint/layout properties for Layers
|
||||
*
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#layers">Layer style documentation</a>
|
||||
*/
|
||||
<% if (locationIndicator) { -%>
|
||||
class LocationPropertyFactory {
|
||||
<% } else { -%>
|
||||
public class PropertyFactory {
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* Set the property visibility.
|
||||
*
|
||||
* @param value the visibility value
|
||||
* @return property wrapper around visibility
|
||||
*/
|
||||
public static PropertyValue<String> visibility(@Property.VISIBILITY String value) {
|
||||
return new LayoutPropertyValue<>("visibility", value);
|
||||
}
|
||||
|
||||
<% for (const property of paintProperties) { -%>
|
||||
<% if (property.type == 'color') { -%>
|
||||
/**
|
||||
* <%- propertyFactoryMethodDoc(property) %>
|
||||
*
|
||||
* @param value a int color value
|
||||
* @return property wrapper around String color
|
||||
*/
|
||||
public static PropertyValue<String> <%- camelizeWithLeadingLowercase(property.name) %>(@ColorInt int value) {
|
||||
return new PaintPropertyValue<>("<%- property.name %>", colorToRgbaString(value));
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
/**
|
||||
* <%- propertyFactoryMethodDoc(property) %>
|
||||
*
|
||||
* @param value a <%- propertyType(property) %> value
|
||||
* @return property wrapper around <%- propertyType(property) %>
|
||||
*/
|
||||
public static PropertyValue<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %>(<%- propertyTypeAnnotation(property) %><%- iff(() => propertyTypeAnnotation(property), " ") %><%- propertyType(property) %> value) {
|
||||
return new PaintPropertyValue<>("<%- property.name %>", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* <%- propertyFactoryMethodDoc(property) %>
|
||||
*
|
||||
* @param expression an expression statement
|
||||
* @return property wrapper around an expression statement
|
||||
*/
|
||||
public static PropertyValue<Expression> <%- camelizeWithLeadingLowercase(property.name) %>(Expression expression) {
|
||||
return new PaintPropertyValue<>("<%- property.name %>", expression);
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
<% for (const property of layoutProperties) { -%>
|
||||
<% if (property.type === 'formatted') { -%>
|
||||
/**
|
||||
* <%- propertyFactoryMethodDoc(property) %>
|
||||
*
|
||||
* @param value a String value
|
||||
* @return property wrapper around String
|
||||
*/
|
||||
public static PropertyValue<String> <%- camelizeWithLeadingLowercase(property.name) %>(String value) {
|
||||
return new LayoutPropertyValue<>("<%- property.name %>", value);
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
/**
|
||||
* <%- propertyFactoryMethodDoc(property) %>
|
||||
*
|
||||
* @param value a <%- propertyType(property) %> value
|
||||
* @return property wrapper around <%- propertyType(property) %>
|
||||
*/
|
||||
public static PropertyValue<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %>(<%- propertyTypeAnnotation(property) %><%- iff(() => propertyTypeAnnotation(property), " ") %><%- propertyType(property) %> value) {
|
||||
return new LayoutPropertyValue<>("<%- property.name %>", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* <%- propertyFactoryMethodDoc(property) %>
|
||||
*
|
||||
* @param value a <%- propertyType(property) %> value
|
||||
* @return property wrapper around <%- propertyType(property) %>
|
||||
*/
|
||||
public static PropertyValue<Expression> <%- camelizeWithLeadingLowercase(property.name) %>(Expression value) {
|
||||
return new LayoutPropertyValue<>("<%- property.name %>", value);
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
<%
|
||||
const properties = locals.properties;
|
||||
const doc = locals.doc;
|
||||
-%>
|
||||
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
||||
|
||||
package com.mapbox.mapboxsdk.style.light;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
import com.mapbox.mapboxsdk.style.layers.Property;
|
||||
import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
|
||||
import com.mapbox.mapboxsdk.utils.ColorUtils;
|
||||
import com.mapbox.mapboxsdk.utils.ThreadUtils;
|
||||
|
||||
/**
|
||||
* The global light source.
|
||||
*
|
||||
* @see <a href="https://maplibre.org/maplibre-style-spec/#light">The online documentation</a>
|
||||
*/
|
||||
@UiThread
|
||||
public class Light {
|
||||
|
||||
private static final String TAG = "Mbgl-Light";
|
||||
|
||||
@Keep
|
||||
private long nativePtr;
|
||||
|
||||
/**
|
||||
* Creates a Light.
|
||||
*
|
||||
* @param nativePtr pointer used by core
|
||||
*/
|
||||
@Keep
|
||||
Light(long nativePtr) {
|
||||
checkThread();
|
||||
this.nativePtr = nativePtr;
|
||||
}
|
||||
<% for (const property of properties) { -%>
|
||||
<% if (property.name == "position") {-%>
|
||||
|
||||
/**
|
||||
* Set the <%- camelize(property.name) %> property. <%- property.doc %>
|
||||
*
|
||||
* @param position of the light
|
||||
*/
|
||||
public void set<%- camelize(property.name) %>(@NonNull Position position) {
|
||||
checkThread();
|
||||
nativeSet<%- camelize(property.name) %>(position);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <%- camelize(property.name) %> property. <%- property.doc %>
|
||||
*
|
||||
* @return <%- property.name %> as Position
|
||||
*/
|
||||
@NonNull
|
||||
public Position get<%- camelize(property.name) %>() {
|
||||
checkThread();
|
||||
return nativeGet<%- camelize(property.name) %>();
|
||||
}
|
||||
<% } else { -%>
|
||||
<% if (property.name == "color") {-%>
|
||||
|
||||
/**
|
||||
* Set the <%- camelize(property.name) %> property. <%- property.doc %>
|
||||
*
|
||||
* @param <%- property.name %> as int
|
||||
*/
|
||||
public void set<%- camelize(property.name) %>(@ColorInt int <%- property.name %>) {
|
||||
checkThread();
|
||||
nativeSet<%- camelize(property.name) %>(ColorUtils.colorToRgbaString(<%- property.name %>));
|
||||
}
|
||||
<% } -%>
|
||||
|
||||
/**
|
||||
* Set the <%- camelize(property.name) %> property. <%- property.doc %>
|
||||
*
|
||||
* @param <%- property.name %> as <%- propertyType(property) %>
|
||||
*/
|
||||
public void set<%- camelize(property.name) %>(<%- propertyTypeAnnotation(property) %><%- iff(() => propertyTypeAnnotation(property), " ") %><%- propertyJavaType(property) %> <%- property.name %>) {
|
||||
checkThread();
|
||||
nativeSet<%- camelize(property.name) %>(<%- property.name %>);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <%- camelize(property.name) %> property. <%- property.doc %>
|
||||
*
|
||||
* @return <%- property.name %> as <%- propertyType(property) %>
|
||||
*/
|
||||
@NonNull
|
||||
<%- propertyTypeAnnotation(property) %> public <%- propertyJavaType(property) %> get<%- camelize(property.name) %>() {
|
||||
checkThread();
|
||||
return nativeGet<%- camelize(property.name) %>();
|
||||
}
|
||||
<% } -%>
|
||||
<% if (property.transition) { -%>
|
||||
|
||||
/**
|
||||
* Get the <%- camelize(property.name) %> property transition options.
|
||||
*
|
||||
* @return transition options for <%- property.name %>
|
||||
*/
|
||||
@NonNull
|
||||
public TransitionOptions get<%- camelize(property.name) %>Transition() {
|
||||
checkThread();
|
||||
return nativeGet<%- camelize(property.name) %>Transition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the <%- camelize(property.name) %> property transition options.
|
||||
*
|
||||
* @param options transition options for <%- property.name %>
|
||||
*/
|
||||
public void set<%- camelize(property.name) %>Transition(@NonNull TransitionOptions options) {
|
||||
checkThread();
|
||||
nativeSet<%- camelize(property.name) %>Transition(options.getDuration(), options.getDelay());
|
||||
}
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
|
||||
private void checkThread(){
|
||||
ThreadUtils.checkThread(TAG);
|
||||
}
|
||||
|
||||
<% for (const property of properties) { -%>
|
||||
<% if (property.name == "position") {-%>
|
||||
@Keep
|
||||
private native void nativeSet<%- camelize(property.name) %>(Position position);
|
||||
|
||||
@NonNull
|
||||
@Keep
|
||||
private native Position nativeGet<%- camelize(property.name) %>();
|
||||
<% } else { -%>
|
||||
@Keep
|
||||
private native void nativeSet<%- camelize(property.name) %>(<%- propertyJavaType(property) -%> <%- property.name %>);
|
||||
|
||||
@NonNull
|
||||
@Keep
|
||||
private native <%- propertyJavaType(property) -%> nativeGet<%- camelize(property.name) %>();
|
||||
<% } -%>
|
||||
<% if (property.transition) { -%>
|
||||
@NonNull
|
||||
@Keep
|
||||
private native TransitionOptions nativeGet<%- camelize(property.name) %>Transition();
|
||||
|
||||
@Keep
|
||||
private native void nativeSet<%- camelize(property.name) %>Transition(long duration, long delay);
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Style Light API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.style.light;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Style Sources API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.style.sources
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Formatted Expression Types API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.style.types
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains the Mapbox Maps Android Text API classes.
|
||||
*/
|
||||
package com.mapbox.mapboxsdk.text;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user