diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index ac4f77aa4..f06acc657 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -6,6 +6,24 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C ### ✨ Features and improvements +- πŸ’₯ Breaking: Change package of all classes from `com.mapbox.mapboxsdk` to `org.maplibre.android` ([#1201](https://github.com/maplibre/maplibre-native/pull/1201)). This means you will need to fix your imports. + + > To migrate: + > In your imports in each of your project files, replace `com.mapbox.mapboxsdk.` with `org.maplibre.android.*`. + +- πŸ’₯ Breaking: Rename several classes to no longer contain the word "Mapbox". You will need to migrate by renaming references. + + > To migrate: + > Each affected occurrence will be marked as an error during compilation. Replace each occurrence of "Mapbox" with "MapLibre" and let your IDE do the import. + > + > These are the most important classes that have been renamed: + > + > - `Mapbox` β†’ `MapLibre` + > - `MapboxMap` β†’ `MapLibreMap` + > - `MapboxConstants` β†’ `MapLibreConstants` + > - `MapboxMapOptions` β†’ `MapLibreMapOptions` + > - but also others, less frequently used ones, like `MapboxGLSurfaceView` β†’ `MapLibreGLSurfaceView`. + ### 🐞 Bug fixes ### β›΅ Dependencies @@ -14,151 +32,154 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C ### ✨ Features and improvements -* Change to a more natural fling animation and allow setting `flingThreshold` and `flingAnimationBaseTime` in `UiSettings` ([#963](https://github.com/maplibre/maplibre-native/pull/963)) -* Add support for the [`index-of` expression](https://maplibre.org/maplibre-style-spec/expressions/#index-of) ([#1113](https://github.com/maplibre/maplibre-native/pull/1113)) +- Change to a more natural fling animation and allow setting `flingThreshold` and `flingAnimationBaseTime` in `UiSettings` ([#963](https://github.com/maplibre/maplibre-native/pull/963)) +- Add support for the [`index-of` expression](https://maplibre.org/maplibre-style-spec/expressions/#index-of) ([#1113](https://github.com/maplibre/maplibre-native/pull/1113)) ### 🐞 Bug fixes -* Fix regression in CameraUpdateFactory#zoomOut ([#1035](https://github.com/maplibre/maplibre-native/pull/1035)) -* `AndroidLocationEngineImpl` made public to create custom `LocationEngineProvider`([#850](https://github.com/maplibre/maplibre-native/pull/850)) +- Fix regression in CameraUpdateFactory#zoomOut ([#1035](https://github.com/maplibre/maplibre-native/pull/1035)) +- `AndroidLocationEngineImpl` made public to create custom `LocationEngineProvider`([#850](https://github.com/maplibre/maplibre-native/pull/850)) ## 10.0.2 - February 23, 2023 ### 🐞 Bug fixes -* `MapboxFusedLocationEngineImpl` constructor made public to create custom `LocationEngineProvider`([#850](https://github.com/maplibre/maplibre-native/pull/850)) +- `MapboxFusedLocationEngineImpl` constructor made public to create custom `LocationEngineProvider`([#850](https://github.com/maplibre/maplibre-native/pull/850)) ## 10.0.1 - February 22, 2023 ### 🐞 Bug fixes -* Fixed regression with `RasterSource` native code throwing an exception expecting bound after switching to `FloatArray` ([#830](https://github.com/maplibre/maplibre-native/pull/830)). -* `LocationEngineProxy` was made public so that the migration path suggested in the 10.0.0 changelog for those wanting to use GMS Location Services can actually be implemented ([#832](https://github.com/maplibre/maplibre-native/pull/830)). +- Fixed regression with `RasterSource` native code throwing an exception expecting bound after switching to `FloatArray` ([#830](https://github.com/maplibre/maplibre-native/pull/830)). +- `LocationEngineProxy` was made public so that the migration path suggested in the 10.0.0 changelog for those wanting to use GMS Location Services can actually be implemented ([#832](https://github.com/maplibre/maplibre-native/pull/830)). ## 10.0.0 - February 15, 2023 ### ✨ Features and improvements -* πŸ’₯ Breaking: Changed resourcePrefix to `maplibre_` from `mapbox_` ([#647](https://github.com/maplibre/maplibre-native/pull/647)) and renamed resources accordingly. Note that this is a breaking change since the names of public resources were renamed as well. Replaced Mapbox logo with MapLibre logo. +- πŸ’₯ Breaking: Changed resourcePrefix to `maplibre_` from `mapbox_` ([#647](https://github.com/maplibre/maplibre-native/pull/647)) and renamed resources accordingly. Note that this is a breaking change since the names of public resources were renamed as well. Replaced Mapbox logo with MapLibre logo. > To migrate: > If you use any of the public Android resources, you will get an error that they can not be found. Replace the prefix of each, e.g. `R.style.mapbox_LocationComponent` -> `R.style.maplibre_LocationComponent`. -* πŸ’₯ Breaking: several deprecated overloads of `LocationComponent.activateLocationComponent` were removed. Use `LocationComponentActivationOptions.Builder` instead. +- πŸ’₯ Breaking: several deprecated overloads of `LocationComponent.activateLocationComponent` were removed. Use `LocationComponentActivationOptions.Builder` instead. > To migrate, as an example: + > > ```kotlin > locationComponent.activateLocationComponent(context, style, false, locationEngineRequest, locationComponentOptions) - > ``` + > ``` + > > becomes - > ```kotlin - > val options = LocationComponentActivationOptions.builder(context, style).useDefaultLocationEngine(false).locationEngineRequest(locationEngineRequest).locationComponentOptions(locationComponentOptions).build() - > locationComponent.activateLocationComponent(options) - > ``` + > + > ```kotlin + > val options = LocationComponentActivationOptions.builder(context, style).useDefaultLocationEngine(false).locationEngineRequest(locationEngineRequest).locationComponentOptions(locationComponentOptions).build() + > locationComponent.activateLocationComponent(options) + > ``` -* πŸ’₯ Breaking: the `LocationEngine` implemented with Google Location Services has been removed to make MapLibre Native for Android fully FLOSS ([#379](https://github.com/maplibre/maplibre-native/issues/379)). +- πŸ’₯ Breaking: the `LocationEngine` implemented with Google Location Services has been removed to make MapLibre Native for Android fully FLOSS ([#379](https://github.com/maplibre/maplibre-native/issues/379)). > To migrate: > Include the source code of the removed [`GoogleLocationEngineImpl`](https://github.com/maplibre/maplibre-native/blob/4a34caab7593f4f1b6d8c09c06a5e25d7c6cfc43/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/GoogleLocationEngineImpl.java) in your source tree. - > + > > Pass an instance of `LocationEngine` based on `GoogleLocationEngineImpl` to `LocationComponentActivationOptions.Builder.locationEngine` (this was done in a now removed [`LocationEngineProvider`](https://github.com/maplibre/maplibre-native/blob/68d58d6f6f453d5c6cc0fa92fcc6c6cfe0cf967f/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineProvider.java#L59) class): - > ```kotlin - > val locationEngine = LocationEngineProxy(GoogleLocationEngineImpl(context)) - > val options = LocationComponentActivationOptions.builder(context, style).locationEngine(locationEngine).build() - > locationComponent.activateLocationComponent(options) - > ``` + > + > ```kotlin + > val locationEngine = LocationEngineProxy(GoogleLocationEngineImpl(context)) + > val options = LocationComponentActivationOptions.builder(context, style).locationEngine(locationEngine).build() + > locationComponent.activateLocationComponent(options) + > ``` -* πŸ’₯ Breaking: The static `LocationEngineResult.extractResult` can no longer extract a `LocationEngineResult` from a Google Play intent. +- πŸ’₯ Breaking: The static `LocationEngineResult.extractResult` can no longer extract a `LocationEngineResult` from a Google Play intent. > To migrate, include and use the [previous implementation](https://github.com/maplibre/maplibre-native/blob/ea234edf67bb3aec75f077e15c1c30c99756b926/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineResult.java#L97) in your source tree. - -* Improve Kotlinification of LatLng ([#742](https://github.com/maplibre/maplibre-native/issues)) -* Increment minSdkVersion from 14 to 21, as it covers 99.2%% of the newer devices since 2014 and lessens the backward compatibility burden ([#630](https://github.com/maplibre/maplibre-native/pull/630)) + +- Improve Kotlinification of LatLng ([#742](https://github.com/maplibre/maplibre-native/issues)) +- Increment minSdkVersion from 14 to 21, as it covers 99.2%% of the newer devices since 2014 and lessens the backward compatibility burden ([#630](https://github.com/maplibre/maplibre-native/pull/630)) ### 🐞 Bug fixes -* Catches NaN for onMove event ([621](https://github.com/maplibre/maplibre-native/pull/621)) -* `BitmapUtils.mergeBitmap` was deprecated, `BitmapUtils.mergeBitmaps` is a new method that does not offset views rendered on top of snapshots ([#733](https://github.com/maplibre/maplibre-native/issues/733)) -* Fixed a crash when native code was accessing the LatLngBounds class [#655](https://github.com/maplibre/maplibre-native/pull/) +- Catches NaN for onMove event ([621](https://github.com/maplibre/maplibre-native/pull/621)) +- `BitmapUtils.mergeBitmap` was deprecated, `BitmapUtils.mergeBitmaps` is a new method that does not offset views rendered on top of snapshots ([#733](https://github.com/maplibre/maplibre-native/issues/733)) +- Fixed a crash when native code was accessing the LatLngBounds class [#655](https://github.com/maplibre/maplibre-native/pull/) ### β›΅ Dependencies -* Revert "Revert "Gradle update"" - Update Gradle from v3 to v7 ([#619](https://github.com/maplibre/maplibre-native/pull/619)) +- Revert "Revert "Gradle update"" - Update Gradle from v3 to v7 ([#619](https://github.com/maplibre/maplibre-native/pull/619)) ## 9.6.0 - December 18, 2022 ### ✨ Features and improvements -* Add missing header guards ([#543](https://github.com/maplibre/maplibre-native/pull/543)) -* Removing unused versions sdk ([#515](https://github.com/maplibre/maplibre-native/pull/515)) -* (tag: node-v5.0.1-pre.0) Upgrade libs and remove Jetifier ([#218](https://github.com/maplibre/maplibre-native/pull/218)) -* Migrate examples in android TestApp to Kotlin ([#416](https://github.com/maplibre/maplibre-native/pull/416)) -* Add ClientOptions to be able to pass around client name and version ([#365](https://github.com/maplibre/maplibre-native/pull/365)) -* Use maplibre docs for more links ([#354](https://github.com/maplibre/maplibre-native/pull/354)) -* Use the MapLibre style spec docs website ([#353](https://github.com/maplibre/maplibre-native/pull/353)) -* Refresh iOS & Android build docs ([5f679b55b](https://github.com/maplibre/maplibre-native/commit/5f679b55b)) -* Qt build improvements and documentation ([#277](https://github.com/maplibre/maplibre-native/pull/277)) -* Replace Mapbox with MapLibre in README titles ([#297](https://github.com/maplibre/maplibre-native/pull/297)) -* Rename MaptilerFileSource to MBTilesFileSource ([#198](https://github.com/maplibre/maplibre-native/pull/198)) -* Changed missed MapBox reference to MapLibre ([#253](https://github.com/maplibre/maplibre-native/pull/253)) -* Implement map projection functionality ([#254](https://github.com/maplibre/maplibre-native/pull/254)) -* chore: rename master -> main in CI and scripts ([#246](https://github.com/maplibre/maplibre-native/pull/246)) -* Feature - Bring back node support ([#217](https://github.com/maplibre/maplibre-native/pull/217)) -* Remove obsolete CI configurations ([#219](https://github.com/maplibre/maplibre-native/pull/219)) +- Add missing header guards ([#543](https://github.com/maplibre/maplibre-native/pull/543)) +- Removing unused versions sdk ([#515](https://github.com/maplibre/maplibre-native/pull/515)) +- (tag: node-v5.0.1-pre.0) Upgrade libs and remove Jetifier ([#218](https://github.com/maplibre/maplibre-native/pull/218)) +- Migrate examples in android TestApp to Kotlin ([#416](https://github.com/maplibre/maplibre-native/pull/416)) +- Add ClientOptions to be able to pass around client name and version ([#365](https://github.com/maplibre/maplibre-native/pull/365)) +- Use maplibre docs for more links ([#354](https://github.com/maplibre/maplibre-native/pull/354)) +- Use the MapLibre style spec docs website ([#353](https://github.com/maplibre/maplibre-native/pull/353)) +- Refresh iOS & Android build docs ([5f679b55b](https://github.com/maplibre/maplibre-native/commit/5f679b55b)) +- Qt build improvements and documentation ([#277](https://github.com/maplibre/maplibre-native/pull/277)) +- Replace Mapbox with MapLibre in README titles ([#297](https://github.com/maplibre/maplibre-native/pull/297)) +- Rename MaptilerFileSource to MBTilesFileSource ([#198](https://github.com/maplibre/maplibre-native/pull/198)) +- Changed missed MapBox reference to MapLibre ([#253](https://github.com/maplibre/maplibre-native/pull/253)) +- Implement map projection functionality ([#254](https://github.com/maplibre/maplibre-native/pull/254)) +- chore: rename master -> main in CI and scripts ([#246](https://github.com/maplibre/maplibre-native/pull/246)) +- Feature - Bring back node support ([#217](https://github.com/maplibre/maplibre-native/pull/217)) +- Remove obsolete CI configurations ([#219](https://github.com/maplibre/maplibre-native/pull/219)) ### 🐞 Bug fixes -* Fixes potential NaN when calling `NativeMapView::nativeMoveBy` ([#501](https://github.com/maplibre/maplibre-native/pull/501)) -* Fix android ci workflows ([#476](https://github.com/maplibre/maplibre-native/pull/476)) -* Fix typo in geo.cpp ([#412](https://github.com/maplibre/maplibre-native/pull/412)) -* Fix render tests ([#351](https://github.com/maplibre/maplibre-native/pull/351)) -* fix shiftY calculation typo ([#285](https://github.com/maplibre/maplibre-native/pull/285)) -* [msvc] Fix warnings, mainly casting to smaller types ([#270](https://github.com/maplibre/maplibre-native/pull/270)) -* Fix street label appearance while animating near zoom level threshhold ([#267](https://github.com/maplibre/maplibre-native/pull/267)) +- Fixes potential NaN when calling `NativeMapView::nativeMoveBy` ([#501](https://github.com/maplibre/maplibre-native/pull/501)) +- Fix android ci workflows ([#476](https://github.com/maplibre/maplibre-native/pull/476)) +- Fix typo in geo.cpp ([#412](https://github.com/maplibre/maplibre-native/pull/412)) +- Fix render tests ([#351](https://github.com/maplibre/maplibre-native/pull/351)) +- fix shiftY calculation typo ([#285](https://github.com/maplibre/maplibre-native/pull/285)) +- [msvc] Fix warnings, mainly casting to smaller types ([#270](https://github.com/maplibre/maplibre-native/pull/270)) +- Fix street label appearance while animating near zoom level threshhold ([#267](https://github.com/maplibre/maplibre-native/pull/267)) ### β›΅ Dependencies -* Bump semver from 7.3.7 to 7.3.8 in /platform/android ([#530](https://github.com/maplibre/maplibre-native/pull/530)) -* Bump to JDK 11 in android CI and generate Gradle Wrapper ([#474](https://github.com/maplibre/maplibre-native/pull/474)) -* Bump ejs from 3.1.7 to 3.1.8 in /platform/android ([#470](https://github.com/maplibre/maplibre-native/pull/470)) -* Upgrade Gradle from 3.6.3 to 3.6.4 ([#456](https://github.com/maplibre/maplibre-native/pull/456)) -* Bump semver from 5.7.1 to 7.3.7 in /platform/android ([#461](https://github.com/maplibre/maplibre-native/pull/461)) -* Bump pixelmatch from 4.0.2 to 5.3.0 in /platform/android ([#460](https://github.com/maplibre/maplibre-native/pull/460)) -* Bump esm from 3.1.0 to 3.2.25 in /platform/android ([#463](https://github.com/maplibre/maplibre-native/pull/463)) -* Bump ejs from 2.7.4 to 3.1.7 in /platform/android ([#299](https://github.com/maplibre/maplibre-native/pull/299)) -* Bump lodash from 4.17.19 to 4.17.21 in /platform/android ([#195](https://github.com/maplibre/maplibre-native/pull/195)) - +- Bump semver from 7.3.7 to 7.3.8 in /platform/android ([#530](https://github.com/maplibre/maplibre-native/pull/530)) +- Bump to JDK 11 in android CI and generate Gradle Wrapper ([#474](https://github.com/maplibre/maplibre-native/pull/474)) +- Bump ejs from 3.1.7 to 3.1.8 in /platform/android ([#470](https://github.com/maplibre/maplibre-native/pull/470)) +- Upgrade Gradle from 3.6.3 to 3.6.4 ([#456](https://github.com/maplibre/maplibre-native/pull/456)) +- Bump semver from 5.7.1 to 7.3.7 in /platform/android ([#461](https://github.com/maplibre/maplibre-native/pull/461)) +- Bump pixelmatch from 4.0.2 to 5.3.0 in /platform/android ([#460](https://github.com/maplibre/maplibre-native/pull/460)) +- Bump esm from 3.1.0 to 3.2.25 in /platform/android ([#463](https://github.com/maplibre/maplibre-native/pull/463)) +- Bump ejs from 2.7.4 to 3.1.7 in /platform/android ([#299](https://github.com/maplibre/maplibre-native/pull/299)) +- Bump lodash from 4.17.19 to 4.17.21 in /platform/android ([#195](https://github.com/maplibre/maplibre-native/pull/195)) ## 9.5.2 - December 02, 2021 ### Bug Fixes -* raster layers stopped working in Android [#161](https://github.com/maplibre/maplibre-native/pull/161) -* remove Mapbox's in favor of MapLibre in attribution dialog [#160](https://github.com/maplibre/maplibre-native/pull/160) -* queryRenderedFeatures returns wrong results - issue #184, [#147](https://github.com/maplibre/maplibre-native/pull/174) +- raster layers stopped working in Android [#161](https://github.com/maplibre/maplibre-native/pull/161) +- remove Mapbox's in favor of MapLibre in attribution dialog [#160](https://github.com/maplibre/maplibre-native/pull/160) +- queryRenderedFeatures returns wrong results - issue #184, [#147](https://github.com/maplibre/maplibre-native/pull/174) ## 9.5.1 - September 06, 2021 ### Bug Fixes -* Invalid tile url template for MapLibre style [#107](https://github.com/maplibre/maplibre-native/pull/107) -* Crash when inflating view on Android [#130](https://github.com/maplibre/maplibre-native/pull/130) +- Invalid tile url template for MapLibre style [#107](https://github.com/maplibre/maplibre-native/pull/107) +- Crash when inflating view on Android [#130](https://github.com/maplibre/maplibre-native/pull/130) ### Other -* Fix perf regression in cached tiles of tile pyramid [#129](https://github.com/maplibre/maplibre-native/pull/129) -* Upgrade to newest protozero [#148](https://github.com/maplibre/maplibre-native/pull/148) -* Change NativeMapView.resizeView to use 0 instead of throwing IllegalArgumentException [#151](https://github.com/maplibre/maplibre-native/pull/151) +- Fix perf regression in cached tiles of tile pyramid [#129](https://github.com/maplibre/maplibre-native/pull/129) +- Upgrade to newest protozero [#148](https://github.com/maplibre/maplibre-native/pull/148) +- Change NativeMapView.resizeView to use 0 instead of throwing IllegalArgumentException [#151](https://github.com/maplibre/maplibre-native/pull/151) ## 9.5.0 - June 29, 2021 ### Features -* Replacing hardcoded configuration with configurable API and removing Mapbox assets and dependencies [#90](https://github.com/maplibre/maplibre-native/pull/90) +- Replacing hardcoded configuration with configurable API and removing Mapbox assets and dependencies [#90](https://github.com/maplibre/maplibre-native/pull/90) ### Other -* Migration from bintray [#77](https://github.com/maplibre/maplibre-native/pull/77) +- Migration from bintray [#77](https://github.com/maplibre/maplibre-native/pull/77) ## 9.4.2 - May 6, 2021 @@ -170,503 +191,639 @@ Switching from mapbox-java libraries to [maplibre fork](https://github.com/mapli ### Bug Fixes -* Fixed an issue where symbols flickered when zooming out. [#16](https://github.com/maplibre/maplibre-native/issues/16) -* Fixes crash caused by NullPointerException MapKeyListener [#464](https://github.com/mapbox/mapbox-gl-native-android/issues/464), cherry picked from [#466](https://github.com/mapbox/mapbox-gl-native-android/pull/466) -* Fixed an issue where GPS puck keeps previous value when enabled. [#462]https://github.com/mapbox/mapbox-gl-native-android/issues/462, cherry picked from [#470](https://github.com/mapbox/mapbox-gl-native-android/pull/470) -* Not changing location camera mode while disabled. [#24](https://github.com/maplibre/maplibre-native/issues/24) -* Symbol layer flickering after zooming out. [#16](https://github.com/maplibre/maplibre-native/issues/16) -* Avoid throwing null pointer exception on slow initialization [#22](https://github.com/maplibre/maplibre-native/issues/22) +- Fixed an issue where symbols flickered when zooming out. [#16](https://github.com/maplibre/maplibre-native/issues/16) +- Fixes crash caused by NullPointerException MapKeyListener [#464](https://github.com/mapbox/mapbox-gl-native-android/issues/464), cherry picked from [#466](https://github.com/mapbox/mapbox-gl-native-android/pull/466) +- Fixed an issue where GPS puck keeps previous value when enabled. [#462]https://github.com/mapbox/mapbox-gl-native-android/issues/462, cherry picked from [#470](https://github.com/mapbox/mapbox-gl-native-android/pull/470) +- Not changing location camera mode while disabled. [#24](https://github.com/maplibre/maplibre-native/issues/24) +- Symbol layer flickering after zooming out. [#16](https://github.com/maplibre/maplibre-native/issues/16) +- Avoid throwing null pointer exception on slow initialization [#22](https://github.com/maplibre/maplibre-native/issues/22) ### Other -* mapbox-gl-js submodule has been replaced with maplibre-gl-js -* Removed Telemetry [#7](https://github.com/maplibre/maplibre-native/pull/7) +- mapbox-gl-js submodule has been replaced with maplibre-gl-js +- Removed Telemetry [#7](https://github.com/maplibre/maplibre-native/pull/7) ## 9.3.0 - January 6, 2021 ### Features - - Added the mbtiles file source for rendering vector tiles from file stored locally on the device. + +- Added the mbtiles file source for rendering vector tiles from file stored locally on the device. ## 9.2.1 - May 15, 2020 ### Improvements and bug fixes - - Added compiler and linker options to reduce binary size for release build. ([#382](https://github.com/mapbox/mapbox-gl-native-android/pull/382)) - - Fixed a crash when `Layer.getFilter()` is used with the `distance` expression. ([#380](https://github.com/mapbox/mapbox-gl-native-android/pull/380)) - - Reset AndroidRendererBackend properly to prevent a crash during rotation on an Android 4.2.2 x86 tablet. ([#381](https://github.com/mapbox/mapbox-gl-native-android/pull/381)(h/t [ystsoi](https://github.com/ystsoi)) + +- Added compiler and linker options to reduce binary size for release build. ([#382](https://github.com/mapbox/mapbox-gl-native-android/pull/382)) +- Fixed a crash when `Layer.getFilter()` is used with the `distance` expression. ([#380](https://github.com/mapbox/mapbox-gl-native-android/pull/380)) +- Reset AndroidRendererBackend properly to prevent a crash during rotation on an Android 4.2.2 x86 tablet. ([#381](https://github.com/mapbox/mapbox-gl-native-android/pull/381)(h/t [ystsoi](https://github.com/ystsoi)) ## 9.2.0 - May 7, 2020 + ### Features - - Added the `distance` expression for calculating the shortest distance between an evaluated feature and a given GeoJSON object. ([#339](https://github.com/mapbox/mapbox-gl-native-android/pull/339)) - - The [`SymbolLayer.iconTextFit`](https://docs.mapbox.com/android/api/map-sdk/9.2.0-beta.1/com/mapbox/mapboxsdk/style/layers/PropertyFactory.html#iconTextFit-com.mapbox.mapboxsdk.style.expressions.Expression-) property now respects the stretch metadata of any nine-part stretchable image passed into the `style.addImage` method. You can define the stretchable area of an image by configuring the `stretchX`, `stretchY`, `content` options on `Style.addImage` to append the requisite [metadata](https://github.com/mapbox/mapbox-gl-js/issues/8917). ([#314](https://github.com/mapbox/mapbox-gl-native-android/pull/314)) - - Added methods to set and get the sort key of features in a `CircleLayer` at runtime. Features with a higher sort key will appear above features with a lower sort key. ([#322](https://github.com/mapbox/mapbox-gl-native-android/pull/322)) - - Introduced `Source.setVolatile` to disable ambient caching of tiles from a source. Use this option on transient sources, such as traffic tilesets, if not showing tiles from a source is preferable to showing outdated tiles should an update request fail. ([#355](https://github.com/mapbox/mapbox-gl-native-android/pull/355)) - - Introduced `Source.minimumTileUpdateInterval` to override the expiration time set via HTTP headers with a longer expiration time on the client. ([#355](https://github.com/mapbox/mapbox-gl-native-android/pull/355)) - - Added `Source.maxOverscaleFactor` for defining how much a parent tile can be overscaled during rendering. This setting is only needed if a custom source on your map appears blurry or distorted when viewed at new zoom levels. ([#299](https://github.com/mapbox/mapbox-gl-native-android/pull/299)) + +- Added the `distance` expression for calculating the shortest distance between an evaluated feature and a given GeoJSON object. ([#339](https://github.com/mapbox/mapbox-gl-native-android/pull/339)) +- The [`SymbolLayer.iconTextFit`](https://docs.mapbox.com/android/api/map-sdk/9.2.0-beta.1/com/mapbox/mapboxsdk/style/layers/PropertyFactory.html#iconTextFit-com.mapbox.mapboxsdk.style.expressions.Expression-) property now respects the stretch metadata of any nine-part stretchable image passed into the `style.addImage` method. You can define the stretchable area of an image by configuring the `stretchX`, `stretchY`, `content` options on `Style.addImage` to append the requisite [metadata](https://github.com/mapbox/mapbox-gl-js/issues/8917). ([#314](https://github.com/mapbox/mapbox-gl-native-android/pull/314)) +- Added methods to set and get the sort key of features in a `CircleLayer` at runtime. Features with a higher sort key will appear above features with a lower sort key. ([#322](https://github.com/mapbox/mapbox-gl-native-android/pull/322)) +- Introduced `Source.setVolatile` to disable ambient caching of tiles from a source. Use this option on transient sources, such as traffic tilesets, if not showing tiles from a source is preferable to showing outdated tiles should an update request fail. ([#355](https://github.com/mapbox/mapbox-gl-native-android/pull/355)) +- Introduced `Source.minimumTileUpdateInterval` to override the expiration time set via HTTP headers with a longer expiration time on the client. ([#355](https://github.com/mapbox/mapbox-gl-native-android/pull/355)) +- Added `Source.maxOverscaleFactor` for defining how much a parent tile can be overscaled during rendering. This setting is only needed if a custom source on your map appears blurry or distorted when viewed at new zoom levels. ([#299](https://github.com/mapbox/mapbox-gl-native-android/pull/299)) ### User location indicator + - Introduced an activation option to render the `LocationComponent` with a dedicated OpenGL layer through `LocationComponentActivationOptions#useSpecializedLocationLayer`, instead of the combined symbol and circle layer implementation used by default. ([#319](https://github.com/mapbox/mapbox-gl-native-android/pull/319)) - Introduced an option to add an animated pulsing circle around the `LocationComponent` through `LocationComponentOptions#pulseEnabled` and methods to customize it. ([#172](https://github.com/mapbox/mapbox-gl-native-android/pull/172)) - Introduced an option to set a screen area through `LocationComponentOptions#trackingMultiFingerProtectedMoveArea` where executed gestures will avoid breaking camera tracking when `LocationComponentOptions#trackingGesturesManagement` is enabled. ([#356](https://github.com/mapbox/mapbox-gl-native-android/pull/356)) ### Improvements and bug fixes - - Improved the default compass engine's heading calculation by accounting for device orientation, ensuring accelerometer and magnetic field sensor events are retained, and pushing updates to the heading even if the sensor is unreliable. ([#338](https://github.com/mapbox/mapbox-gl-native-android/pull/338))(h/t [ystsoi](https://github.com/ystsoi)) - - Correctly call the `onFling` listener only when the velocity of a gesture meets the threshold to animate the camera. ([#356](https://github.com/mapbox/mapbox-gl-native-android/pull/356)) - - Enabled adding style images on-demand on `MapSnapshotter`. ([#317](https://github.com/mapbox/mapbox-gl-native-android/pull/317)) - - Fixed a crash when changing the user interface in `MapSnapshotter.ErrorHandler`. ([#347](https://github.com/mapbox/mapbox-gl-native-android/pull/347)) - - Fixed a crash when calling the `Style.removeImage` method with the name of a nonexistent image. ([#16391](https://github.com/mapbox/mapbox-gl-native/pull/16391)) - - Fixed a crash when encountering an invalid polyline. ([#16409](https://github.com/mapbox/mapbox-gl-native/pull/16409)) - - Certain logging statements no longer run on the main thread. ([#16325](https://github.com/mapbox/mapbox-gl-native/pull/16325)) + +- Improved the default compass engine's heading calculation by accounting for device orientation, ensuring accelerometer and magnetic field sensor events are retained, and pushing updates to the heading even if the sensor is unreliable. ([#338](https://github.com/mapbox/mapbox-gl-native-android/pull/338))(h/t [ystsoi](https://github.com/ystsoi)) +- Correctly call the `onFling` listener only when the velocity of a gesture meets the threshold to animate the camera. ([#356](https://github.com/mapbox/mapbox-gl-native-android/pull/356)) +- Enabled adding style images on-demand on `MapSnapshotter`. ([#317](https://github.com/mapbox/mapbox-gl-native-android/pull/317)) +- Fixed a crash when changing the user interface in `MapSnapshotter.ErrorHandler`. ([#347](https://github.com/mapbox/mapbox-gl-native-android/pull/347)) +- Fixed a crash when calling the `Style.removeImage` method with the name of a nonexistent image. ([#16391](https://github.com/mapbox/mapbox-gl-native/pull/16391)) +- Fixed a crash when encountering an invalid polyline. ([#16409](https://github.com/mapbox/mapbox-gl-native/pull/16409)) +- Certain logging statements no longer run on the main thread. ([#16325](https://github.com/mapbox/mapbox-gl-native/pull/16325)) ### Other changes - - Rollback to `System.loadLibrary` to fix SoLoader fails to load the native library on x86 devices. ([#368](https://github.com/mapbox/mapbox-gl-native-android/pull/368)) - - Worked around crashes caused by `JobIntentService` on devices >= API 26 by using a network request to report errors instead. ([#472](https://github.com/mapbox/mapbox-events-android/pull/472) + +- Rollback to `System.loadLibrary` to fix SoLoader fails to load the native library on x86 devices. ([#368](https://github.com/mapbox/mapbox-gl-native-android/pull/368)) +- Worked around crashes caused by `JobIntentService` on devices >= API 26 by using a network request to report errors instead. ([#472](https://github.com/mapbox/mapbox-events-android/pull/472) ## 9.1.0 - April 7, 2020 + ### Features - - Added `within` expression for testing whether an evaluated feature lies within a given GeoJSON object. `within` accepts `Feature`, `FeatureCollection`, `Polygon`, and `MultiPolygon` as valid GeoJSON objects. ([#198](https://github.com/mapbox/mapbox-gl-native-android/pull/198)) - - Added `in` expression for testing whether an item exists in an array or a substring exists in a string. ([#171](https://github.com/mapbox/mapbox-gl-native-android/pull/171)) - - Introduced APIs and callbacks for customizing the style used in a `MapSnapshotter` snapshotter with runtime styling methods. ([#268](https://www.github.com/mapbox/mapbox-gl-native-android/pull/268), [#292](https://www.github.com/mapbox/mapbox-gl-native-android/pull/292)) - - Added methods to set and get the sort key of features in a `FillLayer` and `LineLayer` at runtime. Features with a higher sort key will appear above features with a lower sort key. ([#209](https://github.com/mapbox/mapbox-gl-native-android/pull/209)) - - Introduced `MapboxMap.setMaxPitchPreference` and `MapboxMap.setMinPitchPreference` to constrain a map's pitch. ([#199](https://github.com/mapbox/mapbox-gl-native-android/pull/199)) - - Introduced ability to configure the zoom level(s) that tiles are prefetched from by `Source`. This overrides the tile prefetch setting defined by the `Map` instance. ([#184](https://github.com/mapbox/mapbox-gl-native-android/pull/184)) + +- Added `within` expression for testing whether an evaluated feature lies within a given GeoJSON object. `within` accepts `Feature`, `FeatureCollection`, `Polygon`, and `MultiPolygon` as valid GeoJSON objects. ([#198](https://github.com/mapbox/mapbox-gl-native-android/pull/198)) +- Added `in` expression for testing whether an item exists in an array or a substring exists in a string. ([#171](https://github.com/mapbox/mapbox-gl-native-android/pull/171)) +- Introduced APIs and callbacks for customizing the style used in a `MapSnapshotter` snapshotter with runtime styling methods. ([#268](https://www.github.com/mapbox/mapbox-gl-native-android/pull/268), [#292](https://www.github.com/mapbox/mapbox-gl-native-android/pull/292)) +- Added methods to set and get the sort key of features in a `FillLayer` and `LineLayer` at runtime. Features with a higher sort key will appear above features with a lower sort key. ([#209](https://github.com/mapbox/mapbox-gl-native-android/pull/209)) +- Introduced `MapboxMap.setMaxPitchPreference` and `MapboxMap.setMinPitchPreference` to constrain a map's pitch. ([#199](https://github.com/mapbox/mapbox-gl-native-android/pull/199)) +- Introduced ability to configure the zoom level(s) that tiles are prefetched from by `Source`. This overrides the tile prefetch setting defined by the `Map` instance. ([#184](https://github.com/mapbox/mapbox-gl-native-android/pull/184)) ### Performance improvements - - Increased stability of label placement when the map is tilted. ([#16287](https://github.com/mapbox/mapbox-gl-native/pull/16287)) - - Improved the performance of loading a style that has many style images. ([#16187](https://github.com/mapbox/mapbox-gl-native/pull/16187)) - - Fixed a memory leak during zooming when `MapboxMapOptions.debugActive` is enabled. ([#15179](https://github.com/mapbox/mapbox-gl-native/issues/15179), fixed by [#15395](https://github.com/mapbox/mapbox-gl-native/pull/15395)) + +- Increased stability of label placement when the map is tilted. ([#16287](https://github.com/mapbox/mapbox-gl-native/pull/16287)) +- Improved the performance of loading a style that has many style images. ([#16187](https://github.com/mapbox/mapbox-gl-native/pull/16187)) +- Fixed a memory leak during zooming when `MapboxMapOptions.debugActive` is enabled. ([#15179](https://github.com/mapbox/mapbox-gl-native/issues/15179), fixed by [#15395](https://github.com/mapbox/mapbox-gl-native/pull/15395)) ### Bug fixes - - Downloaded offline packs no longer reduce the storage space available for ambient caching of tiles and other resources. ([#15622](https://github.com/mapbox/mapbox-gl-native/pull/15622)) - - Fixed conversion of a `Map` object into a GeoJSON object. ([#16243](https://github.com/mapbox/mapbox-gl-native/pull/16243)) - - Fixed issues that would cause an offline region to stop downloading before completion. ([#16230](https://github.com/mapbox/mapbox-gl-native/pull/16230), [#16240](https://github.com/mapbox/mapbox-gl-native/pull/16240)) - - Fixed an issue where a `LineDasharray` value of `[1, 0]` resulted in hairline gaps. ([#16202](https://github.com/mapbox/mapbox-gl-native/pull/16202)) - - Fixed Proguard configuration to prevent obfuscation of telemetry event classes. ([#306](https://github.com/mapbox/mapbox-gl-native-android/pull/306)) - - Fixed a crash that might occur during EGL window surface creation. ([#278](https://github.com/mapbox/mapbox-gl-native-android/pull/278)) - - Fixed a bug that would cause local CJK glyphs to be rendered incorrectly when generated on a device with the high-contrast accessibility setting enabled. ([#289](https://github.com/mapbox/mapbox-gl-native-android/pull/289)) + +- Downloaded offline packs no longer reduce the storage space available for ambient caching of tiles and other resources. ([#15622](https://github.com/mapbox/mapbox-gl-native/pull/15622)) +- Fixed conversion of a `Map` object into a GeoJSON object. ([#16243](https://github.com/mapbox/mapbox-gl-native/pull/16243)) +- Fixed issues that would cause an offline region to stop downloading before completion. ([#16230](https://github.com/mapbox/mapbox-gl-native/pull/16230), [#16240](https://github.com/mapbox/mapbox-gl-native/pull/16240)) +- Fixed an issue where a `LineDasharray` value of `[1, 0]` resulted in hairline gaps. ([#16202](https://github.com/mapbox/mapbox-gl-native/pull/16202)) +- Fixed Proguard configuration to prevent obfuscation of telemetry event classes. ([#306](https://github.com/mapbox/mapbox-gl-native-android/pull/306)) +- Fixed a crash that might occur during EGL window surface creation. ([#278](https://github.com/mapbox/mapbox-gl-native-android/pull/278)) +- Fixed a bug that would cause local CJK glyphs to be rendered incorrectly when generated on a device with the high-contrast accessibility setting enabled. ([#289](https://github.com/mapbox/mapbox-gl-native-android/pull/289)) ### Other changes - - Updated mapbox-events-android to v5.0.0. ([#294](https://github.com/mapbox/mapbox-gl-native-android/pull/294)) + +- Updated mapbox-events-android to v5.0.0. ([#294](https://github.com/mapbox/mapbox-gl-native-android/pull/294)) ## 9.0.1 - March 11, 2020 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v9.0.0...android-v9.0.1) since [Mapbox Maps SDK for Android v9.0.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.0.0): + ### Bug fixes - - Fix Proguard configuration to prevent obfuscation of telemetry event classes. [#195](https://github.com/mapbox/mapbox-gl-native-android/pull/195) + +- Fix Proguard configuration to prevent obfuscation of telemetry event classes. [#195](https://github.com/mapbox/mapbox-gl-native-android/pull/195) ## 8.6.3 - March 5, 2020 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.6.2...android-v8.6.3) since [Mapbox Maps SDK for Android v8.6.2](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.6.2): + ### Bug fixes - - Fix Proguard configuration to prevent obfuscation of telemetry event classes. [#195](https://github.com/mapbox/mapbox-gl-native-android/pull/195) + +- Fix Proguard configuration to prevent obfuscation of telemetry event classes. [#195](https://github.com/mapbox/mapbox-gl-native-android/pull/195) ## 9.0.0 - February 13, 2020 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v9.0.0-beta.1...android-v9.0.0) since [Mapbox Maps SDK for Android v9.0.0-beta.1](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.0.0-beta.1): + ### Features - - Introduce lazy loading of view components on MapView [#141](https://github.com/mapbox/mapbox-gl-native-android/pull/141) - - Update Mapbox dependencies to AndroidX [#144](https://github.com/mapbox/mapbox-gl-native-android/pull/144) [#155](https://github.com/mapbox/mapbox-gl-native-android/pull/155) + +- Introduce lazy loading of view components on MapView [#141](https://github.com/mapbox/mapbox-gl-native-android/pull/141) +- Update Mapbox dependencies to AndroidX [#144](https://github.com/mapbox/mapbox-gl-native-android/pull/144) [#155](https://github.com/mapbox/mapbox-gl-native-android/pull/155) ### Bug fixes - - Fixed a bug that would cause `symbol-sort-key` not equally sort icon and text [#16023](https://github.com/mapbox/mapbox-gl-native/pull/16023) - - Revert a commit that appended sku token to offline download requests [#173](https://github.com/mapbox/mapbox-gl-native-android/pull/173) + +- Fixed a bug that would cause `symbol-sort-key` not equally sort icon and text [#16023](https://github.com/mapbox/mapbox-gl-native/pull/16023) +- Revert a commit that appended sku token to offline download requests [#173](https://github.com/mapbox/mapbox-gl-native-android/pull/173) ## 9.0.0-beta.1 - January 24, 2020 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v9.0.0-alpha.1...android-v9.0.0-beta.1) since [Mapbox Maps SDK for Android v9.0.0-alpha.1](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.0.0-alpha.1): + ### Features - - Introduce a gesture setting to disable horizontal scrolling [#156](https://github.com/mapbox/mapbox-gl-native-android/pull/156) - - Introduce pixel ratio as public API on MapView [#146](https://github.com/mapbox/mapbox-gl-native-android/pull/146) - - Introduce getVisibleCoordinateBounds method that allows for object reuse [#109](https://github.com/mapbox/mapbox-gl-native-android/pull/109) - - Update Mapbox dependencies to AndroidX [#136](https://github.com/mapbox/mapbox-gl-native-android/pull/136) + +- Introduce a gesture setting to disable horizontal scrolling [#156](https://github.com/mapbox/mapbox-gl-native-android/pull/156) +- Introduce pixel ratio as public API on MapView [#146](https://github.com/mapbox/mapbox-gl-native-android/pull/146) +- Introduce getVisibleCoordinateBounds method that allows for object reuse [#109](https://github.com/mapbox/mapbox-gl-native-android/pull/109) +- Update Mapbox dependencies to AndroidX [#136](https://github.com/mapbox/mapbox-gl-native-android/pull/136) ## 8.6.2 - January 22, 2020 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.6.1...android-v8.6.2) since [Mapbox Maps SDK for Android v8.6.1](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.6.1): + ### Bug fixes - - Append sku token to offline download requests [#148](https://github.com/mapbox/mapbox-gl-native-android/pull/148) - - Write user id synchronously to avoid null entries as part of the URL [#145](https://github.com/mapbox/mapbox-gl-native-android/pull/145) + +- Append sku token to offline download requests [#148](https://github.com/mapbox/mapbox-gl-native-android/pull/148) +- Write user id synchronously to avoid null entries as part of the URL [#145](https://github.com/mapbox/mapbox-gl-native-android/pull/145) ## 8.6.1 - January 9, 2020 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.6.0...android-v8.6.1) since [Mapbox Maps SDK for Android v8.6.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.6.0): + ### Bug fixes - - Fixed native crash when using a GeoJsonSource when destructing the underlying GeoJSONVTData [#16106](https://github.com/mapbox/mapbox-gl-native/pull/16106). + +- Fixed native crash when using a GeoJsonSource when destructing the underlying GeoJSONVTData [#16106](https://github.com/mapbox/mapbox-gl-native/pull/16106). ## 9.0.0-alpha.1 - January 8, 2020 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.6.0...android-v9.0.0-alpha.1) since [Mapbox Maps SDK for Android v8.6.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.6.0): + ### Features - - Update codebase to androidX. [#129](https://github.com/mapbox/mapbox-gl-native-android/pull/129) + +- Update codebase to androidX. [#129](https://github.com/mapbox/mapbox-gl-native-android/pull/129) ### Bug fixes - - Deprecated `MapboxMap#cycleDebugOptions` and fixed an `UnsatisfiedLinkError` when accessed. [#104](https://github.com/mapbox/mapbox-gl-native-android/pull/104) - - Fixed a null pointer issue on the public static getters of `Mapbox.java`, in case the user hasn't called `Mapbox.getInstance()`. [#128](https://github.com/mapbox/mapbox-gl-native-android/pull/128) + +- Deprecated `MapboxMap#cycleDebugOptions` and fixed an `UnsatisfiedLinkError` when accessed. [#104](https://github.com/mapbox/mapbox-gl-native-android/pull/104) +- Fixed a null pointer issue on the public static getters of `Mapbox.java`, in case the user hasn't called `Mapbox.getInstance()`. [#128](https://github.com/mapbox/mapbox-gl-native-android/pull/128) ## 8.6.0 - December 20, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.6.0-beta.1...android-v8.6.0) since [Mapbox Maps SDK for Android v8.6.0-beta.1](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.6.0-beta.1): + ### Bug fixes - - Revert of a commit that resulted in a native crash when cycle debug options was invoked, issue was only impacting v8.6.0-beta.1 [#16074](https://github.com/mapbox/mapbox-gl-native/pull/16074) - - Fixed a crash caused by an unintentional minification of the `LocalGlyphRasterizer`. The full class definition is now kept when minification is used by end developer [#102](https://github.com/mapbox/mapbox-gl-native-android/pull/102) - - Fixed intermittent offline download failures by clearing the batch buffer if a download is interrupted. [#16074](https://github.com/mapbox/mapbox-gl-native/pull/16074) - - Fixed error for excessively overscaled lines [#16045](https://github.com/mapbox/mapbox-gl-native/pull/16045) - - Fixed signed to unsigned implicit conversion errors in symbol placement. [#16008](https://github.com/mapbox/mapbox-gl-native/pull/16008) - - Fixed error that would result when 0.0 was passed into `text-size` [#16080](https://github.com/mapbox/mapbox-gl-native/pull/16080) + +- Revert of a commit that resulted in a native crash when cycle debug options was invoked, issue was only impacting v8.6.0-beta.1 [#16074](https://github.com/mapbox/mapbox-gl-native/pull/16074) +- Fixed a crash caused by an unintentional minification of the `LocalGlyphRasterizer`. The full class definition is now kept when minification is used by end developer [#102](https://github.com/mapbox/mapbox-gl-native-android/pull/102) +- Fixed intermittent offline download failures by clearing the batch buffer if a download is interrupted. [#16074](https://github.com/mapbox/mapbox-gl-native/pull/16074) +- Fixed error for excessively overscaled lines [#16045](https://github.com/mapbox/mapbox-gl-native/pull/16045) +- Fixed signed to unsigned implicit conversion errors in symbol placement. [#16008](https://github.com/mapbox/mapbox-gl-native/pull/16008) +- Fixed error that would result when 0.0 was passed into `text-size` [#16080](https://github.com/mapbox/mapbox-gl-native/pull/16080) ## 8.6.0-beta.1 - December 6, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.6.0-alpha.2...android-v8.6.0-beta.1) since [Mapbox Maps SDK for Android v8.6.0-alpha.2](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.6.0-alpha.2): + ### Features - - Introduce OfflineManager.runPackDatabaseAutomatically(boolean) and remove the redundant OfflineRegion.deleteAndSkipPackDatabase() method [#78](https://github.com/mapbox/mapbox-gl-native-android/pull/78) - - Expose getter for the view used for rendering OpenGL content on [#87](https://github.com/mapbox/mapbox-gl-native-android/pull/87) - - Bulk conversion of geographic coordinates to screen coordinate using reusable double arrays. [#91](https://github.com/mapbox/mapbox-gl-native-android/pull/91) + +- Introduce OfflineManager.runPackDatabaseAutomatically(boolean) and remove the redundant OfflineRegion.deleteAndSkipPackDatabase() method [#78](https://github.com/mapbox/mapbox-gl-native-android/pull/78) +- Expose getter for the view used for rendering OpenGL content on [#87](https://github.com/mapbox/mapbox-gl-native-android/pull/87) +- Bulk conversion of geographic coordinates to screen coordinate using reusable double arrays. [#91](https://github.com/mapbox/mapbox-gl-native-android/pull/91) ### Performance improvements - - Make network requests for expired resources lower priority than requests for new resources. ([#15950](https://github.com/mapbox/mapbox-gl-native/pull/15950)) + +- Make network requests for expired resources lower priority than requests for new resources. ([#15950](https://github.com/mapbox/mapbox-gl-native/pull/15950)) ### Bug fixes - - Fixed a runtime crash of Proguard optimized builds on < API 21 devices by including the missing SoLoader flag. [#71](https://github.com/mapbox/mapbox-gl-native-android/pull/71) - - Fixed a bug where location camera mode transition callback would not get notified if the requested mode was already set. [#80](https://github.com/mapbox/mapbox-gl-native-android/pull/80) - - Fixed a bug where location tilt/zoom while tracking callback would not get notified if the request was ignored. [#83](https://github.com/mapbox/mapbox-gl-native-android/pull/83) - - Use -Oz to reduce binary size [#15984](https://github.com/mapbox/mapbox-gl-native/pull/15984) - - Use icf=all compile flag to reduce binary size [#15987](https://github.com/mapbox/mapbox-gl-native/pull/15987) + +- Fixed a runtime crash of Proguard optimized builds on < API 21 devices by including the missing SoLoader flag. [#71](https://github.com/mapbox/mapbox-gl-native-android/pull/71) +- Fixed a bug where location camera mode transition callback would not get notified if the requested mode was already set. [#80](https://github.com/mapbox/mapbox-gl-native-android/pull/80) +- Fixed a bug where location tilt/zoom while tracking callback would not get notified if the request was ignored. [#83](https://github.com/mapbox/mapbox-gl-native-android/pull/83) +- Use -Oz to reduce binary size [#15984](https://github.com/mapbox/mapbox-gl-native/pull/15984) +- Use icf=all compile flag to reduce binary size [#15987](https://github.com/mapbox/mapbox-gl-native/pull/15987) ## 8.6.0-alpha.2 - November 22, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.6.0-alpha.1...android-v8.6.0-alpha.2) since [Mapbox Maps SDK for Android v8.6.0-alpha.1](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.6.0-alpha.1): ### Bug fixes - - Synchronise LibaryLoader#loadLibrary to avoid race conditions resulting in UnsatisfiedLinkError [#58](https://github.com/mapbox/mapbox-gl-native-android/pull/58) + +- Synchronise LibaryLoader#loadLibrary to avoid race conditions resulting in UnsatisfiedLinkError [#58](https://github.com/mapbox/mapbox-gl-native-android/pull/58) ## 8.5.2 - December 10, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.5.1...android-v8.5.2) since [Mapbox Maps SDK for Android v8.5.1](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.5.1): ### Features + - Enabling decoupling vacuum operation from other operations run on the offline database file (delete offline region, clear ambient cache) [#99](https://github.com/mapbox/mapbox-gl-native-android/pull/99) ## 8.5.1 - November 20, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.5.0...android-v8.5.1) since [Mapbox Maps SDK for Android v8.5.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.5.0): + ### Bugs + - Fixed Geo JSON source flickering on style transition [#15907](https://github.com/mapbox/mapbox-gl-native/pull/15907) - Fixed flickering caused by unnecessary removing and re-adding of the render sources when the order of their corresponding style objects was changed in the updated style [#15941](https://github.com/mapbox/mapbox-gl-native/pull/15941) ## 8.6.0-alpha.1 - November 14, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.5.0...android-v8.6.0-alpha.1) since [Mapbox Maps SDK for Android v8.5.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.5.0): + ### Features + - Added support for [image expression](https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-types-image) in core library. Runtime APIs for image expression will be implemented separately. [#15877](https://github.com/mapbox/mapbox-gl-native/pull/15877) - Introduce `OfflineManager#packDatabase` and `OfflineRegion#deleteAndSkipPackDatabase` API in order to decouple offline storage vacuum and delete region operations and thus to gain performance benefits e.g. when several regions should be deleted in a row [#15899](https://github.com/mapbox/mapbox-gl-native/pull/15899) ### Bugs + - Fixed Geo JSON source flickering on style transition [#15907](https://github.com/mapbox/mapbox-gl-native/pull/15907) ### Performance improvements + - Convert GeoJSON features to tiles for the loaded source description in a background thread and thus unblock the UI thread [#15885](https://github.com/mapbox/mapbox-gl-native/pull/15885) ## 8.5.0 - November 8, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.5.0-beta.1...android-v8.5.0) since [Mapbox Maps SDK for Android v8.5.0-beta.1](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.5.0-beta.1): + ### Bug fixes - - Fixed the rendering bug caused by redundant pending requests for already requested images [#15864](https://github.com/mapbox/mapbox-gl-native/pull/15864) - - Use individual textures for line dash patterns [#15862](https://github.com/mapbox/mapbox-gl-native/pull/15862) + +- Fixed the rendering bug caused by redundant pending requests for already requested images [#15864](https://github.com/mapbox/mapbox-gl-native/pull/15864) +- Use individual textures for line dash patterns [#15862](https://github.com/mapbox/mapbox-gl-native/pull/15862) ## 8.5.0-beta.1 - November 1, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.5.0-alpha.4...android-v8.5.0-beta.1) since [Mapbox Maps SDK for Android v8.5.0-alpha.4](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.5.0-alpha.4): ## 8.5.0-alpha.4 - October 24, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v8.5.0-alpha.3...android-v8.5.0-alpha.4) since [Mapbox Maps SDK for Android v8.5.0-alpha.3](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v8.5.0-alpha.3): + ### Bug fixes - - Add isLayerReady check in LocationComponent before updating compass listener. [#19](https://github.com/mapbox/mapbox-gl-native-android/pull/19) - - Update soLoader to version 0.8.0. [#23](https://github.com/mapbox/mapbox-gl-native-android/pull/23) - - Enable incremental vacuum for Offline DB [#15837](https://github.com/mapbox/mapbox-gl-native/pull/15837) - - Revert coalescing requests to the client for missing images [#15852](https://github.com/mapbox/mapbox-gl-native/pull/15852) - - Avoid edges for labels that use text-variable-anchors [#15854](https://github.com/mapbox/mapbox-gl-native/pull/15854) + +- Add isLayerReady check in LocationComponent before updating compass listener. [#19](https://github.com/mapbox/mapbox-gl-native-android/pull/19) +- Update soLoader to version 0.8.0. [#23](https://github.com/mapbox/mapbox-gl-native-android/pull/23) +- Enable incremental vacuum for Offline DB [#15837](https://github.com/mapbox/mapbox-gl-native/pull/15837) +- Revert coalescing requests to the client for missing images [#15852](https://github.com/mapbox/mapbox-gl-native/pull/15852) +- Avoid edges for labels that use text-variable-anchors [#15854](https://github.com/mapbox/mapbox-gl-native/pull/15854) ## 8.5.0-alpha.3 - October 18, 2019 ### Bug fixes - - Fix runtime exceptions that occurred when a manually built camera object without padding was serialized [#15788](https://github.com/mapbox/mapbox-gl-native/pull/15788) - - Fix icon-text-fit to take in account the additional 1px texture padding when scaling [#15634](https://github.com/mapbox/mapbox-gl-native/pull/15634) - - Fix occasional crashes during downloading thousands of offline region tiles [#15818](https://github.com/mapbox/mapbox-gl-native/pull/15818) + +- Fix runtime exceptions that occurred when a manually built camera object without padding was serialized [#15788](https://github.com/mapbox/mapbox-gl-native/pull/15788) +- Fix icon-text-fit to take in account the additional 1px texture padding when scaling [#15634](https://github.com/mapbox/mapbox-gl-native/pull/15634) +- Fix occasional crashes during downloading thousands of offline region tiles [#15818](https://github.com/mapbox/mapbox-gl-native/pull/15818) ### Project - - Moved project location from `mapbox-gl-native` to `mapbox-gl-native-android` + +- Moved project location from `mapbox-gl-native` to `mapbox-gl-native-android` ## 8.5.0-alpha.2 - October 10, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.5.0-alpha.1...android-v8.5.0-alpha.2) since [Mapbox Maps SDK for Android v8.5.0-alpha.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.5.0-alpha.1): ### Features - - Expose pre-fetching zoom delta, allows to granular control the delta on which we prefetch tiles [#15769](https://github.com/mapbox/mapbox-gl-native/pull/15769) + +- Expose pre-fetching zoom delta, allows to granular control the delta on which we prefetch tiles [#15769](https://github.com/mapbox/mapbox-gl-native/pull/15769) ### Performance improvements - - Improved rendering performance for the styles with multiple sources [#15756](https://github.com/mapbox/mapbox-gl-native/pull/15756) + +- Improved rendering performance for the styles with multiple sources [#15756](https://github.com/mapbox/mapbox-gl-native/pull/15756) ### Bug fixes - - Fixed runtime exceptions that occurred when a manually built camera object without padding was serialized. [#15788](https://github.com/mapbox/mapbox-gl-native/pull/15788) - - Keep Mapbox when obfuscating code with proguard [#15762](https://github.com/mapbox/mapbox-gl-native/pull/15762) + +- Fixed runtime exceptions that occurred when a manually built camera object without padding was serialized. [#15788](https://github.com/mapbox/mapbox-gl-native/pull/15788) +- Keep Mapbox when obfuscating code with proguard [#15762](https://github.com/mapbox/mapbox-gl-native/pull/15762) ## 8.5.0-alpha.1 - October 3, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.4.0...android-v8.5.0-alpha.1) since [Mapbox Maps SDK for Android v8.4.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.4.0): + ### Bug fixes - - Suppress network requests for expired tiles update, if these tiles are invisible. [#15741](https://github.com/mapbox/mapbox-gl-native/pull/15741) - - Fixed opacity interpolation for composition expressions [#15738](https://github.com/mapbox/mapbox-gl-native/pull/15738) - - Fixed an issue where `Projection#getMetersPerPixelAtLatitude` returned a value incorrectly divided by the pixel ratio. This also fixes an issue where `LocationComponent` accuracy circle's radius was artificially increased. [#15742](https://github.com/mapbox/mapbox-gl-native/pull/15742) - - Coalesce requests to the client for the same missing image [#15778](https://github.com/mapbox/mapbox-gl-native/pull/15778) + +- Suppress network requests for expired tiles update, if these tiles are invisible. [#15741](https://github.com/mapbox/mapbox-gl-native/pull/15741) +- Fixed opacity interpolation for composition expressions [#15738](https://github.com/mapbox/mapbox-gl-native/pull/15738) +- Fixed an issue where `Projection#getMetersPerPixelAtLatitude` returned a value incorrectly divided by the pixel ratio. This also fixes an issue where `LocationComponent` accuracy circle's radius was artificially increased. [#15742](https://github.com/mapbox/mapbox-gl-native/pull/15742) +- Coalesce requests to the client for the same missing image [#15778](https://github.com/mapbox/mapbox-gl-native/pull/15778) ## 8.4.0 - September 25, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.4.0-beta.1...android-v8.4.0) since [Mapbox Maps SDK for Android v8.4.0-beta.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.4.0-beta.1): ### Bug fixes - - Fixing a crash when `CameraPosition` padding is set when using `MapSnapshotter`. [#15699](https://github.com/mapbox/mapbox-gl-native/pull/15699) + +- Fixing a crash when `CameraPosition` padding is set when using `MapSnapshotter`. [#15699](https://github.com/mapbox/mapbox-gl-native/pull/15699) ### Other Changes - - Bumped Java SDK dependency to stable 4.9.0 [#15700](https://github.com/mapbox/mapbox-gl-native/pull/15700) - - Migrate map feedback to GL JS–powered feedback form [#15623](https://github.com/mapbox/mapbox-gl-native/pull/15623) + +- Bumped Java SDK dependency to stable 4.9.0 [#15700](https://github.com/mapbox/mapbox-gl-native/pull/15700) +- Migrate map feedback to GL JS–powered feedback form [#15623](https://github.com/mapbox/mapbox-gl-native/pull/15623) ## 8.4.0-beta.1 - September 19, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.4.0-alpha.2...android-v8.4.0-beta.1) since [Mapbox Maps SDK for Android v8.4.0-alpha.2](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.4.0-alpha.2): ### Bug fixes - - Fixed an issue that `maxzoom` in style `Sources` option was ignored when URL resource is provided. It may cause problems such as extra tiles downloading at higher zoom level than `maxzoom`, or problems that wrong setting of `overscaledZ` in `OverscaledTileID` that will be passed to `SymbolLayout`, leading wrong rendering appearance. [#15581](https://github.com/mapbox/mapbox-gl-native/pull/15581) - - Fixed constant repainting for the sources with invisible layers, caused by `RenderSource::hasFadingTiles()` returning `true` all the time. [#15600](https://github.com/mapbox/mapbox-gl-native/pull/15600) - - Fixed an issue that caused the state of CompassView not up to date when `UiSettings.setCompassEnabled()` is set to true. [#15606](https://github.com/mapbox/mapbox-gl-native/pull/15606) - - Ignore location tracking mode based animations when the camera is transitioning. [#15641](https://github.com/mapbox/mapbox-gl-native/pull/15641) - - Fixed MapSnapshotter so that `MapSnapshotter.withApiBaseUri` works again. [#15642](https://github.com/mapbox/mapbox-gl-native/pull/15642) - - Fixed an assertion hit caused by possibility of adding a layer to an incompatible source. [#15644](https://github.com/mapbox/mapbox-gl-native/pull/15644) + +- Fixed an issue that `maxzoom` in style `Sources` option was ignored when URL resource is provided. It may cause problems such as extra tiles downloading at higher zoom level than `maxzoom`, or problems that wrong setting of `overscaledZ` in `OverscaledTileID` that will be passed to `SymbolLayout`, leading wrong rendering appearance. [#15581](https://github.com/mapbox/mapbox-gl-native/pull/15581) +- Fixed constant repainting for the sources with invisible layers, caused by `RenderSource::hasFadingTiles()` returning `true` all the time. [#15600](https://github.com/mapbox/mapbox-gl-native/pull/15600) +- Fixed an issue that caused the state of CompassView not up to date when `UiSettings.setCompassEnabled()` is set to true. [#15606](https://github.com/mapbox/mapbox-gl-native/pull/15606) +- Ignore location tracking mode based animations when the camera is transitioning. [#15641](https://github.com/mapbox/mapbox-gl-native/pull/15641) +- Fixed MapSnapshotter so that `MapSnapshotter.withApiBaseUri` works again. [#15642](https://github.com/mapbox/mapbox-gl-native/pull/15642) +- Fixed an assertion hit caused by possibility of adding a layer to an incompatible source. [#15644](https://github.com/mapbox/mapbox-gl-native/pull/15644) ## 8.3.2 - September 19, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.1...android-v8.3.2) since [Mapbox Maps SDK for Android v8.3.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.1): ### Bug fixes - - Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`, which caused issues such as `queryRenderedFeatures` and `querySourceFeatures` returning incorrect coordinates at zoom levels 20 and higher. [#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560) + +- Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`, which caused issues such as `queryRenderedFeatures` and `querySourceFeatures` returning incorrect coordinates at zoom levels 20 and higher. [#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560) ## 8.3.1 - September 18, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0...android-v8.3.1) since [Mapbox Maps SDK for Android v8.3.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0): ### Bug fixes - - Updated earcut.hpp submodule file [#15660](https://github.com/mapbox/mapbox-gl-native/pull/15660) - - Fixed a wrong variable assignment of `MapSnapshotter.Options.withApiBaseUri`. [#15642](https://github.com/mapbox/mapbox-gl-native/pull/15642) + +- Updated earcut.hpp submodule file [#15660](https://github.com/mapbox/mapbox-gl-native/pull/15660) +- Fixed a wrong variable assignment of `MapSnapshotter.Options.withApiBaseUri`. [#15642](https://github.com/mapbox/mapbox-gl-native/pull/15642) ## 8.4.0-alpha.2 - September 11, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.4.0-alpha.1...android-v8.4.0-alpha.2) since [Mapbox Maps SDK for Android v8.4.0-alpha.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.4.0-alpha.1): ### Performance improvements - - Newly loaded labels appear faster on the screen. [#15308](https://github.com/mapbox/mapbox-gl-native/pull/15308) + +- Newly loaded labels appear faster on the screen. [#15308](https://github.com/mapbox/mapbox-gl-native/pull/15308) ### Bug fixes - - Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`, which caused issues such as `queryRenderedFeatures` and `querySourceFeatures` returning incorrect coordinates at zoom levels 20 and higher. [#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560) + +- Fixed an issue of integer overflow when converting `tileCoordinates` to `LatLon`, which caused issues such as `queryRenderedFeatures` and `querySourceFeatures` returning incorrect coordinates at zoom levels 20 and higher. [#15560](https://github.com/mapbox/mapbox-gl-native/pull/15560) ### Other Changes - - Bumped Java SDK dependency to 4.9.0-alpha.1 [#15570](https://github.com/mapbox/mapbox-gl-native/pull/15570) + +- Bumped Java SDK dependency to 4.9.0-alpha.1 [#15570](https://github.com/mapbox/mapbox-gl-native/pull/15570) ## 8.4.0-alpha.1 - September 4, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0...android-v8.4.0-alpha.1) since [Mapbox Maps SDK for Android v8.3.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0): ### Features - - Introduce `clusterProperties` option for aggregated cluster properties. [#15425](https://github.com/mapbox/mapbox-gl-native/pull/15425) - - Expose the `CameraPosition#padding` field and associated utility camera position builders. This gives a choice to set a persisting map padding immediately during a transition instead of setting it lazily `MapboxMap#setPadding`, which required scheduling additional transition to be applied. This also deprecates `MapboxMap#setPadding` as there should be no need for a lazy padding setter. [#15444](https://github.com/mapbox/mapbox-gl-native/pull/15444) - - Add number-format expression that allows to format a number to a string, with configurations as minimal/maximal fraction and locale/currency. [#15424](https://github.com/mapbox/mapbox-gl-native/pull/15424) - - Enable using of `text-offset` option together with `text-variable-anchor` (if `text-radial-offset` option is not provided). If used with `text-variable-anchor`, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position. [#15542](https://github.com/mapbox/mapbox-gl-native/pull/15542) + +- Introduce `clusterProperties` option for aggregated cluster properties. [#15425](https://github.com/mapbox/mapbox-gl-native/pull/15425) +- Expose the `CameraPosition#padding` field and associated utility camera position builders. This gives a choice to set a persisting map padding immediately during a transition instead of setting it lazily `MapboxMap#setPadding`, which required scheduling additional transition to be applied. This also deprecates `MapboxMap#setPadding` as there should be no need for a lazy padding setter. [#15444](https://github.com/mapbox/mapbox-gl-native/pull/15444) +- Add number-format expression that allows to format a number to a string, with configurations as minimal/maximal fraction and locale/currency. [#15424](https://github.com/mapbox/mapbox-gl-native/pull/15424) +- Enable using of `text-offset` option together with `text-variable-anchor` (if `text-radial-offset` option is not provided). If used with `text-variable-anchor`, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position. [#15542](https://github.com/mapbox/mapbox-gl-native/pull/15542) ### Bug fixes + - Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. [#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467) - Fixed unnecessary layers blink when the same components are re-added after the style reload [#15513](https://github.com/mapbox/mapbox-gl-native/pull/15513) - Fixed an issue in JNI marshaling code that converted a float to long that produced invalid expressions [#15557](https://github.com/mapbox/mapbox-gl-native/pull/15557) - Call callback onFinish() immediately when trying to move camera to current position [#15558](https://github.com/mapbox/mapbox-gl-native/pull/15558) ### Performance improvements - - Mark used offline region resources in batches. [#15521](https://github.com/mapbox/mapbox-gl-native/pull/15521) + +- Mark used offline region resources in batches. [#15521](https://github.com/mapbox/mapbox-gl-native/pull/15521) ### Other Changes + - JNI binding refactor [#15462](https://github.com/mapbox/mapbox-gl-native/pull/15462) - Javadoc changes to clarify OfflineManager methods [#15519](https://github.com/mapbox/mapbox-gl-native/pull/15519) ## 8.3.0 - August 28, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0-beta.1...android-v8.3.0) since [Mapbox Maps SDK for Android v8.3.0-beta.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0-beta.1): This release changes how offline tile requests are billed β€” they are now billed on a pay-as-you-go basis and all developers are able raise the offline tile limit for their users. Offline requests were previously exempt from monthly active user (MAU) billing and increasing the offline per-user tile limit to more than 6,000 tiles required the purchase of an enterprise license. By upgrading to this release, you are opting into the changes outlined in [this blog post](https://blog.mapbox.com/offline-maps-for-all-bb0fc51827be) and [#15380](https://github.com/mapbox/mapbox-gl-native/pull/15380). ### Features - - Allow ability to pass a string array resource into `localIdeographFontFamily` for enabling/disabling the feature and specifying fallback fonts. [#15488](https://github.com/mapbox/mapbox-gl-native/pull/15488) + +- Allow ability to pass a string array resource into `localIdeographFontFamily` for enabling/disabling the feature and specifying fallback fonts. [#15488](https://github.com/mapbox/mapbox-gl-native/pull/15488) ### Bug fixes - - Fixed a rendering issue caused by all icons being treated as SDFs if an SDF and non-SDF icon were in the same layer. [#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456) - - Fixed an issue where changing location's render mode when the`LocationComponent` is disable wouldn't invalidate the foreground icon when it's back enabled. [#15507](https://github.com/mapbox/mapbox-gl-native/pull/15507) + +- Fixed a rendering issue caused by all icons being treated as SDFs if an SDF and non-SDF icon were in the same layer. [#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456) +- Fixed an issue where changing location's render mode when the`LocationComponent` is disable wouldn't invalidate the foreground icon when it's back enabled. [#15507](https://github.com/mapbox/mapbox-gl-native/pull/15507) ## 8.2.2 - August 23, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.2.1...android-v8.2.2) since [Mapbox Maps SDK for Android v8.2.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.1): ### Bug fixes - - Fixed a possible crash that could be caused by invoking the wrong layer implementation casting function. [#15398](https://github.com/mapbox/mapbox-gl-native/pull/15398) - - Fixed use of objects after moving, potentially causing crashes. [#15408](https://github.com/mapbox/mapbox-gl-native/pull/1540) - - Fixed a wrong calculation of visibility in high pitch scenarios which might've led to tiles in the viewport not being rendered. [#15461](https://github.com/mapbox/mapbox-gl-native/pull/15461) + +- Fixed a possible crash that could be caused by invoking the wrong layer implementation casting function. [#15398](https://github.com/mapbox/mapbox-gl-native/pull/15398) +- Fixed use of objects after moving, potentially causing crashes. [#15408](https://github.com/mapbox/mapbox-gl-native/pull/1540) +- Fixed a wrong calculation of visibility in high pitch scenarios which might've led to tiles in the viewport not being rendered. [#15461](https://github.com/mapbox/mapbox-gl-native/pull/15461) ### Other Changes - - Do not invalidate the camera immediately when map padding is set. Reverts a change introduced in the `v8.2.0`. [#15437](https://github.com/mapbox/mapbox-gl-native/pull/15437) + +- Do not invalidate the camera immediately when map padding is set. Reverts a change introduced in the `v8.2.0`. [#15437](https://github.com/mapbox/mapbox-gl-native/pull/15437) ## 8.3.0-beta.1 - August 22, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0-alpha.3...android-v8.3.0-beta.1) since [Mapbox Maps SDK for Android v8.3.0-alpha.3](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0-alpha.3): ### Bug fixes - - Fixed a bug where glyphs generated through the LocalGlyphRasterizer interface were changing fonts during some zoom changes. [#15407](https://github.com/mapbox/mapbox-gl-native/pull/15407) - - Fixed use of objects after moving, potentially causing crashes. [#15408](https://github.com/mapbox/mapbox-gl-native/pull/15408) - - Fixed a possible crash that could be caused by invoking the wrong layer implementation casting function [#15398](https://github.com/mapbox/mapbox-gl-native/pull/15398). - - Font lookup on pre lollipop devices failed, provide default font list instead [#15410](https://github.com/mapbox/mapbox-gl-native/pull/15410). - - Fixed rendering and collision detection issues with using `text-variable-anchor` and `icon-text-fit` properties on the same layer [#15367](https://github.com/mapbox/mapbox-gl-native/pull/15367). - - Fixed a bug where quick-scale was registered during a move gesture that followed a double-tap. Bumped gestures library to `v0.5.1`. [#15427](https://github.com/mapbox/mapbox-gl-native/pull/15427) - - Fixed symbol overlap when zooming out quickly. [#15416](https://github.com/mapbox/mapbox-gl-native/pull/15416) + +- Fixed a bug where glyphs generated through the LocalGlyphRasterizer interface were changing fonts during some zoom changes. [#15407](https://github.com/mapbox/mapbox-gl-native/pull/15407) +- Fixed use of objects after moving, potentially causing crashes. [#15408](https://github.com/mapbox/mapbox-gl-native/pull/15408) +- Fixed a possible crash that could be caused by invoking the wrong layer implementation casting function [#15398](https://github.com/mapbox/mapbox-gl-native/pull/15398). +- Font lookup on pre lollipop devices failed, provide default font list instead [#15410](https://github.com/mapbox/mapbox-gl-native/pull/15410). +- Fixed rendering and collision detection issues with using `text-variable-anchor` and `icon-text-fit` properties on the same layer [#15367](https://github.com/mapbox/mapbox-gl-native/pull/15367). +- Fixed a bug where quick-scale was registered during a move gesture that followed a double-tap. Bumped gestures library to `v0.5.1`. [#15427](https://github.com/mapbox/mapbox-gl-native/pull/15427) +- Fixed symbol overlap when zooming out quickly. [#15416](https://github.com/mapbox/mapbox-gl-native/pull/15416) ### Other Changes - - Do not invalidate the camera immediately when map padding is set. Reverts a change introduced in the `v8.2.0`. [#15437](https://github.com/mapbox/mapbox-gl-native/pull/15437) + +- Do not invalidate the camera immediately when map padding is set. Reverts a change introduced in the `v8.2.0`. [#15437](https://github.com/mapbox/mapbox-gl-native/pull/15437) ### Docs - - Add javadoc to OnStyleImageMissingListener indicating the required synchronous addition images, document workaround [#15418](https://github.com/mapbox/mapbox-gl-native/pull/15418) + +- Add javadoc to OnStyleImageMissingListener indicating the required synchronous addition images, document workaround [#15418](https://github.com/mapbox/mapbox-gl-native/pull/15418) ## 8.3.0-alpha.3 - August 15, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0-alpha.2...android-v8.3.0-alpha.3) since [Mapbox Maps SDK for Android v8.3.0-alpha.2](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0-alpha.2): ### Gestures handling - - Bumped gestures library version to v0.5.0 which replaces the compat gesture detector with a custom scale gesture detector implementation. This is a softly breaking change because the underlying scale gesture detector reference has been removed. This brings a set of improvements to gestures without removing any functionality from the previous implementation. [#15136](https://github.com/mapbox/mapbox-gl-native/pull/15136) - - Improved scale and rotate gestures by refining sensitivity thresholds and animation velocity. [#15136](https://github.com/mapbox/mapbox-gl-native/pull/15136) - - Improved quick-zoom gestures by making zoom changes linear. Quick-zoom scale changes are now executed based on y-axis delta changes. [#15386](https://github.com/mapbox/mapbox-gl-native/pull/15386) + +- Bumped gestures library version to v0.5.0 which replaces the compat gesture detector with a custom scale gesture detector implementation. This is a softly breaking change because the underlying scale gesture detector reference has been removed. This brings a set of improvements to gestures without removing any functionality from the previous implementation. [#15136](https://github.com/mapbox/mapbox-gl-native/pull/15136) +- Improved scale and rotate gestures by refining sensitivity thresholds and animation velocity. [#15136](https://github.com/mapbox/mapbox-gl-native/pull/15136) +- Improved quick-zoom gestures by making zoom changes linear. Quick-zoom scale changes are now executed based on y-axis delta changes. [#15386](https://github.com/mapbox/mapbox-gl-native/pull/15386) ### Features - - Introduced the text-writing-mode layout property for symbol layers. This property allows labels to be placed horizontally or vertically. The property accepts an array of enumeration values from a ( horizontal | vertical ) set. [#14932](https://github.com/mapbox/mapbox-gl-native/pull/14932) - - Added support for fallback fonts in `localIdeographFontFamily`. [#15255](https://github.com/mapbox/mapbox-gl-native/pull/15255) + +- Introduced the text-writing-mode layout property for symbol layers. This property allows labels to be placed horizontally or vertically. The property accepts an array of enumeration values from a ( horizontal | vertical ) set. [#14932](https://github.com/mapbox/mapbox-gl-native/pull/14932) +- Added support for fallback fonts in `localIdeographFontFamily`. [#15255](https://github.com/mapbox/mapbox-gl-native/pull/15255) ### Bug fixes - - Fixed an issue where it was possible to set the map’s content insets then tilt the map enough to see the horizon, causing performance issues [#15195](https://github.com/mapbox/mapbox-gl-native/pull/15195) - - Allow loading of a map without a style URI or style JSON [#15293](https://github.com/mapbox/mapbox-gl-native/pull/15293) - - Fixed an issue where animated camera transitions zoomed in or out too dramatically [#15281](https://github.com/mapbox/mapbox-gl-native/pull/15281) - - Enable variable label placement when `text-allow-overlap` property is set to true [#15354](https://github.com/mapbox/mapbox-gl-native/pull/15354) + +- Fixed an issue where it was possible to set the map’s content insets then tilt the map enough to see the horizon, causing performance issues [#15195](https://github.com/mapbox/mapbox-gl-native/pull/15195) +- Allow loading of a map without a style URI or style JSON [#15293](https://github.com/mapbox/mapbox-gl-native/pull/15293) +- Fixed an issue where animated camera transitions zoomed in or out too dramatically [#15281](https://github.com/mapbox/mapbox-gl-native/pull/15281) +- Enable variable label placement when `text-allow-overlap` property is set to true [#15354](https://github.com/mapbox/mapbox-gl-native/pull/15354) ## 8.3.0-alpha.2 - August 7, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0-alpha.1...android-v8.3.0-alpha.2) since [Mapbox Maps SDK for Android v8.3.0-alpha.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0-alpha.1): ### Bug fixes - - Load a style without an URI or JSON [#15293](https://github.com/mapbox/mapbox-gl-native/pull/15293) - - Do not try to wake up the RunLoop if a wake is already pending. Fixes offline downloads that could freeze after resuming. [#15330](https://github.com/mapbox/mapbox-gl-native/pull/15330) + +- Load a style without an URI or JSON [#15293](https://github.com/mapbox/mapbox-gl-native/pull/15293) +- Do not try to wake up the RunLoop if a wake is already pending. Fixes offline downloads that could freeze after resuming. [#15330](https://github.com/mapbox/mapbox-gl-native/pull/15330) ## 8.0.2 - July 31, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.0.1...android-v8.0.2) since [Mapbox Maps SDK for Android v8.0.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.0.1): ### Bug fixes - - Fixed rendering layers after fill-extrusion regression caused by optimization of fill-extrusion rendering [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) - - Fixed a map update bug caused by the render tiles and the render passes getting unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) - - Fixed a custom geometry source bug caused by using the outdated tiles after style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) - - Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) + +- Fixed rendering layers after fill-extrusion regression caused by optimization of fill-extrusion rendering [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) +- Fixed a map update bug caused by the render tiles and the render passes getting unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) +- Fixed a custom geometry source bug caused by using the outdated tiles after style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) +- Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) ## 7.4.1 - July 31, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v7.4.0...android-v7.4.1) since [Mapbox Maps SDK for Android v7.4.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v7.4.0): ### Bug fixes - - Fixed a map update bug caused by the render tiles and the render passes getting unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) - - Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) - - Fixed a custom geometry source bug caused by using the outdated tiles after style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) + +- Fixed a map update bug caused by the render tiles and the render passes getting unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) +- Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) +- Fixed a custom geometry source bug caused by using the outdated tiles after style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) ## 8.3.0-alpha.1 - July 31, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.2.0...android-v8.3.0-alpha.1) since [Mapbox Maps SDK for Android v8.2.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.0): ### Features - - Do not include CJK ideographs in the offline packs by default. This decreases overall offline download size but changes appearance by a default set local glyph generation [#14269](https://github.com/mapbox/mapbox-gl-native/pull/14269) - - Update target SDK to 28, update support library and fix gradle warnings [#15135](https://github.com/mapbox/mapbox-gl-native/pull/15135) - - Introduce VertexVector::extend() and use it in placement code [#15194](https://github.com/mapbox/mapbox-gl-native/pull/15194) + +- Do not include CJK ideographs in the offline packs by default. This decreases overall offline download size but changes appearance by a default set local glyph generation [#14269](https://github.com/mapbox/mapbox-gl-native/pull/14269) +- Update target SDK to 28, update support library and fix gradle warnings [#15135](https://github.com/mapbox/mapbox-gl-native/pull/15135) +- Introduce VertexVector::extend() and use it in placement code [#15194](https://github.com/mapbox/mapbox-gl-native/pull/15194) ### Bug fixes - - Save location animation timestamp only when fed. Fixes an issue where external camera updates impacted location animation duration[#15265](https://github.com/mapbox/mapbox-gl-native/pull/15265) - - Fixed flickering on style change for the same tile set [#15127](https://github.com/mapbox/mapbox-gl-native/pull/15127) - - Fix location render/camera modes being reinitialized even when the new mode is the same [#15266](https://github.com/mapbox/mapbox-gl-native/pull/15266) - - Ensure default local ideographs font family is not overwrote. Fix a bug that prevented local CJK glyphs generation. The local generation is now enabled by default and the font family used for generation is set to "sans-serif. [#15253](https://github.com/mapbox/mapbox-gl-native/pull/15253) - - Fix int overflow issue in GridIndex [#15245](https://github.com/mapbox/mapbox-gl-native/pull/15245) - - Align gesture animation reason for onCameraMoveStarted [#15218](https://github.com/mapbox/mapbox-gl-native/pull/15218) - - Remove layers first when clearing the style, fixes unnecessary log dumps [#15191](https://github.com/mapbox/mapbox-gl-native/pull/15191) - - Remove unused field from icon buffer [#15189](https://github.com/mapbox/mapbox-gl-native/pull/15189) + +- Save location animation timestamp only when fed. Fixes an issue where external camera updates impacted location animation duration[#15265](https://github.com/mapbox/mapbox-gl-native/pull/15265) +- Fixed flickering on style change for the same tile set [#15127](https://github.com/mapbox/mapbox-gl-native/pull/15127) +- Fix location render/camera modes being reinitialized even when the new mode is the same [#15266](https://github.com/mapbox/mapbox-gl-native/pull/15266) +- Ensure default local ideographs font family is not overwrote. Fix a bug that prevented local CJK glyphs generation. The local generation is now enabled by default and the font family used for generation is set to "sans-serif. [#15253](https://github.com/mapbox/mapbox-gl-native/pull/15253) +- Fix int overflow issue in GridIndex [#15245](https://github.com/mapbox/mapbox-gl-native/pull/15245) +- Align gesture animation reason for onCameraMoveStarted [#15218](https://github.com/mapbox/mapbox-gl-native/pull/15218) +- Remove layers first when clearing the style, fixes unnecessary log dumps [#15191](https://github.com/mapbox/mapbox-gl-native/pull/15191) +- Remove unused field from icon buffer [#15189](https://github.com/mapbox/mapbox-gl-native/pull/15189) ### Performance improvements - - Release quad data after vertex buffers are created [#15189](https://github.com/mapbox/mapbox-gl-native/pull/15189) - - Decrease size of SymbolBucket [#15178](https://github.com/mapbox/mapbox-gl-native/pull/15178) - - Avoid geometry collections copying [#15201](https://github.com/mapbox/mapbox-gl-native/pull/15201) + +- Release quad data after vertex buffers are created [#15189](https://github.com/mapbox/mapbox-gl-native/pull/15189) +- Decrease size of SymbolBucket [#15178](https://github.com/mapbox/mapbox-gl-native/pull/15178) +- Avoid geometry collections copying [#15201](https://github.com/mapbox/mapbox-gl-native/pull/15201) ## 8.2.1 - July 31, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.2.0...android-v8.2.1) since [Mapbox Maps SDK for Android v8.2.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.0): ### Bug fixes - - Save location animation timestamp only when fed [#15265](https://github.com/mapbox/mapbox-gl-native/pull/15265) + +- Save location animation timestamp only when fed [#15265](https://github.com/mapbox/mapbox-gl-native/pull/15265) ## 8.1.1 - July 26, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.1.0...android-v8.1.1) since [Mapbox Maps SDK for Android v8.1.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.1.0): ### Bug fixes - - Fixed rendering layers after fill-extrusion regression caused by optimization of fill-extrusion rendering [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) - - Fixed a map update bug caused by the render tiles and the render passes getting unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) - - Fixed collision with content insets [#15130](https://github.com/mapbox/mapbox-gl-native/pull/15130) - - Fixed a custom geometry source bug caused by using the outdated tiles after style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) - - Allow map panning after quick zoom is disabled but a phantom gesture is executed [#15093](https://github.com/mapbox/mapbox-gl-native/pull/15093) - - Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) - - Ensure that move detector is enabled if double-tap is interrupted [#15103](https://github.com/mapbox/mapbox-gl-native/pull/15103) + +- Fixed rendering layers after fill-extrusion regression caused by optimization of fill-extrusion rendering [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) +- Fixed a map update bug caused by the render tiles and the render passes getting unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) +- Fixed collision with content insets [#15130](https://github.com/mapbox/mapbox-gl-native/pull/15130) +- Fixed a custom geometry source bug caused by using the outdated tiles after style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) +- Allow map panning after quick zoom is disabled but a phantom gesture is executed [#15093](https://github.com/mapbox/mapbox-gl-native/pull/15093) +- Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) +- Ensure that move detector is enabled if double-tap is interrupted [#15103](https://github.com/mapbox/mapbox-gl-native/pull/15103) ## 8.2.0 - July 24, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.2.0-beta.1...android-v8.2.0) since [Mapbox Maps SDK for Android v8.2.0-beta.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.0-beta.1): ### Bug fixes - - Fix rendering of layers that are on top of fill-extrusion layers [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) + +- Fix rendering of layers that are on top of fill-extrusion layers [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) ## 8.2.0-beta.1 - July 18, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.2.0-alpha.3...android-v8.2.0-beta.1) since [Mapbox Maps SDK for Android v8.2.0-alpha.3](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.0-alpha.3): ### Bug fixes - - Fix `CustomGeometrySource` bug caused by usage of outdated tiles after a style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) - - Fix bug where previous anchors set in `text-variable-anchor` were still preferred after anchor options were reset [#15129](https://github.com/mapbox/mapbox-gl-native/pull/15129) - - Fix issue where annotations could not be selected due to a regression in content insets [#15130](https://github.com/mapbox/mapbox-gl-native/pull/15130) + +- Fix `CustomGeometrySource` bug caused by usage of outdated tiles after a style update [#15112](https://github.com/mapbox/mapbox-gl-native/pull/15112) +- Fix bug where previous anchors set in `text-variable-anchor` were still preferred after anchor options were reset [#15129](https://github.com/mapbox/mapbox-gl-native/pull/15129) +- Fix issue where annotations could not be selected due to a regression in content insets [#15130](https://github.com/mapbox/mapbox-gl-native/pull/15130) ## 8.2.0-alpha.3 - July 11, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.2.0-alpha.2...android-v8.2.0-alpha.3) since [Mapbox Maps SDK for Android v8.2.0-alpha.2](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.0-alpha.2): ### Bug fixes - - Fix map update bug caused by render tiles and render passes becoming unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) - - Fix fill-extrusion layers always rendered above other layers [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) - - Fix a bug where map panning would be blocked after a quick zoom gesture was attempted when quick zoom is set to be ignored by `UiSettings` preferences [#15093](https://github.com/mapbox/mapbox-gl-native/pull/15093) - - Fix a bug where map panning would be blocked if double-tap is interrupted [#15103](https://github.com/mapbox/mapbox-gl-native/pull/15103) + +- Fix map update bug caused by render tiles and render passes becoming unsynchronized [#15092](https://github.com/mapbox/mapbox-gl-native/pull/15092) +- Fix fill-extrusion layers always rendered above other layers [#15065](https://github.com/mapbox/mapbox-gl-native/pull/15065) +- Fix a bug where map panning would be blocked after a quick zoom gesture was attempted when quick zoom is set to be ignored by `UiSettings` preferences [#15093](https://github.com/mapbox/mapbox-gl-native/pull/15093) +- Fix a bug where map panning would be blocked if double-tap is interrupted [#15103](https://github.com/mapbox/mapbox-gl-native/pull/15103) ### Minor features and improvements - - Improve performance of queryRenderedFeatures by removing unnecessary iterations over vectors and unneeded layers [#14930](https://github.com/mapbox/mapbox-gl-native/pull/14930) - - Decrease the minimum pixel distance between the current camera position and the target required to interpolate during camera animation [#15073](https://github.com/mapbox/mapbox-gl-native/pull/15073) - - Introduce `MapboxMapOptions` facility creation method [#15069](https://github.com/mapbox/mapbox-gl-native/pull/15069) - - Throw configuration exception when accessing Mapbox services with an invalid token [#15081](https://github.com/mapbox/mapbox-gl-native/pull/15081) - - Allow setting a null access token in the runtime [#15081](https://github.com/mapbox/mapbox-gl-native/pull/15081) - - Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) + +- Improve performance of queryRenderedFeatures by removing unnecessary iterations over vectors and unneeded layers [#14930](https://github.com/mapbox/mapbox-gl-native/pull/14930) +- Decrease the minimum pixel distance between the current camera position and the target required to interpolate during camera animation [#15073](https://github.com/mapbox/mapbox-gl-native/pull/15073) +- Introduce `MapboxMapOptions` facility creation method [#15069](https://github.com/mapbox/mapbox-gl-native/pull/15069) +- Throw configuration exception when accessing Mapbox services with an invalid token [#15081](https://github.com/mapbox/mapbox-gl-native/pull/15081) +- Allow setting a null access token in the runtime [#15081](https://github.com/mapbox/mapbox-gl-native/pull/15081) +- Ensure location shadow's gradient radius is greater than 0 [#15099](https://github.com/mapbox/mapbox-gl-native/pull/15099) ### Other Changes - - Update okhttp to latest stable version that support pre lollipop (`3.12.3`) [#15087](https://github.com/mapbox/mapbox-gl-native/pull/15087) - - Fix up "match" expressions docs with stop arguments [#15102](https://github.com/mapbox/mapbox-gl-native/pull/15102) + +- Update okhttp to latest stable version that support pre lollipop (`3.12.3`) [#15087](https://github.com/mapbox/mapbox-gl-native/pull/15087) +- Fix up "match" expressions docs with stop arguments [#15102](https://github.com/mapbox/mapbox-gl-native/pull/15102) ## 8.2.0-alpha.2 - July 3, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.2.0-alpha.1...android-v8.2.0-alpha.2) since [Mapbox Maps SDK for Android v8.2.0-alpha.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.2.0-alpha.1): ### Major features - - Cache management API [#14962](https://github.com/mapbox/mapbox-gl-native/pull/14962) + +- Cache management API [#14962](https://github.com/mapbox/mapbox-gl-native/pull/14962) ### Bug fixes - - Fix style change transition regression caused by delayed setting of the updated layer properties [#15016](https://github.com/mapbox/mapbox-gl-native/pull/15016) + +- Fix style change transition regression caused by delayed setting of the updated layer properties [#15016](https://github.com/mapbox/mapbox-gl-native/pull/15016) ### Minor features and improvements - - Include Hiragana and Katakana glyph ranges to LocalGlyphRasterizer [#15009](https://github.com/mapbox/mapbox-gl-native/pull/15009) + +- Include Hiragana and Katakana glyph ranges to LocalGlyphRasterizer [#15009](https://github.com/mapbox/mapbox-gl-native/pull/15009) ### Other Changes - - Update CI image with NDK r20 [#15005](https://github.com/mapbox/mapbox-gl-native/pull/15005) + +- Update CI image with NDK r20 [#15005](https://github.com/mapbox/mapbox-gl-native/pull/15005) ## 8.2.0-alpha.1 - June 26, 2019 + [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.1.0...android-v8.2.0-alpha.1) since [Mapbox Maps SDK for Android v8.1.0](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.1.0): ### Bug fixes - - Fix `queryRenderedFeatues` bug caused by incorrect sort feature index calculation [#14884](https://github.com/mapbox/mapbox-gl-native/pull/14884) - - Fix performance regression by switching back to a more compact line attributes layout [#14851](https://github.com/mapbox/mapbox-gl-native/pull/14851) - - Fix a bug that restricted camera viewport after camera bounds were reset [#14882](https://github.com/mapbox/mapbox-gl-native/pull/14882) - - Fix a bug that ignored floating point values during core to platform color conversion [#14954](https://github.com/mapbox/mapbox-gl-native/pull/14954) - - Implemented asymmetric center of perspective: fixed an issue that caused the focal point to be always based on the view's horizontal center when setting [MapboxMap setPadding](https://docs.mapbox.com/android/api/map-sdk/8.0.0/com/mapbox/mapboxsdk/maps/MapboxMap.html#setPadding-int-int-int-int-). [#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664) + +- Fix `queryRenderedFeatues` bug caused by incorrect sort feature index calculation [#14884](https://github.com/mapbox/mapbox-gl-native/pull/14884) +- Fix performance regression by switching back to a more compact line attributes layout [#14851](https://github.com/mapbox/mapbox-gl-native/pull/14851) +- Fix a bug that restricted camera viewport after camera bounds were reset [#14882](https://github.com/mapbox/mapbox-gl-native/pull/14882) +- Fix a bug that ignored floating point values during core to platform color conversion [#14954](https://github.com/mapbox/mapbox-gl-native/pull/14954) +- Implemented asymmetric center of perspective: fixed an issue that caused the focal point to be always based on the view's horizontal center when setting [MapboxMap setPadding](https://docs.mapbox.com/android/api/map-sdk/8.0.0/com/mapbox/mapboxsdk/maps/MapboxMap.html#setPadding-int-int-int-int-). [#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664) ### Minor features and improvements - - Allow null updates to GeoJsonSource [#14898](https://github.com/mapbox/mapbox-gl-native/pull/14898) + +- Allow null updates to GeoJsonSource [#14898](https://github.com/mapbox/mapbox-gl-native/pull/14898) ### Other Changes - - Add resource usage to HttpRequest, add offline query flag to HttpRequest [#14837](https://github.com/mapbox/mapbox-gl-native/pull/14837) + +- Add resource usage to HttpRequest, add offline query flag to HttpRequest [#14837](https://github.com/mapbox/mapbox-gl-native/pull/14837) ## 8.1.0 - June 20, 2019 ### Bugs - - Accept floating numbers during core->platform color conversion [#14954](https://github.com/mapbox/mapbox-gl-native/pull/14954) - - Ensure to re-enable move when quickzoom finishes [#14965](https://github.com/mapbox/mapbox-gl-native/pull/14965) + +- Accept floating numbers during core->platform color conversion [#14954](https://github.com/mapbox/mapbox-gl-native/pull/14954) +- Ensure to re-enable move when quickzoom finishes [#14965](https://github.com/mapbox/mapbox-gl-native/pull/14965) ### Features - - Limit concurrent request for Android 4.4 and below to 10 [#14971](https://github.com/mapbox/mapbox-gl-native/pull/14971) + +- Limit concurrent request for Android 4.4 and below to 10 [#14971](https://github.com/mapbox/mapbox-gl-native/pull/14971) _Note about #14971:_ This pr makes an adjustment as a precautionary measure towards a rare bug that was discovered via instrumented unit tests on Android 4.4 (aka KitKat). This bug isn’t tied to a code change in the Mapbox Maps SDK for Android. Rather, the root cause is on the Android OS (and how it interacts with OkHttp). @@ -677,227 +834,282 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. ## 8.1.0-beta.1 - June 13, 2019 ### Bugs - - Fix compilation warning with updated clang [#14865](https://github.com/mapbox/mapbox-gl-native/pull/14865) - - Fix reset behavior for setLatLngBoundsForCameraTarget [#14882](https://github.com/mapbox/mapbox-gl-native/pull/14882) + +- Fix compilation warning with updated clang [#14865](https://github.com/mapbox/mapbox-gl-native/pull/14865) +- Fix reset behavior for setLatLngBoundsForCameraTarget [#14882](https://github.com/mapbox/mapbox-gl-native/pull/14882) ### Features - - Add resource usage to HttpRequest, add offline query param [#14837](https://github.com/mapbox/mapbox-gl-native/pull/14837) + +- Add resource usage to HttpRequest, add offline query param [#14837](https://github.com/mapbox/mapbox-gl-native/pull/14837) ## 8.0.1 - June 11, 2019 ### Bugs - - Reset the native renderer only when the GL thread exits [#14841](https://github.com/mapbox/mapbox-gl-native/pull/14841) - - Change library loader from Relinker to SoLoader [#14890](https://github.com/mapbox/mapbox-gl-native/pull/14890) + +- Reset the native renderer only when the GL thread exits [#14841](https://github.com/mapbox/mapbox-gl-native/pull/14841) +- Change library loader from Relinker to SoLoader [#14890](https://github.com/mapbox/mapbox-gl-native/pull/14890) ## 8.1.0-alpha.2 - June 6, 2019 ### Bugs - - Copy features array before passing them to core [#14804](https://github.com/mapbox/mapbox-gl-native/pull/14804) - - Improve test stability [#14853](https://github.com/mapbox/mapbox-gl-native/pull/14853) + +- Copy features array before passing them to core [#14804](https://github.com/mapbox/mapbox-gl-native/pull/14804) +- Improve test stability [#14853](https://github.com/mapbox/mapbox-gl-native/pull/14853) ### Features - - Rename URL API to URI [#14836](https://github.com/mapbox/mapbox-gl-native/pull/14836) + +- Rename URL API to URI [#14836](https://github.com/mapbox/mapbox-gl-native/pull/14836) ### Build - - Bumping Android telemetry to 4.5.1 [#14874](https://github.com/mapbox/mapbox-gl-native/pull/14874) + +- Bumping Android telemetry to 4.5.1 [#14874](https://github.com/mapbox/mapbox-gl-native/pull/14874) ### Docs - - Add external links to javadoc generation, fix warnings [#14792](https://github.com/mapbox/mapbox-gl-native/pull/14792) + +- Add external links to javadoc generation, fix warnings [#14792](https://github.com/mapbox/mapbox-gl-native/pull/14792) ## 8.1.0-alpha.1 - June 3, 2019 ### Bugs - - Return color string values in the [0-255] range [#14233](https://github.com/mapbox/mapbox-gl-native/pull/14233) - - Resume file source to complete resources cache path change [#14546](https://github.com/mapbox/mapbox-gl-native/pull/14546) - - Remove binary shader support [#14707](https://github.com/mapbox/mapbox-gl-native/pull/14707) - - Deprecate MapboxMapOptions empty constructor [#14748](https://github.com/mapbox/mapbox-gl-native/pull/14748) +- Return color string values in the [0-255] range [#14233](https://github.com/mapbox/mapbox-gl-native/pull/14233) +- Resume file source to complete resources cache path change [#14546](https://github.com/mapbox/mapbox-gl-native/pull/14546) +- Remove binary shader support [#14707](https://github.com/mapbox/mapbox-gl-native/pull/14707) +- Deprecate MapboxMapOptions empty constructor [#14748](https://github.com/mapbox/mapbox-gl-native/pull/14748) ### Features - - Break location camera tracking when a developer invoked animation starts [#14745](https://github.com/mapbox/mapbox-gl-native/pull/14745) - - Use URI instead of URL to enable asset loading [#14750](https://github.com/mapbox/mapbox-gl-native/pull/14750) - - Option to change the zoom rate. Decrease the default zoom rate by 35% [#14774](https://github.com/mapbox/mapbox-gl-native/pull/14774) - - Provide API to control eviction of cached images [#14610](https://github.com/mapbox/mapbox-gl-native/pull/14610) - - Android specific thread pool that keeps threads attached to JVM [#14450](https://github.com/mapbox/mapbox-gl-native/pull/14450) - - Asymmetric viewport when edge insets are specified [#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664) + +- Break location camera tracking when a developer invoked animation starts [#14745](https://github.com/mapbox/mapbox-gl-native/pull/14745) +- Use URI instead of URL to enable asset loading [#14750](https://github.com/mapbox/mapbox-gl-native/pull/14750) +- Option to change the zoom rate. Decrease the default zoom rate by 35% [#14774](https://github.com/mapbox/mapbox-gl-native/pull/14774) +- Provide API to control eviction of cached images [#14610](https://github.com/mapbox/mapbox-gl-native/pull/14610) +- Android specific thread pool that keeps threads attached to JVM [#14450](https://github.com/mapbox/mapbox-gl-native/pull/14450) +- Asymmetric viewport when edge insets are specified [#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664) ### Build - - Update maven publishing script to enable aar packaging [#14778](https://github.com/mapbox/mapbox-gl-native/pull/14778) - - Do not try to package duplicate files in the publication [#14822](https://github.com/mapbox/mapbox-gl-native/pull/14822) + +- Update maven publishing script to enable aar packaging [#14778](https://github.com/mapbox/mapbox-gl-native/pull/14778) +- Do not try to package duplicate files in the publication [#14822](https://github.com/mapbox/mapbox-gl-native/pull/14822) ### Docs - - Document that elevation(0) turns off the location shadow [#14723](https://github.com/mapbox/mapbox-gl-native/pull/14723) + +- Document that elevation(0) turns off the location shadow [#14723](https://github.com/mapbox/mapbox-gl-native/pull/14723) ## 8.0.0 - May 22, 2019 - - This release improves the method for counting monthly active users. By upgrading to this release, you are opting into the changes outlined [in this blog post](https://www.mapbox.com/52219). [#14404](https://github.com/mapbox/mapbox-gl-native/pull/14404) + +- This release improves the method for counting monthly active users. By upgrading to this release, you are opting into the changes outlined [in this blog post](https://www.mapbox.com/52219). [#14404](https://github.com/mapbox/mapbox-gl-native/pull/14404) ## 6.8.2 - May 17, 2019 ### Bugs - - Avoid binary shader load race condition with using multiple maps, disable binary shaders [#14298](https://github.com/mapbox/mapbox-gl-native/pull/14298) + +- Avoid binary shader load race condition with using multiple maps, disable binary shaders [#14298](https://github.com/mapbox/mapbox-gl-native/pull/14298) ## 7.5.0-beta.1 - May 17, 2019 ### Features - - Option to provide custom values for location camera transition [#14606](https://github.com/mapbox/mapbox-gl-native/pull/14606) + +- Option to provide custom values for location camera transition [#14606](https://github.com/mapbox/mapbox-gl-native/pull/14606) ### Bugs - - Expose trackingGesturesManagement attribute [#14659](https://github.com/mapbox/mapbox-gl-native/pull/14659) - - Harden onLowMemory call, use atomic boolean for thread safe management of the render surface [#14622](https://github.com/mapbox/mapbox-gl-native/pull/14622) - - Normalize previous rotation values of the location animator [#14626](https://github.com/mapbox/mapbox-gl-native/pull/14626) + +- Expose trackingGesturesManagement attribute [#14659](https://github.com/mapbox/mapbox-gl-native/pull/14659) +- Harden onLowMemory call, use atomic boolean for thread safe management of the render surface [#14622](https://github.com/mapbox/mapbox-gl-native/pull/14622) +- Normalize previous rotation values of the location animator [#14626](https://github.com/mapbox/mapbox-gl-native/pull/14626) ### Performance - - Remove telemetry gesture event handling code [#14627](https://github.com/mapbox/mapbox-gl-native/pull/14627) + +- Remove telemetry gesture event handling code [#14627](https://github.com/mapbox/mapbox-gl-native/pull/14627) ### Localisation - - Pull in Polish translation and updates to Czech and Hungarian [#14679](https://github.com/mapbox/mapbox-gl-native/pull/14679) + +- Pull in Polish translation and updates to Czech and Hungarian [#14679](https://github.com/mapbox/mapbox-gl-native/pull/14679) ### Docs - - Add javadoc to highlight incompatible onIdle event with snapshot api [#14621](https://github.com/mapbox/mapbox-gl-native/pull/14621) + +- Add javadoc to highlight incompatible onIdle event with snapshot api [#14621](https://github.com/mapbox/mapbox-gl-native/pull/14621) ## 7.4.0 - May 15, 2019 + ### Features - - Revert SKU token logic [#14594](https://github.com/mapbox/mapbox-gl-native/pull/14594) + +- Revert SKU token logic [#14594](https://github.com/mapbox/mapbox-gl-native/pull/14594) ### Bugs - - Keep strong references to the FileSource/OfflineManager operations callbacks [#14601](https://github.com/mapbox/mapbox-gl-native/pull/14601) - - Failed sprite requests do not block tiles rendering [#14605](https://github.com/mapbox/mapbox-gl-native/pull/14605) - - Remove missing image log [#14600](https://github.com/mapbox/mapbox-gl-native/pull/14600) + +- Keep strong references to the FileSource/OfflineManager operations callbacks [#14601](https://github.com/mapbox/mapbox-gl-native/pull/14601) +- Failed sprite requests do not block tiles rendering [#14605](https://github.com/mapbox/mapbox-gl-native/pull/14605) +- Remove missing image log [#14600](https://github.com/mapbox/mapbox-gl-native/pull/14600) ## 7.5.0-alpha.2 - May 8, 2019 + ### Bugs - - Keep shared_ptr to thread pool in CustomGeometrySource [#14562](https://github.com/mapbox/mapbox-gl-native/pull/14562) - - Changed placement order of symbols to match the viewport-y order when the `PropertyValue#symbolZOrder` is set to `SYMBOL_Z_ORDER_VIEWPORT_Y`, improving collision detection and rendering of symbol layers when icons are allowed to overlap but not text. [#14486](https://github.com/mapbox/mapbox-gl-native/pull/14486) + +- Keep shared_ptr to thread pool in CustomGeometrySource [#14562](https://github.com/mapbox/mapbox-gl-native/pull/14562) +- Changed placement order of symbols to match the viewport-y order when the `PropertyValue#symbolZOrder` is set to `SYMBOL_Z_ORDER_VIEWPORT_Y`, improving collision detection and rendering of symbol layers when icons are allowed to overlap but not text. [#14486](https://github.com/mapbox/mapbox-gl-native/pull/14486) ## 7.5.0-alpha.1 - May 2, 2019 + ### Bugs - - Use same OfflineRegion#isComplete logic as core [#14500](https://github.com/mapbox/mapbox-gl-native/pull/14500) - - Add toString, hashcode and equals to OfflineRegionError [#14499](https://github.com/mapbox/mapbox-gl-native/pull/14499) + +- Use same OfflineRegion#isComplete logic as core [#14500](https://github.com/mapbox/mapbox-gl-native/pull/14500) +- Add toString, hashcode and equals to OfflineRegionError [#14499](https://github.com/mapbox/mapbox-gl-native/pull/14499) ### Features - - Add "layer-above" option to the LocationComponent [#14497](https://github.com/mapbox/mapbox-gl-native/pull/14497) + +- Add "layer-above" option to the LocationComponent [#14497](https://github.com/mapbox/mapbox-gl-native/pull/14497) ### Build - - Update mapbox java sdk to v4.7.0 [#14480](https://github.com/mapbox/mapbox-gl-native/pull/14480) - - Update gestures library to v0.4.2 [#14524](https://github.com/mapbox/mapbox-gl-native/pull/14524) + +- Update mapbox java sdk to v4.7.0 [#14480](https://github.com/mapbox/mapbox-gl-native/pull/14480) +- Update gestures library to v0.4.2 [#14524](https://github.com/mapbox/mapbox-gl-native/pull/14524) ### Docs - - Clear up LocationComponent's z-index positioning docs [#14497](https://github.com/mapbox/mapbox-gl-native/pull/14497) + +- Clear up LocationComponent's z-index positioning docs [#14497](https://github.com/mapbox/mapbox-gl-native/pull/14497) ## 7.4.0-beta.3 - May 2, 2019 + ### Features + - Less strict rules for adding render layers to sources [#14540](https://github.com/mapbox/mapbox-gl-native/pull/14540) - Store type of renderable segment when sorting symbols by key [#14517](https://github.com/mapbox/mapbox-gl-native/pull/14517) ### Build - - Bump gestures library to v0.4.2 [#14524](https://github.com/mapbox/mapbox-gl-native/pull/14524) + +- Bump gestures library to v0.4.2 [#14524](https://github.com/mapbox/mapbox-gl-native/pull/14524) ## 7.4.0-beta.2 - April 23, 2019 + ### Features - - Enable/Disable SKU token handling [#14476](https://github.com/mapbox/mapbox-gl-native/pull/14476) + +- Enable/Disable SKU token handling [#14476](https://github.com/mapbox/mapbox-gl-native/pull/14476) ## 7.4.0-beta.1 - April 19, 2019 + ### Bugs - - Order render items properly across several sources [#14408](https://github.com/mapbox/mapbox-gl-native/pull/14408) - - Ignore equal offline region's download state updates [#14399](https://github.com/mapbox/mapbox-gl-native/pull/14399) - - Activate the ConnectivityReceiver when starting the download [#14397](https://github.com/mapbox/mapbox-gl-native/pull/14397) + +- Order render items properly across several sources [#14408](https://github.com/mapbox/mapbox-gl-native/pull/14408) +- Ignore equal offline region's download state updates [#14399](https://github.com/mapbox/mapbox-gl-native/pull/14399) +- Activate the ConnectivityReceiver when starting the download [#14397](https://github.com/mapbox/mapbox-gl-native/pull/14397) ### Features - - Port symbol-sort-key symbol layout property [#14386](https://github.com/mapbox/mapbox-gl-native/pull/14386) - - Add style image missing binding integration [#14320](https://github.com/mapbox/mapbox-gl-native/pull/14320) - - Allow snapshot generation without overlain view content [#14413](https://github.com/mapbox/mapbox-gl-native/pull/14413) - - Introduce AccountsManager to support SKU tokens in API requests [#14404](https://github.com/mapbox/mapbox-gl-native/pull/14404) - - Add MapEventFactory [#14309](https://github.com/mapbox/mapbox-gl-native/pull/14309) - - Only perform thread checking in debug builds [#14293](https://github.com/mapbox/mapbox-gl-native/pull/14293) + +- Port symbol-sort-key symbol layout property [#14386](https://github.com/mapbox/mapbox-gl-native/pull/14386) +- Add style image missing binding integration [#14320](https://github.com/mapbox/mapbox-gl-native/pull/14320) +- Allow snapshot generation without overlain view content [#14413](https://github.com/mapbox/mapbox-gl-native/pull/14413) +- Introduce AccountsManager to support SKU tokens in API requests [#14404](https://github.com/mapbox/mapbox-gl-native/pull/14404) +- Add MapEventFactory [#14309](https://github.com/mapbox/mapbox-gl-native/pull/14309) +- Only perform thread checking in debug builds [#14293](https://github.com/mapbox/mapbox-gl-native/pull/14293) ### Build - - Bump gestures library to v0.4.1 [#14435](https://github.com/mapbox/mapbox-gl-native/pull/14435) - - Update mapbox java sdk to v4.6.0 [#14424](https://github.com/mapbox/mapbox-gl-native/pull/14424) - - Bump telemetry to 4.4.1 [#14309](https://github.com/mapbox/mapbox-gl-native/pull/14309) - - Program against NativeMap [#14412](https://github.com/mapbox/mapbox-gl-native/pull/14412) + +- Bump gestures library to v0.4.1 [#14435](https://github.com/mapbox/mapbox-gl-native/pull/14435) +- Update mapbox java sdk to v4.6.0 [#14424](https://github.com/mapbox/mapbox-gl-native/pull/14424) +- Bump telemetry to 4.4.1 [#14309](https://github.com/mapbox/mapbox-gl-native/pull/14309) +- Program against NativeMap [#14412](https://github.com/mapbox/mapbox-gl-native/pull/14412) ## 7.3.2 - April 17, 2019 + ## Bugs - - Unify has surface state handling, allow querying after map resume [#14426](https://github.com/mapbox/mapbox-gl-native/pull/14426) + +- Unify has surface state handling, allow querying after map resume [#14426](https://github.com/mapbox/mapbox-gl-native/pull/14426) ## 7.3.1 - April 12, 2019 + ## Bugs - - Harden renderer invocation when Activity is resumed [#14395](https://github.com/mapbox/mapbox-gl-native/pull/14395) - - Check for Mapbox#INSTANCE when initializing the MapView [#14366](https://github.com/mapbox/mapbox-gl-native/pull/14366) - - Disable binary programs shaders [#14298](https://github.com/mapbox/mapbox-gl-native/pull/14298) + +- Harden renderer invocation when Activity is resumed [#14395](https://github.com/mapbox/mapbox-gl-native/pull/14395) +- Check for Mapbox#INSTANCE when initializing the MapView [#14366](https://github.com/mapbox/mapbox-gl-native/pull/14366) +- Disable binary programs shaders [#14298](https://github.com/mapbox/mapbox-gl-native/pull/14298) ## 7.4.0-alpha.2 - April 10, 2019 + ### Bugs - - Check for Mapbox#INSTANCE when initializing the MapView [#14366](https://github.com/mapbox/mapbox-gl-native/pull/14366) - - Clear previous style loaded listener when setting a new style[#14338](https://github.com/mapbox/mapbox-gl-native/pull/14338) + +- Check for Mapbox#INSTANCE when initializing the MapView [#14366](https://github.com/mapbox/mapbox-gl-native/pull/14366) +- Clear previous style loaded listener when setting a new style[#14338](https://github.com/mapbox/mapbox-gl-native/pull/14338) ### Features - - Allow resetting a custom OkHttp client to the default impl [#14349](https://github.com/mapbox/mapbox-gl-native/pull/14349) - - Expose LocationComponentConstants class [#14333](https://github.com/mapbox/mapbox-gl-native/pull/14333) + +- Allow resetting a custom OkHttp client to the default impl [#14349](https://github.com/mapbox/mapbox-gl-native/pull/14349) +- Expose LocationComponentConstants class [#14333](https://github.com/mapbox/mapbox-gl-native/pull/14333) ### Build - - Fix build with mismatching glShaderSource signature[#14339](https://github.com/mapbox/mapbox-gl-native/pull/14339) + +- Fix build with mismatching glShaderSource signature[#14339](https://github.com/mapbox/mapbox-gl-native/pull/14339) ## 7.4.0-alpha.1 - April 3, 2019 ### Bugs - - Clean up location permissions annotation [#14311](https://github.com/mapbox/mapbox-gl-native/pull/14311) - - Clear camera callbacks' message queue when the map is destroyed [#14292](https://github.com/mapbox/mapbox-gl-native/pull/14292) - - Use a valid gestures focal point when resetting a manager [#14284](https://github.com/mapbox/mapbox-gl-native/pull/14284) - - Disable move gesture detector foreseeing the quickzoom [#14268](https://github.com/mapbox/mapbox-gl-native/pull/14268) - - Remove request render from MapboxMap#onStart [#14245](https://github.com/mapbox/mapbox-gl-native/pull/14245) - - Use TurfMeasurement#distance in LatLng#distanceTo [#14220](https://github.com/mapbox/mapbox-gl-native/pull/14220) + +- Clean up location permissions annotation [#14311](https://github.com/mapbox/mapbox-gl-native/pull/14311) +- Clear camera callbacks' message queue when the map is destroyed [#14292](https://github.com/mapbox/mapbox-gl-native/pull/14292) +- Use a valid gestures focal point when resetting a manager [#14284](https://github.com/mapbox/mapbox-gl-native/pull/14284) +- Disable move gesture detector foreseeing the quickzoom [#14268](https://github.com/mapbox/mapbox-gl-native/pull/14268) +- Remove request render from MapboxMap#onStart [#14245](https://github.com/mapbox/mapbox-gl-native/pull/14245) +- Use TurfMeasurement#distance in LatLng#distanceTo [#14220](https://github.com/mapbox/mapbox-gl-native/pull/14220) ### Features - - Add pixel dimension annotation to public UiSettings methods [#14281](https://github.com/mapbox/mapbox-gl-native/pull/14281) - - Add #toString override for formatted sections [#14247](https://github.com/mapbox/mapbox-gl-native/pull/14247) - - Harden fetching camera for bounds when padding is excessive [#14221](https://github.com/mapbox/mapbox-gl-native/pull/14221) - - Traverse expression tree when checking for property overrides [#14259](https://github.com/mapbox/mapbox-gl-native/pull/14259) - - Variable label placement [#14184](https://github.com/mapbox/mapbox-gl-native/pull/14184) + +- Add pixel dimension annotation to public UiSettings methods [#14281](https://github.com/mapbox/mapbox-gl-native/pull/14281) +- Add #toString override for formatted sections [#14247](https://github.com/mapbox/mapbox-gl-native/pull/14247) +- Harden fetching camera for bounds when padding is excessive [#14221](https://github.com/mapbox/mapbox-gl-native/pull/14221) +- Traverse expression tree when checking for property overrides [#14259](https://github.com/mapbox/mapbox-gl-native/pull/14259) +- Variable label placement [#14184](https://github.com/mapbox/mapbox-gl-native/pull/14184) ### Build - - Disable binary programs until we fix [#14294]((https://github.com/mapbox/mapbox-gl-native/pull/14298) - - Disable leak canary during instrumentation tests [#14296](https://github.com/mapbox/mapbox-gl-native/pull/14296) - - Remove Android v7 support library [#14265](https://github.com/mapbox/mapbox-gl-native/pull/14265) + +- Disable binary programs until we fix [#14294]((https://github.com/mapbox/mapbox-gl-native/pull/14298) +- Disable leak canary during instrumentation tests [#14296](https://github.com/mapbox/mapbox-gl-native/pull/14296) +- Remove Android v7 support library [#14265](https://github.com/mapbox/mapbox-gl-native/pull/14265) ## 7.3.0 - March 28, 2019 ### Bugs - - Fix MapView reuse issues [#14127](https://github.com/mapbox/mapbox-gl-native/pull/14127) - - Don't call OnSurfaceCreated from the main thread [#14244](https://github.com/mapbox/mapbox-gl-native/pull/14244) + +- Fix MapView reuse issues [#14127](https://github.com/mapbox/mapbox-gl-native/pull/14127) +- Don't call OnSurfaceCreated from the main thread [#14244](https://github.com/mapbox/mapbox-gl-native/pull/14244) ## 7.3.0-beta.1 - March 20, 2019 ### Features - - Expose "text-color" option for formatted sections [#14128](https://github.com/mapbox/mapbox-gl-native/pull/14128) - - Expose LocationComponent's layer IDs [#14155](https://github.com/mapbox/mapbox-gl-native/pull/14155) + +- Expose "text-color" option for formatted sections [#14128](https://github.com/mapbox/mapbox-gl-native/pull/14128) +- Expose LocationComponent's layer IDs [#14155](https://github.com/mapbox/mapbox-gl-native/pull/14155) ### Bugs - - Cache location layer IDs in a set instead of a list [#14141](https://github.com/mapbox/mapbox-gl-native/pull/14141) - - Clear the style object when the map is destroyed [#14171](https://github.com/mapbox/mapbox-gl-native/pull/14171) - - Cache source/layer only when successfully added [#14171](https://github.com/mapbox/mapbox-gl-native/pull/14171) + +- Cache location layer IDs in a set instead of a list [#14141](https://github.com/mapbox/mapbox-gl-native/pull/14141) +- Clear the style object when the map is destroyed [#14171](https://github.com/mapbox/mapbox-gl-native/pull/14171) +- Cache source/layer only when successfully added [#14171](https://github.com/mapbox/mapbox-gl-native/pull/14171) ### Build - - Bump telemetry version to 4.3.0 [#14140](https://github.com/mapbox/mapbox-gl-native/pull/14140) + +- Bump telemetry version to 4.3.0 [#14140](https://github.com/mapbox/mapbox-gl-native/pull/14140) ## 7.3.0-alpha.2 - March 13, 2019 ### Features + - Option to change path of the resources cache db [#13947](https://github.com/mapbox/mapbox-gl-native/pull/13947) - Throw an exception if the component is accessed before the activation [#14068](https://github.com/mapbox/mapbox-gl-native/pull/14068) - Add Galician localization [#14095](https://github.com/mapbox/mapbox-gl-native/pull/14095) ### Bugs + - Set a blank style when an empty builder is provided [#14085](https://github.com/mapbox/mapbox-gl-native/pull/14085) - Fix quick-zoom + double-tap gestures combo regression [#14084](https://github.com/mapbox/mapbox-gl-native/pull/14084) - Explicitly declare MapboxIssueRegistry's lint version [#14086](https://github.com/mapbox/mapbox-gl-native/pull/14086) ### Build + - Publish SNAPSHOTs to oss.jfrog.org [#14067](https://github.com/mapbox/mapbox-gl-native/pull/14067) ## 7.3.0-alpha.1 - March 7, 2019 ### Features + - Make ReLinker default library loader [#13974](https://github.com/mapbox/mapbox-gl-native/pull/13974) - Add plural style builder methods [#14012](https://github.com/mapbox/mapbox-gl-native/pull/14012) - Adding areAllGesturesEnabled() boolean retreival method to UiSettings class [#14022](https://github.com/mapbox/mapbox-gl-native/pull/14022) @@ -905,6 +1117,7 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. - Get vector drawables using AppCompatResources and set them programmatically [#14058](https://github.com/mapbox/mapbox-gl-native/pull/14058) ### Bugs + - LatLngBounds: Fix constrain when crossing antimeridian [#13958](https://github.com/mapbox/mapbox-gl-native/pull/13958) - Verify no native method is called when saving state [#13980](https://github.com/mapbox/mapbox-gl-native/pull/13980) - Clear fragment's onMapReady callbacks as part of OnDestroy, not OnDestroyView [#14035](https://github.com/mapbox/mapbox-gl-native/pull/14035) @@ -912,24 +1125,29 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. - Remove unused dem memory [#13550](https://github.com/mapbox/mapbox-gl-native/pull/13550) ### Build + - Adding Bintray Gradle plugin for artifact publishing [#13999](https://github.com/mapbox/mapbox-gl-native/pull/13999) ## 7.2.0 - February 27, 2019 ### Bugs + - fix surface creation after app backgrounding for surfaceview[#13976](https://github.com/mapbox/mapbox-gl-native/pull/13976) ## 7.2.0-beta.1 - February 21, 2019 ### Bugs + - Keep location component's layers hidden when new style with the "layer-below" option is applied[#13936](https://github.com/mapbox/mapbox-gl-native/pull/13936) ### Features + - Set localIdeographFontFamily default to sans-serif[#13925](https://github.com/mapbox/mapbox-gl-native/pull/13925) ## 7.2.0-alpha.2 - February 14, 2019 ### Bugs + - Invalidate the camera position when gesture finishes[#13920](https://github.com/mapbox/mapbox-gl-native/pull/13920) - Hook into surface holder to cleanup renderer on the right thread before the surface is destroyed [#13926](https://github.com/mapbox/mapbox-gl-native/pull/13926) - Fix deadlock in http request on hitting tile limit[#13858](https://github.com/mapbox/mapbox-gl-native/pull/13858) @@ -937,6 +1155,7 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. ## 7.2.0-alpha.1 - February 7, 2019 ### Build + - Update downstream circle-ci job name [#13872](https://github.com/mapbox/mapbox-gl-native/pull/13872) - Prioritize running benchmarks when building master [#13801](https://github.com/mapbox/mapbox-gl-native/pull/13801) - Revert modules vendorization and keep submodules only [#13806](https://github.com/mapbox/mapbox-gl-native/pull/13806) @@ -944,6 +1163,7 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. - Fetch tags during nitpick, bump gestures library to v0.4.0 [#13847](https://github.com/mapbox/mapbox-gl-native/pull/13847) ### Bugs + - Test app fixes 7.1.0 QA [#13773](https://github.com/mapbox/mapbox-gl-native/pull/13773) - Remove deprecated javacompile, resolve AS 3.3.0 warning on deprecation [#13777](https://github.com/mapbox/mapbox-gl-native/pull/13777) - Update project readme with buck source file ignore configuration [#13788](https://github.com/mapbox/mapbox-gl-native/pull/13788) @@ -952,6 +1172,7 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. - Remove faulty cast to uint64_t, explict casting for cluster API [#13888](https://github.com/mapbox/mapbox-gl-native/pull/13888) ### Features + - Separate quick zoom gesture option [#13791](https://github.com/mapbox/mapbox-gl-native/pull/13791) - Location animators memory and CPU optimizations [#13678](https://github.com/mapbox/mapbox-gl-native/pull/13678) - Added performance event [#13795](https://github.com/mapbox/mapbox-gl-native/pull/13795) @@ -962,634 +1183,709 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. ## 7.1.2 - February 7, 2019 ### Bugs - - Fix layer not rendering correctly when property value's negative [#13888](https://github.com/mapbox/mapbox-gl-native/pull/13888) + +- Fix layer not rendering correctly when property value's negative [#13888](https://github.com/mapbox/mapbox-gl-native/pull/13888) ## 7.1.1 - February 1, 2019 ### Bugs - - Fix a crash caused by the missing `Timber` dependency [#13847](https://github.com/mapbox/mapbox-gl-native/pull/13847) + +- Fix a crash caused by the missing `Timber` dependency [#13847](https://github.com/mapbox/mapbox-gl-native/pull/13847) ## 7.1.0 - January 30, 2019 ### Build - - Revert Android vendorization, add submodule pinning [#13815](https://github.com/mapbox/mapbox-gl-native/pull/13815) + +- Revert Android vendorization, add submodule pinning [#13815](https://github.com/mapbox/mapbox-gl-native/pull/13815) ## 7.1.0-beta.1 - January 23, 2019 ### Bugs - - Ignore unused C++ arguments for all build environments [#13774](https://github.com/mapbox/mapbox-gl-native/pull/13774) - - Import gesture detector dimens using the correct package structure [#13750](https://github.com/mapbox/mapbox-gl-native/pull/13750) - - Restore location layer visibility with new "layer-below" [#13771](https://github.com/mapbox/mapbox-gl-native/pull/13771) - - Rename required TransitionOptions field [#13769](https://github.com/mapbox/mapbox-gl-native/pull/13769) + +- Ignore unused C++ arguments for all build environments [#13774](https://github.com/mapbox/mapbox-gl-native/pull/13774) +- Import gesture detector dimens using the correct package structure [#13750](https://github.com/mapbox/mapbox-gl-native/pull/13750) +- Restore location layer visibility with new "layer-below" [#13771](https://github.com/mapbox/mapbox-gl-native/pull/13771) +- Rename required TransitionOptions field [#13769](https://github.com/mapbox/mapbox-gl-native/pull/13769) ### Build - - Ignore unused C++ arguments for all build environments [#13774](https://github.com/mapbox/mapbox-gl-native/pull/13774) - - Update to NDK 19, migrate STL experimental/optional [#13049](https://github.com/mapbox/mapbox-gl-native/pull/13049) + +- Ignore unused C++ arguments for all build environments [#13774](https://github.com/mapbox/mapbox-gl-native/pull/13774) +- Update to NDK 19, migrate STL experimental/optional [#13049](https://github.com/mapbox/mapbox-gl-native/pull/13049) ## 7.1.0-alpha.3 - January 21, 2019 ### Features - - Add library loading to peer objects [#13758](https://github.com/mapbox/mapbox-gl-native/pull/13758) - - Remove tile sorting from the clip and mask algorithms [#13756](https://github.com/mapbox/mapbox-gl-native/pull/13756) - - Ability to disable any layer using pre-processing flags [#13717](https://github.com/mapbox/mapbox-gl-native/pull/13717) - - Make library loader load the native library once [#13748](https://github.com/mapbox/mapbox-gl-native/pull/13748) - - Allow offline and snapshotter to be disabled [#13730](https://github.com/mapbox/mapbox-gl-native/pull/13730) - - Sorted render tiles for TilePyramid [#13739](https://github.com/mapbox/mapbox-gl-native/pull/13739) + +- Add library loading to peer objects [#13758](https://github.com/mapbox/mapbox-gl-native/pull/13758) +- Remove tile sorting from the clip and mask algorithms [#13756](https://github.com/mapbox/mapbox-gl-native/pull/13756) +- Ability to disable any layer using pre-processing flags [#13717](https://github.com/mapbox/mapbox-gl-native/pull/13717) +- Make library loader load the native library once [#13748](https://github.com/mapbox/mapbox-gl-native/pull/13748) +- Allow offline and snapshotter to be disabled [#13730](https://github.com/mapbox/mapbox-gl-native/pull/13730) +- Sorted render tiles for TilePyramid [#13739](https://github.com/mapbox/mapbox-gl-native/pull/13739) ### Bugs - - Adjust maven pom file with vendorized libraries versions [#13765](https://github.com/mapbox/mapbox-gl-native/pull/13765) - - Update attribution feedback URL in code and tests [#13710](https://github.com/mapbox/mapbox-gl-native/pull/13710) - - Re-apply location components "layer-below" when changed [#13749](https://github.com/mapbox/mapbox-gl-native/pull/13749) - - Avoid leaking CompassView context through animator [#13743](https://github.com/mapbox/mapbox-gl-native/pull/13743) - - Allow resetting fps listener [#13733](https://github.com/mapbox/mapbox-gl-native/pull/13733) + +- Adjust maven pom file with vendorized libraries versions [#13765](https://github.com/mapbox/mapbox-gl-native/pull/13765) +- Update attribution feedback URL in code and tests [#13710](https://github.com/mapbox/mapbox-gl-native/pull/13710) +- Re-apply location components "layer-below" when changed [#13749](https://github.com/mapbox/mapbox-gl-native/pull/13749) +- Avoid leaking CompassView context through animator [#13743](https://github.com/mapbox/mapbox-gl-native/pull/13743) +- Allow resetting fps listener [#13733](https://github.com/mapbox/mapbox-gl-native/pull/13733) ## 7.1.0-alpha.2 - January 16, 2019 - - Do not invoke #onCancel when animation is scheduled from #onFinish block [#13737](https://github.com/mapbox/mapbox-gl-native/pull/13737) - - Updated licenses after Android vendorization [#13738](https://github.com/mapbox/mapbox-gl-native/pull/13738) - - Use QueryFeatureExtension to query the map for supercluster v0.3.0 properties, add api for getLeaves, getChildren and getNextExpansionZoom [#13631](https://github.com/mapbox/mapbox-gl-native/pull/13631) - - Restore correct Snapshot attribution, make attribution parser backwards compatible [#13732](https://github.com/mapbox/mapbox-gl-native/pull/13732) - - Vendorize Android Mapbox dependencies [#13712](https://github.com/mapbox/mapbox-gl-native/pull/13712) - - Introduce NativeMap abstraction, remove static code block removal utility [#13681](https://github.com/mapbox/mapbox-gl-native/pull/13681) - - Notify requests about network reachability in priority order [#13721](https://github.com/mapbox/mapbox-gl-native/pull/13721) - - SymbolBucket, use single map for paint properties data [#13724](https://github.com/mapbox/mapbox-gl-native/pull/13724) - - Avoid NullPointerException when quickly closing activity for attribution click handling [#13723](https://github.com/mapbox/mapbox-gl-native/pull/13723) - - Return constexpr strings from functions to avoid ODR compile failures [#13720](https://github.com/mapbox/mapbox-gl-native/pull/13720) - - Split layer type specific code in mbgl::Programs [#13577](https://github.com/mapbox/mapbox-gl-native/pull/13577) - - Shader program must always match bucket in render symbol layer [#13667](https://github.com/mapbox/mapbox-gl-native/pull/13667) - - Implement Google benchmark runner for Android platform [#13628](https://github.com/mapbox/mapbox-gl-native/pull/13628) - - Avoid leaking attribution dialog when hosting context is stopped [#13673](https://github.com/mapbox/mapbox-gl-native/pull/13673) - - Android test runner for core unit tests [#13617](https://github.com/mapbox/mapbox-gl-native/pull/13617) - - Throw IllegalStateException when when setting an maximum fps while the mapRenderer isn't created yet [#13706](https://github.com/mapbox/mapbox-gl-native/pull/13706) - - Lift Parceable interface to OfflineRegionDefinition [#13688](https://github.com/mapbox/mapbox-gl-native/pull/13688) - - Espresso test rework [#13576](https://github.com/mapbox/mapbox-gl-native/pull/13576) +- Do not invoke #onCancel when animation is scheduled from #onFinish block [#13737](https://github.com/mapbox/mapbox-gl-native/pull/13737) +- Updated licenses after Android vendorization [#13738](https://github.com/mapbox/mapbox-gl-native/pull/13738) +- Use QueryFeatureExtension to query the map for supercluster v0.3.0 properties, add api for getLeaves, getChildren and getNextExpansionZoom [#13631](https://github.com/mapbox/mapbox-gl-native/pull/13631) +- Restore correct Snapshot attribution, make attribution parser backwards compatible [#13732](https://github.com/mapbox/mapbox-gl-native/pull/13732) +- Vendorize Android Mapbox dependencies [#13712](https://github.com/mapbox/mapbox-gl-native/pull/13712) +- Introduce NativeMap abstraction, remove static code block removal utility [#13681](https://github.com/mapbox/mapbox-gl-native/pull/13681) +- Notify requests about network reachability in priority order [#13721](https://github.com/mapbox/mapbox-gl-native/pull/13721) +- SymbolBucket, use single map for paint properties data [#13724](https://github.com/mapbox/mapbox-gl-native/pull/13724) +- Avoid NullPointerException when quickly closing activity for attribution click handling [#13723](https://github.com/mapbox/mapbox-gl-native/pull/13723) +- Return constexpr strings from functions to avoid ODR compile failures [#13720](https://github.com/mapbox/mapbox-gl-native/pull/13720) +- Split layer type specific code in mbgl::Programs [#13577](https://github.com/mapbox/mapbox-gl-native/pull/13577) +- Shader program must always match bucket in render symbol layer [#13667](https://github.com/mapbox/mapbox-gl-native/pull/13667) +- Implement Google benchmark runner for Android platform [#13628](https://github.com/mapbox/mapbox-gl-native/pull/13628) +- Avoid leaking attribution dialog when hosting context is stopped [#13673](https://github.com/mapbox/mapbox-gl-native/pull/13673) +- Android test runner for core unit tests [#13617](https://github.com/mapbox/mapbox-gl-native/pull/13617) +- Throw IllegalStateException when when setting an maximum fps while the mapRenderer isn't created yet [#13706](https://github.com/mapbox/mapbox-gl-native/pull/13706) +- Lift Parceable interface to OfflineRegionDefinition [#13688](https://github.com/mapbox/mapbox-gl-native/pull/13688) +- Espresso test rework [#13576](https://github.com/mapbox/mapbox-gl-native/pull/13576) ## 7.0.1 - January 11, 2019 - - Experimental setMaximumFps configuration on MapView [#13498](https://github.com/mapbox/mapbox-gl-native/pull/13498) + +- Experimental setMaximumFps configuration on MapView [#13498](https://github.com/mapbox/mapbox-gl-native/pull/13498) ## 7.1.0-alpha.1 - January 9, 2019 - - Add a Buck build and BUCK file for Android [#13584](https://github.com/mapbox/mapbox-gl-native/pull/13584) - - Instrumented unit tests, add map tests, refactor generated layer tests [#13443](https://github.com/mapbox/mapbox-gl-native/pull/13443) - - Add setMaximumFps configuration on MapView [#13498](https://github.com/mapbox/mapbox-gl-native/pull/13498) - - Fix deduping rings in quering [#11984](https://github.com/mapbox/mapbox-gl-native/pull/11984) - - Updated script detection for Unicode 11 [#13651](https://github.com/mapbox/mapbox-gl-native/pull/13651) - - Drop layer type and remaining usages [#13624](https://github.com/mapbox/mapbox-gl-native/pull/13624) - - Save debug cache state vs map state [#13638](https://github.com/mapbox/mapbox-gl-native/pull/13638) - - Add "localIdeographs" option to OfflineRegionDefinition [#13607](https://github.com/mapbox/mapbox-gl-native/pull/13607) - - Remove timber in favor of logger [#13625](https://github.com/mapbox/mapbox-gl-native/pull/13625) + +- Add a Buck build and BUCK file for Android [#13584](https://github.com/mapbox/mapbox-gl-native/pull/13584) +- Instrumented unit tests, add map tests, refactor generated layer tests [#13443](https://github.com/mapbox/mapbox-gl-native/pull/13443) +- Add setMaximumFps configuration on MapView [#13498](https://github.com/mapbox/mapbox-gl-native/pull/13498) +- Fix deduping rings in quering [#11984](https://github.com/mapbox/mapbox-gl-native/pull/11984) +- Updated script detection for Unicode 11 [#13651](https://github.com/mapbox/mapbox-gl-native/pull/13651) +- Drop layer type and remaining usages [#13624](https://github.com/mapbox/mapbox-gl-native/pull/13624) +- Save debug cache state vs map state [#13638](https://github.com/mapbox/mapbox-gl-native/pull/13638) +- Add "localIdeographs" option to OfflineRegionDefinition [#13607](https://github.com/mapbox/mapbox-gl-native/pull/13607) +- Remove timber in favor of logger [#13625](https://github.com/mapbox/mapbox-gl-native/pull/13625) ## 7.0.0 - January 7, 2019 - - Update core styles based on the streets-v8 source. This results in breaking changes for any code that references internal layers and sources of the style [#13615](https://github.com/mapbox/mapbox-gl-native/pull/13615) - - Cancel camera transitions only when set CameraMode is not None [#13662](https://github.com/mapbox/mapbox-gl-native/pull/13662) - - Fix location interval workaround initialization [#13670](https://github.com/mapbox/mapbox-gl-native/pull/13670) + +- Update core styles based on the streets-v8 source. This results in breaking changes for any code that references internal layers and sources of the style [#13615](https://github.com/mapbox/mapbox-gl-native/pull/13615) +- Cancel camera transitions only when set CameraMode is not None [#13662](https://github.com/mapbox/mapbox-gl-native/pull/13662) +- Fix location interval workaround initialization [#13670](https://github.com/mapbox/mapbox-gl-native/pull/13670) ## 7.0.0-beta.2 - December 21, 2018 - - Mapbox services sdk version bump to 4.3.0 [#13610](https://github.com/mapbox/mapbox-gl-native/pull/13610) - - Added Style object parameter mention to LocationComponent methods [#13597](https://github.com/mapbox/mapbox-gl-native/pull/13597) - - Clean up remaining deprecated methods for 7.0.0 [#13613](https://github.com/mapbox/mapbox-gl-native/pull/13613) - - Dismiss the foreground color only when the style is loaded [#13582](https://github.com/mapbox/mapbox-gl-native/pull/13582) - - Location update fastest interval workaround[#13592](https://github.com/mapbox/mapbox-gl-native/pull/13592) - - CameraMode transition animation and result listeners[#13523](https://github.com/mapbox/mapbox-gl-native/pull/13523) - - Validate if weakreference is still valid [#13555](https://github.com/mapbox/mapbox-gl-native/pull/13555) + +- Mapbox services sdk version bump to 4.3.0 [#13610](https://github.com/mapbox/mapbox-gl-native/pull/13610) +- Added Style object parameter mention to LocationComponent methods [#13597](https://github.com/mapbox/mapbox-gl-native/pull/13597) +- Clean up remaining deprecated methods for 7.0.0 [#13613](https://github.com/mapbox/mapbox-gl-native/pull/13613) +- Dismiss the foreground color only when the style is loaded [#13582](https://github.com/mapbox/mapbox-gl-native/pull/13582) +- Location update fastest interval workaround[#13592](https://github.com/mapbox/mapbox-gl-native/pull/13592) +- CameraMode transition animation and result listeners[#13523](https://github.com/mapbox/mapbox-gl-native/pull/13523) +- Validate if weakreference is still valid [#13555](https://github.com/mapbox/mapbox-gl-native/pull/13555) ## 6.8.1 - December 21, 2018 - - Telemetry bump to 3.5.7 [#13645](https://github.com/mapbox/mapbox-gl-native/pull/13645) - - Revert core styles back to streets-v7 source [#13648](https://github.com/mapbox/mapbox-gl-native/pull/13648) + +- Telemetry bump to 3.5.7 [#13645](https://github.com/mapbox/mapbox-gl-native/pull/13645) +- Revert core styles back to streets-v7 source [#13648](https://github.com/mapbox/mapbox-gl-native/pull/13648) ## 6.8.0 - December 19, 2018 - - Update core styles based on the streets-v8 source. This results in breaking changes for any code that references internal layers and sources of the style [#13615](https://github.com/mapbox/mapbox-gl-native/pull/13615) - - Fixed compass update time not getting updated [#13569](https://github.com/mapbox/mapbox-gl-native/pull/13569) - - Register compass sensor listener only if necessary [#13573](https://github.com/mapbox/mapbox-gl-native/pull/13573) - - Immediate location animation based on map's projection [#13545](https://github.com/mapbox/mapbox-gl-native/pull/13545) - - Option to disable smooth animation of compass and accuracy values [#13574](https://github.com/mapbox/mapbox-gl-native/pull/13574) - - Add onDidBecomeIdle to Map events [#13513](https://github.com/mapbox/mapbox-gl-native/pull/13513) - - Expose setAccessToken on Mapbox.java [#13397](https://github.com/mapbox/mapbox-gl-native/pull/13397) - - Expose endpoint change option for snapshotter [#13508](https://github.com/mapbox/mapbox-gl-native/pull/13508) - - Use locale sensitive DecimalFormat for color alpha conversion [#13393](https://github.com/mapbox/mapbox-gl-native/pull/13393) - - Enabled RecyclerView integration [#13132](https://github.com/mapbox/mapbox-gl-native/pull/13132) + +- Update core styles based on the streets-v8 source. This results in breaking changes for any code that references internal layers and sources of the style [#13615](https://github.com/mapbox/mapbox-gl-native/pull/13615) +- Fixed compass update time not getting updated [#13569](https://github.com/mapbox/mapbox-gl-native/pull/13569) +- Register compass sensor listener only if necessary [#13573](https://github.com/mapbox/mapbox-gl-native/pull/13573) +- Immediate location animation based on map's projection [#13545](https://github.com/mapbox/mapbox-gl-native/pull/13545) +- Option to disable smooth animation of compass and accuracy values [#13574](https://github.com/mapbox/mapbox-gl-native/pull/13574) +- Add onDidBecomeIdle to Map events [#13513](https://github.com/mapbox/mapbox-gl-native/pull/13513) +- Expose setAccessToken on Mapbox.java [#13397](https://github.com/mapbox/mapbox-gl-native/pull/13397) +- Expose endpoint change option for snapshotter [#13508](https://github.com/mapbox/mapbox-gl-native/pull/13508) +- Use locale sensitive DecimalFormat for color alpha conversion [#13393](https://github.com/mapbox/mapbox-gl-native/pull/13393) +- Enabled RecyclerView integration [#13132](https://github.com/mapbox/mapbox-gl-native/pull/13132) ## 7.0.0-beta.1 - December 12, 2018 - - Style builder and Style.java [#13484](https://github.com/mapbox/mapbox-gl-native/pull/13484) - - LatLng bounds cannot be wrapped [#13419](https://github.com/mapbox/mapbox-gl-native/pull/13419) - - Expose endpoint change option for snapshotter [#13508](https://github.com/mapbox/mapbox-gl-native/pull/13508) - - Formatted "text-field" property setter [#13358](https://github.com/mapbox/mapbox-gl-native/pull/13358) - - Expose setAccesToken on Mapbox.java [#13397](https://github.com/mapbox/mapbox-gl-native/pull/13397) - - Immediately notify core about forced connectivity state [#13485](https://github.com/mapbox/mapbox-gl-native/pull/13485) - - Handle transition duration of 0ms for symbols [#13535](https://github.com/mapbox/mapbox-gl-native/pull/13535) - - Returning boolean when removing sources and layers [#13428](https://github.com/mapbox/mapbox-gl-native/pull/13428) - - Telemetry v4.1.1 bump [#13499](https://github.com/mapbox/mapbox-gl-native/pull/13499) - - mapbox-java 4.2.0 bump [#13507](https://github.com/mapbox/mapbox-gl-native/pull/13507) + +- Style builder and Style.java [#13484](https://github.com/mapbox/mapbox-gl-native/pull/13484) +- LatLng bounds cannot be wrapped [#13419](https://github.com/mapbox/mapbox-gl-native/pull/13419) +- Expose endpoint change option for snapshotter [#13508](https://github.com/mapbox/mapbox-gl-native/pull/13508) +- Formatted "text-field" property setter [#13358](https://github.com/mapbox/mapbox-gl-native/pull/13358) +- Expose setAccesToken on Mapbox.java [#13397](https://github.com/mapbox/mapbox-gl-native/pull/13397) +- Immediately notify core about forced connectivity state [#13485](https://github.com/mapbox/mapbox-gl-native/pull/13485) +- Handle transition duration of 0ms for symbols [#13535](https://github.com/mapbox/mapbox-gl-native/pull/13535) +- Returning boolean when removing sources and layers [#13428](https://github.com/mapbox/mapbox-gl-native/pull/13428) +- Telemetry v4.1.1 bump [#13499](https://github.com/mapbox/mapbox-gl-native/pull/13499) +- mapbox-java 4.2.0 bump [#13507](https://github.com/mapbox/mapbox-gl-native/pull/13507) ## 7.0.0-alpha.3 - November 30, 2018 - - Add `fill-extrusion-vertical-gradient` fill paint property [#13463](https://github.com/mapbox/mapbox-gl-native/pull/13463) - - Don't cancel core transitions on MotionEvent#ACTION_CANCEL [#13465](https://github.com/mapbox/mapbox-gl-native/pull/13465) - - Require context in AttributionParser.Options [#13444](https://github.com/mapbox/mapbox-gl-native/pull/13444) - - Deprecated annotations package [#13468](https://github.com/mapbox/mapbox-gl-native/pull/13468) - - Send turnstile event while create MapSnapshotter instance [#13475](https://github.com/mapbox/mapbox-gl-native/pull/13475) - - Remove default zoom level restrictions when activating the location component [#13425](https://github.com/mapbox/mapbox-gl-native/pull/13425) + +- Add `fill-extrusion-vertical-gradient` fill paint property [#13463](https://github.com/mapbox/mapbox-gl-native/pull/13463) +- Don't cancel core transitions on MotionEvent#ACTION_CANCEL [#13465](https://github.com/mapbox/mapbox-gl-native/pull/13465) +- Require context in AttributionParser.Options [#13444](https://github.com/mapbox/mapbox-gl-native/pull/13444) +- Deprecated annotations package [#13468](https://github.com/mapbox/mapbox-gl-native/pull/13468) +- Send turnstile event while create MapSnapshotter instance [#13475](https://github.com/mapbox/mapbox-gl-native/pull/13475) +- Remove default zoom level restrictions when activating the location component [#13425](https://github.com/mapbox/mapbox-gl-native/pull/13425) ## 6.7.2 - November 30, 2018 - - Telemetry v3.5.6 [#13486](https://github.com/mapbox/mapbox-gl-native/pull/13486) - - Add "localIdeographFontFamily" setting to MapSnapshotter to reduce font data usage while snapshotting CJK maps [#13427](https://github.com/mapbox/mapbox-gl-native/pull/13427) - - Send turnstile event while creating MapSnapshotter instance [#13475](https://github.com/mapbox/mapbox-gl-native/pull/13475) + +- Telemetry v3.5.6 [#13486](https://github.com/mapbox/mapbox-gl-native/pull/13486) +- Add "localIdeographFontFamily" setting to MapSnapshotter to reduce font data usage while snapshotting CJK maps [#13427](https://github.com/mapbox/mapbox-gl-native/pull/13427) +- Send turnstile event while creating MapSnapshotter instance [#13475](https://github.com/mapbox/mapbox-gl-native/pull/13475) ## 7.0.0-alpha.2 - November 21, 2018 - - Add overlay example with custom drawing using paint and canvas [#13431](https://github.com/mapbox/mapbox-gl-native/pull/13431) - - Use --info argument to show details during test run [#13415](https://github.com/mapbox/mapbox-gl-native/pull/13415) - - Add specific name logging in failure scenarios of PropertyValue [#13409](https://github.com/mapbox/mapbox-gl-native/pull/13409) - - Fixed constant layer filter [#13406](https://github.com/mapbox/mapbox-gl-native/pull/13406) - - Update map feedback URL [#13396](https://github.com/mapbox/mapbox-gl-native/pull/13396) - - Use locale sensitive DecimalFormat for color alpha conversion [#13393](https://github.com/mapbox/mapbox-gl-native/pull/13393) - - Fixed `{prefix}` in tile resource URLs [#13429](https://github.com/mapbox/mapbox-gl-native/pull/13429) + +- Add overlay example with custom drawing using paint and canvas [#13431](https://github.com/mapbox/mapbox-gl-native/pull/13431) +- Use --info argument to show details during test run [#13415](https://github.com/mapbox/mapbox-gl-native/pull/13415) +- Add specific name logging in failure scenarios of PropertyValue [#13409](https://github.com/mapbox/mapbox-gl-native/pull/13409) +- Fixed constant layer filter [#13406](https://github.com/mapbox/mapbox-gl-native/pull/13406) +- Update map feedback URL [#13396](https://github.com/mapbox/mapbox-gl-native/pull/13396) +- Use locale sensitive DecimalFormat for color alpha conversion [#13393](https://github.com/mapbox/mapbox-gl-native/pull/13393) +- Fixed `{prefix}` in tile resource URLs [#13429](https://github.com/mapbox/mapbox-gl-native/pull/13429) ## 6.7.1 - November 16, 2018 - - Telemetry v3.5.4 [#13330](https://github.com/mapbox/mapbox-gl-native/pull/13330) + +- Telemetry v3.5.4 [#13330](https://github.com/mapbox/mapbox-gl-native/pull/13330) ## 7.0.0-alpha.1 - November 14, 2018 - - Added Nullable and NonNull annotations [#13274](https://github.com/mapbox/mapbox-gl-native/pull/13274) - - Catch and re-throw throwables thrown inside map state callbacks [#13351](https://github.com/mapbox/mapbox-gl-native/pull/13351) - - Removed deprecated code and notices [#13244](https://github.com/mapbox/mapbox-gl-native/pull/13244) - - Update to mapbox java services 4.1.0 [#13357](https://github.com/mapbox/mapbox-gl-native/pull/13357) - - Removed deprecated color conversion from PropertyFactory [#13337](https://github.com/mapbox/mapbox-gl-native/pull/13337) - - Removed deprecated OnMapChange interface and implementation [#13240](https://github.com/mapbox/mapbox-gl-native/pull/13240) - - Cleanup isDismissible flag [#13197](https://github.com/mapbox/mapbox-gl-native/pull/13179) - - Removed java 8 language features [#13193](https://github.com/mapbox/mapbox-gl-native/pull/13193) - - Removed ZoomButtonsController support [#13198](https://github.com/mapbox/mapbox-gl-native/pull/13198) - - Changed CustomGeometrySource() signature to be Kotlin friendly [#13178](https://github.com/mapbox/mapbox-gl-native/pull/13178) - - Removed ILatLng and IProjectedMeteres [#13176](https://github.com/mapbox/mapbox-gl-native/pull/13176) - - Option to consume map clicks, consuming location clicks [#13205](https://github.com/mapbox/mapbox-gl-native/pull/13205) - - Consolidated OfflineRegionDefinitions [#13180](https://github.com/mapbox/mapbox-gl-native/pull/13180) - - Added scrollBy() to MapboxMap, depricated CameraUpdate.scrollBy() [#13223](https://github.com/mapbox/mapbox-gl-native/pull/13223) - - Improved CustomGeometrySource constructor typing [#13200](https://github.com/mapbox/mapbox-gl-native/pull/13200) - - Removed deprecated MarkerView[#13194](https://github.com/mapbox/mapbox-gl-native/pull/13194) - - Annotate onMapReady with @NonNull [#13307](https://github.com/mapbox/mapbox-gl-native/pull/13307) + +- Added Nullable and NonNull annotations [#13274](https://github.com/mapbox/mapbox-gl-native/pull/13274) +- Catch and re-throw throwables thrown inside map state callbacks [#13351](https://github.com/mapbox/mapbox-gl-native/pull/13351) +- Removed deprecated code and notices [#13244](https://github.com/mapbox/mapbox-gl-native/pull/13244) +- Update to mapbox java services 4.1.0 [#13357](https://github.com/mapbox/mapbox-gl-native/pull/13357) +- Removed deprecated color conversion from PropertyFactory [#13337](https://github.com/mapbox/mapbox-gl-native/pull/13337) +- Removed deprecated OnMapChange interface and implementation [#13240](https://github.com/mapbox/mapbox-gl-native/pull/13240) +- Cleanup isDismissible flag [#13197](https://github.com/mapbox/mapbox-gl-native/pull/13179) +- Removed java 8 language features [#13193](https://github.com/mapbox/mapbox-gl-native/pull/13193) +- Removed ZoomButtonsController support [#13198](https://github.com/mapbox/mapbox-gl-native/pull/13198) +- Changed CustomGeometrySource() signature to be Kotlin friendly [#13178](https://github.com/mapbox/mapbox-gl-native/pull/13178) +- Removed ILatLng and IProjectedMeteres [#13176](https://github.com/mapbox/mapbox-gl-native/pull/13176) +- Option to consume map clicks, consuming location clicks [#13205](https://github.com/mapbox/mapbox-gl-native/pull/13205) +- Consolidated OfflineRegionDefinitions [#13180](https://github.com/mapbox/mapbox-gl-native/pull/13180) +- Added scrollBy() to MapboxMap, depricated CameraUpdate.scrollBy() [#13223](https://github.com/mapbox/mapbox-gl-native/pull/13223) +- Improved CustomGeometrySource constructor typing [#13200](https://github.com/mapbox/mapbox-gl-native/pull/13200) +- Removed deprecated MarkerView[#13194](https://github.com/mapbox/mapbox-gl-native/pull/13194) +- Annotate onMapReady with @NonNull [#13307](https://github.com/mapbox/mapbox-gl-native/pull/13307) ## 6.6.7 - November 8, 2018 - - Telemetry v3.5.4 [#13330](https://github.com/mapbox/mapbox-gl-native/pull/13330) + +- Telemetry v3.5.4 [#13330](https://github.com/mapbox/mapbox-gl-native/pull/13330) ## 6.6.6 - November 8, 2018 - - This release should be skipped in favor of the `v6.6.7`. + +- This release should be skipped in favor of the `v6.6.7`. ## 6.7.0 - November 7, 2018 - - Handle null getMapAsync invocations, deliver onMapReady only once [#13301](https://github.com/mapbox/mapbox-gl-native/pull/13301) - - Verify if `text-field` is not null before performing compatibility operations [#13294](https://github.com/mapbox/mapbox-gl-native/pull/13294) - - Log Java exception and fail silently instead of throwing a native exception in the map state callbacks[#13294](https://github.com/mapbox/mapbox-gl-native/pull/13294) - - Reintroduce OnMapChange invocation [#13289](https://github.com/mapbox/mapbox-gl-native/pull/13289) - - Null-check nativeMapView in case it's destroyed [#13281](https://github.com/mapbox/mapbox-gl-native/pull/13281) + +- Handle null getMapAsync invocations, deliver onMapReady only once [#13301](https://github.com/mapbox/mapbox-gl-native/pull/13301) +- Verify if `text-field` is not null before performing compatibility operations [#13294](https://github.com/mapbox/mapbox-gl-native/pull/13294) +- Log Java exception and fail silently instead of throwing a native exception in the map state callbacks[#13294](https://github.com/mapbox/mapbox-gl-native/pull/13294) +- Reintroduce OnMapChange invocation [#13289](https://github.com/mapbox/mapbox-gl-native/pull/13289) +- Null-check nativeMapView in case it's destroyed [#13281](https://github.com/mapbox/mapbox-gl-native/pull/13281) ## 6.6.5 - November 2, 2018 - - Telemetry v3.5.2 [#13258](https://github.com/mapbox/mapbox-gl-native/pull/13258) + +- Telemetry v3.5.2 [#13258](https://github.com/mapbox/mapbox-gl-native/pull/13258) ## 6.6.4 - November 1, 2018 - - Fix crash with non AppCompatActivities [#13222](https://github.com/mapbox/mapbox-gl-native/pull/13222) - - Telemetry bump 3.5.1 [#13204](https://github.com/mapbox/mapbox-gl-native/pull/13204) - - Gestures library 0.3.0 [#13234](https://github.com/mapbox/mapbox-gl-native/pull/13234) + +- Fix crash with non AppCompatActivities [#13222](https://github.com/mapbox/mapbox-gl-native/pull/13222) +- Telemetry bump 3.5.1 [#13204](https://github.com/mapbox/mapbox-gl-native/pull/13204) +- Gestures library 0.3.0 [#13234](https://github.com/mapbox/mapbox-gl-native/pull/13234) ## 6.7.0-beta.1 - October 31, 2018 - - Remove map initialised check [#13224](https://github.com/mapbox/mapbox-gl-native/pull/13224) - - Upgrade GeoJSONVT to v6.6.2 [#13231](https://github.com/mapbox/mapbox-gl-native/pull/13231) - - Deliver OnMapReady at end of initialisation block [#13220](https://github.com/mapbox/mapbox-gl-native/pull/13220) - - Rework MapCallback to execute in correct order [#13203](https://github.com/mapbox/mapbox-gl-native/pull/13203) - - Deprecate map zoom button controller [#13197](https://github.com/mapbox/mapbox-gl-native/pull/13197) - - RenderState API [#13170](https://github.com/mapbox/mapbox-gl-native/pull/13170) - - Avoid wrapping longitude values at dateline [#13006](https://github.com/mapbox/mapbox-gl-native/pull/13006) + +- Remove map initialised check [#13224](https://github.com/mapbox/mapbox-gl-native/pull/13224) +- Upgrade GeoJSONVT to v6.6.2 [#13231](https://github.com/mapbox/mapbox-gl-native/pull/13231) +- Deliver OnMapReady at end of initialisation block [#13220](https://github.com/mapbox/mapbox-gl-native/pull/13220) +- Rework MapCallback to execute in correct order [#13203](https://github.com/mapbox/mapbox-gl-native/pull/13203) +- Deprecate map zoom button controller [#13197](https://github.com/mapbox/mapbox-gl-native/pull/13197) +- RenderState API [#13170](https://github.com/mapbox/mapbox-gl-native/pull/13170) +- Avoid wrapping longitude values at dateline [#13006](https://github.com/mapbox/mapbox-gl-native/pull/13006) ## 6.7.0-alpha.2 - October 24, 2018 - - Format expression support [#12985](https://github.com/mapbox/mapbox-gl-native/pull/12985) - - Remove view tree observer [#13133](https://github.com/mapbox/mapbox-gl-native/pull/13133) - - Revert infer nullity [#13147](https://github.com/mapbox/mapbox-gl-native/pull/13147) - - Add priorities to requests [#13019](https://github.com/mapbox/mapbox-gl-native/pull/13019) - - Avoid using and [#13135](https://github.com/mapbox/mapbox-gl-native/pull/13135) - - Introduce mgbl::RenderState [#13123](https://github.com/mapbox/mapbox-gl-native/pull/13123) - - Ensure queryRenderedFeatures accounts for icon-rotate [#13105](https://github.com/mapbox/mapbox-gl-native/pull/13105) - - Add 'putResourceForURL' for pre-warming ambient cache [#13119](https://github.com/mapbox/mapbox-gl-native/pull/13119) + +- Format expression support [#12985](https://github.com/mapbox/mapbox-gl-native/pull/12985) +- Remove view tree observer [#13133](https://github.com/mapbox/mapbox-gl-native/pull/13133) +- Revert infer nullity [#13147](https://github.com/mapbox/mapbox-gl-native/pull/13147) +- Add priorities to requests [#13019](https://github.com/mapbox/mapbox-gl-native/pull/13019) +- Avoid using and [#13135](https://github.com/mapbox/mapbox-gl-native/pull/13135) +- Introduce mgbl::RenderState [#13123](https://github.com/mapbox/mapbox-gl-native/pull/13123) +- Ensure queryRenderedFeatures accounts for icon-rotate [#13105](https://github.com/mapbox/mapbox-gl-native/pull/13105) +- Add 'putResourceForURL' for pre-warming ambient cache [#13119](https://github.com/mapbox/mapbox-gl-native/pull/13119) ## 6.6.2/6.6.3 - October 24, 2018 - - Remove requirement on vectorDrawables.useSupportLibrary [#13168](https://github.com/mapbox/mapbox-gl-native/pull/13168) - - File source deactivate called before callbacks [#13146](https://github.com/mapbox/mapbox-gl-native/pull/13168) + +- Remove requirement on vectorDrawables.useSupportLibrary [#13168](https://github.com/mapbox/mapbox-gl-native/pull/13168) +- File source deactivate called before callbacks [#13146](https://github.com/mapbox/mapbox-gl-native/pull/13168) ## 6.7.0-alpha.1 - October 17, 2018 - - Core format expression integration [#12624](https://github.com/mapbox/mapbox-gl-native/pull/12624) - - Remove obsolete catch block in getLayerAs [#13091](https://github.com/mapbox/mapbox-gl-native/pull/13091) - - Include Mapbox SDK Services proguard configuration [#13103](https://github.com/mapbox/mapbox-gl-native/pull/13103) - - Avoid printing exception for valid code path when loading FileSource [#13102](https://github.com/mapbox/mapbox-gl-native/pull/13102) - - Add equals, hashcode and toString to camera update types [#13089](https://github.com/mapbox/mapbox-gl-native/pull/13089) - - Infer nullity, optimise codebase for consumption by kotlin [#13071](https://github.com/mapbox/mapbox-gl-native/pull/13071) - - Replace OnMapchange with specific callbacks [#13050](https://github.com/mapbox/mapbox-gl-native/pull/13050) - - Offline region creation telemetry event [#12544](https://github.com/mapbox/mapbox-gl-native/pull/12544) + +- Core format expression integration [#12624](https://github.com/mapbox/mapbox-gl-native/pull/12624) +- Remove obsolete catch block in getLayerAs [#13091](https://github.com/mapbox/mapbox-gl-native/pull/13091) +- Include Mapbox SDK Services proguard configuration [#13103](https://github.com/mapbox/mapbox-gl-native/pull/13103) +- Avoid printing exception for valid code path when loading FileSource [#13102](https://github.com/mapbox/mapbox-gl-native/pull/13102) +- Add equals, hashcode and toString to camera update types [#13089](https://github.com/mapbox/mapbox-gl-native/pull/13089) +- Infer nullity, optimise codebase for consumption by kotlin [#13071](https://github.com/mapbox/mapbox-gl-native/pull/13071) +- Replace OnMapchange with specific callbacks [#13050](https://github.com/mapbox/mapbox-gl-native/pull/13050) +- Offline region creation telemetry event [#12544](https://github.com/mapbox/mapbox-gl-native/pull/12544) ## 6.6.1 - October 17, 2018 - - Use appcompat resource configuration for vector drawables [#13114](https://github.com/mapbox/mapbox-gl-native/pull/13114) - - Reverse order of prioritising shape vs marker click handling [#13059](https://github.com/mapbox/mapbox-gl-native/pull/13059) + +- Use appcompat resource configuration for vector drawables [#13114](https://github.com/mapbox/mapbox-gl-native/pull/13114) +- Reverse order of prioritising shape vs marker click handling [#13059](https://github.com/mapbox/mapbox-gl-native/pull/13059) ## 6.6.0 - October 11, 2018 - - Fixed an issue where fill and line layers would occasionally flicker on zoom [#12982](https://github.com/mapbox/mapbox-gl-native/pull/12982) + +- Fixed an issue where fill and line layers would occasionally flicker on zoom [#12982](https://github.com/mapbox/mapbox-gl-native/pull/12982) ## 6.6.0-beta.1 - October 3, 2018 - - Add configuration to change the animation duration multiplier when tracking location [#13011](https://github.com/mapbox/mapbox-gl-native/pull/13011) - - Move camera and puck immediately when starting to track and displacement is big [#13013](https://github.com/mapbox/mapbox-gl-native/pull/13013) + +- Add configuration to change the animation duration multiplier when tracking location [#13011](https://github.com/mapbox/mapbox-gl-native/pull/13011) +- Move camera and puck immediately when starting to track and displacement is big [#13013](https://github.com/mapbox/mapbox-gl-native/pull/13013) ## 6.6.0-alpha.2 - September 26, 2018 - - Expose offline database merge API [#12860](https://github.com/mapbox/mapbox-gl-native/pull/12860) - - Remove unnecessary camera callbacks loops [#12973](https://github.com/mapbox/mapbox-gl-native/pull/12973) - - Fix an issue where `OnCameraMoveListener#onCameraMove` would not get invoked while using `LocationComponent` [#12932](https://github.com/mapbox/mapbox-gl-native/pull/12932) - - Try not to re-draw tiles when coming back from background [#12844](https://github.com/mapbox/mapbox-gl-native/pull/12844) - - Proguard config revision [#12929](https://github.com/mapbox/mapbox-gl-native/pull/12929) - - Improve compatibility of offline packs between devices [#12933](https://github.com/mapbox/mapbox-gl-native/pull/12933) - - Update telemetry dependency to 3.2.1 [#12974](https://github.com/mapbox/mapbox-gl-native/pull/12974) - - Fix an issue where some tiles weren't rendered correctly when no internet connectivity was available [#12931](https://github.com/mapbox/mapbox-gl-native/pull/12931) + +- Expose offline database merge API [#12860](https://github.com/mapbox/mapbox-gl-native/pull/12860) +- Remove unnecessary camera callbacks loops [#12973](https://github.com/mapbox/mapbox-gl-native/pull/12973) +- Fix an issue where `OnCameraMoveListener#onCameraMove` would not get invoked while using `LocationComponent` [#12932](https://github.com/mapbox/mapbox-gl-native/pull/12932) +- Try not to re-draw tiles when coming back from background [#12844](https://github.com/mapbox/mapbox-gl-native/pull/12844) +- Proguard config revision [#12929](https://github.com/mapbox/mapbox-gl-native/pull/12929) +- Improve compatibility of offline packs between devices [#12933](https://github.com/mapbox/mapbox-gl-native/pull/12933) +- Update telemetry dependency to 3.2.1 [#12974](https://github.com/mapbox/mapbox-gl-native/pull/12974) +- Fix an issue where some tiles weren't rendered correctly when no internet connectivity was available [#12931](https://github.com/mapbox/mapbox-gl-native/pull/12931) ## 6.6.0-alpha.1 - September 19, 2018 - - Merge LocationLayerPlugin to the Maps SDK [#12786](https://github.com/mapbox/mapbox-gl-native/pull/12786) - - Add `symbol-z-order` symbol layout property to style spec [#12783](https://github.com/mapbox/mapbox-gl-native/pull/12783) - - Add "crossSourceCollisions" map option [#12842](https://github.com/mapbox/mapbox-gl-native/pull/12842) - - "is-supported-script" expression support [#12845](https://github.com/mapbox/mapbox-gl-native/pull/12845) - - Update isEmulator check [#12832](https://github.com/mapbox/mapbox-gl-native/pull/12832) - - Prevent crash when expression evaluates to default, no pattern [#12896](https://github.com/mapbox/mapbox-gl-native/pull/12896) - - Fixed bugs in coercion expression operators ("to-array" applied to empty arrays, "to-color" applied to colors, and "to-number" applied to null) [#12864](https://github.com/mapbox/mapbox-gl-native/pull/12864) - - Update proguard config to not warn about AutoValue [#12920](https://github.com/mapbox/mapbox-gl-native/pull/12920) - - Remove nunicode from android binding [#12497](https://github.com/mapbox/mapbox-gl-native/pull/12497) - - Correct LatLngBounds exception message [#12816](https://github.com/mapbox/mapbox-gl-native/pull/12816) + +- Merge LocationLayerPlugin to the Maps SDK [#12786](https://github.com/mapbox/mapbox-gl-native/pull/12786) +- Add `symbol-z-order` symbol layout property to style spec [#12783](https://github.com/mapbox/mapbox-gl-native/pull/12783) +- Add "crossSourceCollisions" map option [#12842](https://github.com/mapbox/mapbox-gl-native/pull/12842) +- "is-supported-script" expression support [#12845](https://github.com/mapbox/mapbox-gl-native/pull/12845) +- Update isEmulator check [#12832](https://github.com/mapbox/mapbox-gl-native/pull/12832) +- Prevent crash when expression evaluates to default, no pattern [#12896](https://github.com/mapbox/mapbox-gl-native/pull/12896) +- Fixed bugs in coercion expression operators ("to-array" applied to empty arrays, "to-color" applied to colors, and "to-number" applied to null) [#12864](https://github.com/mapbox/mapbox-gl-native/pull/12864) +- Update proguard config to not warn about AutoValue [#12920](https://github.com/mapbox/mapbox-gl-native/pull/12920) +- Remove nunicode from android binding [#12497](https://github.com/mapbox/mapbox-gl-native/pull/12497) +- Correct LatLngBounds exception message [#12816](https://github.com/mapbox/mapbox-gl-native/pull/12816) ## 6.5.0 - September 11, 2018 - - Fixed a cubic-bezier interpolation bug. [#12812](https://github.com/mapbox/mapbox-gl-native/issues/12812) - - Fixed an issue that could cause "allow-overlap" symbols to fade in during pan operations instead of always showing. [#12683](https://github.com/mapbox/mapbox-gl-native/issues/12683) + +- Fixed a cubic-bezier interpolation bug. [#12812](https://github.com/mapbox/mapbox-gl-native/issues/12812) +- Fixed an issue that could cause "allow-overlap" symbols to fade in during pan operations instead of always showing. [#12683](https://github.com/mapbox/mapbox-gl-native/issues/12683) ## 6.5.0-beta.1 - September 5, 2018 - - Retain shared thread pool reference [#12811](https://github.com/mapbox/mapbox-gl-native/pull/12811) - - MapStrictMode configuration [#12817](https://github.com/mapbox/mapbox-gl-native/pull/12817) - - Provide correct expression integration for newly created properties [#12809](https://github.com/mapbox/mapbox-gl-native/pull/12809) - - Get source id for supported layer types [#12801](https://github.com/mapbox/mapbox-gl-native/pull/12801) - - Check if map is destroyed before saving state in a fragment [#12804](https://github.com/mapbox/mapbox-gl-native/pull/12804) - - Bump leak canary to 1.6.1 [#12767](https://github.com/mapbox/mapbox-gl-native/pull/12767) - - Add quotes to string representation of string literal [#12768](https://github.com/mapbox/mapbox-gl-native/pull/12768) - - Make improve this map translatable [#12785](https://github.com/mapbox/mapbox-gl-native/pull/12785) - - Add Keep annotation to abstract components [#12796](https://github.com/mapbox/mapbox-gl-native/pull/12796) - - Gradle tools 3.1.4 [#12795](https://github.com/mapbox/mapbox-gl-native/pull/12795) - - Explicitly remove local references [#12774](https://github.com/mapbox/mapbox-gl-native/pull/12774) - - Add more languages to tx config file [#12719](https://github.com/mapbox/mapbox-gl-native/pull/12719) - - Add support for feature expressions in `line-pattern`, `fill-pattern`, and `fill-extrusion-pattern` properties. [#12284](https://github.com/mapbox/mapbox-gl-native/pull/12284) + +- Retain shared thread pool reference [#12811](https://github.com/mapbox/mapbox-gl-native/pull/12811) +- MapStrictMode configuration [#12817](https://github.com/mapbox/mapbox-gl-native/pull/12817) +- Provide correct expression integration for newly created properties [#12809](https://github.com/mapbox/mapbox-gl-native/pull/12809) +- Get source id for supported layer types [#12801](https://github.com/mapbox/mapbox-gl-native/pull/12801) +- Check if map is destroyed before saving state in a fragment [#12804](https://github.com/mapbox/mapbox-gl-native/pull/12804) +- Bump leak canary to 1.6.1 [#12767](https://github.com/mapbox/mapbox-gl-native/pull/12767) +- Add quotes to string representation of string literal [#12768](https://github.com/mapbox/mapbox-gl-native/pull/12768) +- Make improve this map translatable [#12785](https://github.com/mapbox/mapbox-gl-native/pull/12785) +- Add Keep annotation to abstract components [#12796](https://github.com/mapbox/mapbox-gl-native/pull/12796) +- Gradle tools 3.1.4 [#12795](https://github.com/mapbox/mapbox-gl-native/pull/12795) +- Explicitly remove local references [#12774](https://github.com/mapbox/mapbox-gl-native/pull/12774) +- Add more languages to tx config file [#12719](https://github.com/mapbox/mapbox-gl-native/pull/12719) +- Add support for feature expressions in `line-pattern`, `fill-pattern`, and `fill-extrusion-pattern` properties. [#12284](https://github.com/mapbox/mapbox-gl-native/pull/12284) ## 6.5.0-alpha.2 - August 29, 2018 - - Keep arbitrary region fields and constructor of OfflineGeometryRegionDefinition while obfuscating [#12734](https://github.com/mapbox/mapbox-gl-native/pull/12734) - - Modularise the SDK [#12468](https://github.com/mapbox/mapbox-gl-native/pull/12468) - - Invalidate InfoWindow's y offset when content is set [#12715](https://github.com/mapbox/mapbox-gl-native/pull/12715) - - Synchronize and coalesce requests targeting the same TileID in the CustomGeometrySource [#12509](https://github.com/mapbox/mapbox-gl-native/pull/12509) - - Line gradient support [#12575](https://github.com/mapbox/mapbox-gl-native/pull/12575) + +- Keep arbitrary region fields and constructor of OfflineGeometryRegionDefinition while obfuscating [#12734](https://github.com/mapbox/mapbox-gl-native/pull/12734) +- Modularise the SDK [#12468](https://github.com/mapbox/mapbox-gl-native/pull/12468) +- Invalidate InfoWindow's y offset when content is set [#12715](https://github.com/mapbox/mapbox-gl-native/pull/12715) +- Synchronize and coalesce requests targeting the same TileID in the CustomGeometrySource [#12509](https://github.com/mapbox/mapbox-gl-native/pull/12509) +- Line gradient support [#12575](https://github.com/mapbox/mapbox-gl-native/pull/12575) ## 6.5.0-alpha.1 - August 22, 2018 - - Don't default-show text/icons that depend on the placement of a paired icon/text [#12483](https://github.com/mapbox/mapbox-gl-native/issues/12483) - - Fix symbol querying for markers near tile boundaries at high zoom. ([#12472](https://github.com/mapbox/mapbox-gl-native/issues/12472)) - - Hide peer constructors [#12639](https://github.com/mapbox/mapbox-gl-native/pull/12639) - - Shutting down thread pool of the CustomGeometrySource when the source is destroyed [#12517](https://github.com/mapbox/mapbox-gl-native/pull/12517) - - Harden offline database [#12224](https://github.com/mapbox/mapbox-gl-native/pull/12224) - - Obtain paths to file directories on a worker thread [#12657](https://github.com/mapbox/mapbox-gl-native/pull/12657) - - Arbitrary offline region shapes [#11447](https://github.com/mapbox/mapbox-gl-native/pull/11447) - - Make AndroidRendererFrontend to request render once per event loop [#12586](https://github.com/mapbox/mapbox-gl-native/issues/12586) - - Converting GeoJsonSource features asynchronously [#12580](https://github.com/mapbox/mapbox-gl-native/pull/12580) - - StyleJson configuration on MapboxMapOptions [#12664](https://github.com/mapbox/mapbox-gl-native/pull/12664) - - Update MapInitializer for OfflineRegionDefinition [#12686](https://github.com/mapbox/mapbox-gl-native/pull/12686) - - Offline symbol render example using AssetFileSource [#12676](https://github.com/mapbox/mapbox-gl-native/pull/12676) - - Added Chinese translations [#12696](https://github.com/mapbox/mapbox-gl-native/pull/12696) - - Collator and resolved-locale expressions [#12688](https://github.com/mapbox/mapbox-gl-native/pull/12688) - - Update telemetry user-agent [#12706](https://github.com/mapbox/mapbox-gl-native/pull/12706) - - Replace hardcoded telemetry settings string with resources [#12707](https://github.com/mapbox/mapbox-gl-native/pull/12707) - - Update GeoJsonOptions javadoc [#12709](https://github.com/mapbox/mapbox-gl-native/pull/12709) + +- Don't default-show text/icons that depend on the placement of a paired icon/text [#12483](https://github.com/mapbox/mapbox-gl-native/issues/12483) +- Fix symbol querying for markers near tile boundaries at high zoom. ([#12472](https://github.com/mapbox/mapbox-gl-native/issues/12472)) +- Hide peer constructors [#12639](https://github.com/mapbox/mapbox-gl-native/pull/12639) +- Shutting down thread pool of the CustomGeometrySource when the source is destroyed [#12517](https://github.com/mapbox/mapbox-gl-native/pull/12517) +- Harden offline database [#12224](https://github.com/mapbox/mapbox-gl-native/pull/12224) +- Obtain paths to file directories on a worker thread [#12657](https://github.com/mapbox/mapbox-gl-native/pull/12657) +- Arbitrary offline region shapes [#11447](https://github.com/mapbox/mapbox-gl-native/pull/11447) +- Make AndroidRendererFrontend to request render once per event loop [#12586](https://github.com/mapbox/mapbox-gl-native/issues/12586) +- Converting GeoJsonSource features asynchronously [#12580](https://github.com/mapbox/mapbox-gl-native/pull/12580) +- StyleJson configuration on MapboxMapOptions [#12664](https://github.com/mapbox/mapbox-gl-native/pull/12664) +- Update MapInitializer for OfflineRegionDefinition [#12686](https://github.com/mapbox/mapbox-gl-native/pull/12686) +- Offline symbol render example using AssetFileSource [#12676](https://github.com/mapbox/mapbox-gl-native/pull/12676) +- Added Chinese translations [#12696](https://github.com/mapbox/mapbox-gl-native/pull/12696) +- Collator and resolved-locale expressions [#12688](https://github.com/mapbox/mapbox-gl-native/pull/12688) +- Update telemetry user-agent [#12706](https://github.com/mapbox/mapbox-gl-native/pull/12706) +- Replace hardcoded telemetry settings string with resources [#12707](https://github.com/mapbox/mapbox-gl-native/pull/12707) +- Update GeoJsonOptions javadoc [#12709](https://github.com/mapbox/mapbox-gl-native/pull/12709) ## 6.4.0 - August 15, 2018 - - Use unconverted bearing value for LatLngBounds calculation [#12616](https://github.com/mapbox/mapbox-gl-native/pull/12616) - - Store release so files with debugging information [#12628](https://github.com/mapbox/mapbox-gl-native/pull/12628) - - Close a security vulnerability introduced in v6.2.0 that would potentially allow the owner of a style to compromise apps loading that style. + +- Use unconverted bearing value for LatLngBounds calculation [#12616](https://github.com/mapbox/mapbox-gl-native/pull/12616) +- Store release so files with debugging information [#12628](https://github.com/mapbox/mapbox-gl-native/pull/12628) +- Close a security vulnerability introduced in v6.2.0 that would potentially allow the owner of a style to compromise apps loading that style. ## 6.4.0-beta.1 - August 9, 2018 - - Don't prefetch tiles for geojson sources [#12529](https://github.com/mapbox/mapbox-gl-native/pull/12529) - - Enable LTO in release builds [#12546](https://github.com/mapbox/mapbox-gl-native/pull/12546) - - Update Java Services to v3.4.0 [#12564](https://github.com/mapbox/mapbox-gl-native/pull/12564) - - Telemetry bump to 3.1.5 [#12589](https://github.com/mapbox/mapbox-gl-native/pull/12589) + +- Don't prefetch tiles for geojson sources [#12529](https://github.com/mapbox/mapbox-gl-native/pull/12529) +- Enable LTO in release builds [#12546](https://github.com/mapbox/mapbox-gl-native/pull/12546) +- Update Java Services to v3.4.0 [#12564](https://github.com/mapbox/mapbox-gl-native/pull/12564) +- Telemetry bump to 3.1.5 [#12589](https://github.com/mapbox/mapbox-gl-native/pull/12589) ## 6.4.0-alpha.2 - August 1, 2018 - - Compress shader source code [#12477](https://github.com/mapbox/mapbox-gl-native/pull/12477) - - Add minimal touch target to marker click detection [#12482](https://github.com/mapbox/mapbox-gl-native/pull/12482) - - Improve resulting APK size by using @Keep annotation [#12490](https://github.com/mapbox/mapbox-gl-native/pull/12490) - - Reuse Bitmap, Paint & Canvas instances in LocalGlyphRasterizer [#12488](https://github.com/mapbox/mapbox-gl-native/pull/12488) - - Remove black surface during map start up [#12377](https://github.com/mapbox/mapbox-gl-native/pull/12377) - - Corrected VisibleRegion on rotated map [#12255](https://github.com/mapbox/mapbox-gl-native/pull/12255) - - Tweak conversions to reduce binary size [#12511](https://github.com/mapbox/mapbox-gl-native/pull/12511) + +- Compress shader source code [#12477](https://github.com/mapbox/mapbox-gl-native/pull/12477) +- Add minimal touch target to marker click detection [#12482](https://github.com/mapbox/mapbox-gl-native/pull/12482) +- Improve resulting APK size by using @Keep annotation [#12490](https://github.com/mapbox/mapbox-gl-native/pull/12490) +- Reuse Bitmap, Paint & Canvas instances in LocalGlyphRasterizer [#12488](https://github.com/mapbox/mapbox-gl-native/pull/12488) +- Remove black surface during map start up [#12377](https://github.com/mapbox/mapbox-gl-native/pull/12377) +- Corrected VisibleRegion on rotated map [#12255](https://github.com/mapbox/mapbox-gl-native/pull/12255) +- Tweak conversions to reduce binary size [#12511](https://github.com/mapbox/mapbox-gl-native/pull/12511) ## 6.4.0-alpha.1 - July 25, 2018 - - Validate if gesture detector is able to handle gesture [#12375](https://github.com/mapbox/mapbox-gl-native/pull/12375) - - Add a convenience method to check whether the map is in a destroyed state, MapView#isDestroyed [#12373](https://github.com/mapbox/mapbox-gl-native/pull/12373) - - Add GeoJSON regression tests for java method look up from JNI [#12354](https://github.com/mapbox/mapbox-gl-native/pull/12354) - - Bump kotlin, timber and okhttp dependencies [#12393](https://github.com/mapbox/mapbox-gl-native/pull/12393) - - Harden map events creation [#12405](https://github.com/mapbox/mapbox-gl-native/pull/12405) - - Fix possibly race on undefined behavior [#12408](https://github.com/mapbox/mapbox-gl-native/pull/12408) - - Option to request the visible region restricted by the content padding [#12407](https://github.com/mapbox/mapbox-gl-native/pull/12407) - - Expose getMap [#12444](https://github.com/mapbox/mapbox-gl-native/pull/12444) - - Correct access token validation [#12458](https://github.com/mapbox/mapbox-gl-native/pull/12458) - - Port `symbol-placement: line-center` to native [#12337](https://github.com/mapbox/mapbox-gl-native/pull/12337) - - Token string syntax (`"{token}"`) in `SymbolLayer` `textField` and `iconImage` property values is now correctly converted to the appropriate expression equivalent. ([#11659](https://github.com/mapbox/mapbox-gl-native/issues/11659)) - - Fixed a crash when switching between two styles having layers with the same identifier but different layer types. ([#12432](https://github.com/mapbox/mapbox-gl-native/issues/12432)) + +- Validate if gesture detector is able to handle gesture [#12375](https://github.com/mapbox/mapbox-gl-native/pull/12375) +- Add a convenience method to check whether the map is in a destroyed state, MapView#isDestroyed [#12373](https://github.com/mapbox/mapbox-gl-native/pull/12373) +- Add GeoJSON regression tests for java method look up from JNI [#12354](https://github.com/mapbox/mapbox-gl-native/pull/12354) +- Bump kotlin, timber and okhttp dependencies [#12393](https://github.com/mapbox/mapbox-gl-native/pull/12393) +- Harden map events creation [#12405](https://github.com/mapbox/mapbox-gl-native/pull/12405) +- Fix possibly race on undefined behavior [#12408](https://github.com/mapbox/mapbox-gl-native/pull/12408) +- Option to request the visible region restricted by the content padding [#12407](https://github.com/mapbox/mapbox-gl-native/pull/12407) +- Expose getMap [#12444](https://github.com/mapbox/mapbox-gl-native/pull/12444) +- Correct access token validation [#12458](https://github.com/mapbox/mapbox-gl-native/pull/12458) +- Port `symbol-placement: line-center` to native [#12337](https://github.com/mapbox/mapbox-gl-native/pull/12337) +- Token string syntax (`"{token}"`) in `SymbolLayer` `textField` and `iconImage` property values is now correctly converted to the appropriate expression equivalent. ([#11659](https://github.com/mapbox/mapbox-gl-native/issues/11659)) +- Fixed a crash when switching between two styles having layers with the same identifier but different layer types. ([#12432](https://github.com/mapbox/mapbox-gl-native/issues/12432)) ## 6.3.0 - July 18, 2018 - - Harden map events creation [#12406](https://github.com/mapbox/mapbox-gl-native/pull/12406) + +- Harden map events creation [#12406](https://github.com/mapbox/mapbox-gl-native/pull/12406) ## 6.3.0-beta.1 - July 11, 2018 - - Fix JNI lookup of FeatureCollection, add regression test [#12344](https://github.com/mapbox/mapbox-gl-native/pull/12344) - - Added draggable marker example activity, add kotlin support to test app [@12326](https://github.com/mapbox/mapbox-gl-native/pull/12326) - - Telemetry bump to v3.1.4 [#12349](https://github.com/mapbox/mapbox-gl-native/pull/12349) - - Remove unnecessary memory use when collision debug mode is not enabled ([#12294](https://github.com/mapbox/mapbox-gl-native/issues/12294)) + +- Fix JNI lookup of FeatureCollection, add regression test [#12344](https://github.com/mapbox/mapbox-gl-native/pull/12344) +- Added draggable marker example activity, add kotlin support to test app [@12326](https://github.com/mapbox/mapbox-gl-native/pull/12326) +- Telemetry bump to v3.1.4 [#12349](https://github.com/mapbox/mapbox-gl-native/pull/12349) +- Remove unnecessary memory use when collision debug mode is not enabled ([#12294](https://github.com/mapbox/mapbox-gl-native/issues/12294)) ## 6.3.0-alpha.2 - July 5, 2018 - - Add LatLngForScreenCoordinate to MapSnapshotter API, This allows to convert a LatLng value to the x,y position on the MapSnasphot image [#12221](https://github.com/mapbox/mapbox-gl-native/pull/12221) - - Expose multiple getCameraFor equivalent methods to convert a geometry or a bounds to a camera position with taking in account padding, tilt and bearing [#12290](https://github.com/mapbox/mapbox-gl-native/pull/12290) - - Avoid race condition when calling getMapAsync from a non-UI thread when running instrumentation tests [#12308](https://github.com/mapbox/mapbox-gl-native/pull/12308) -## 6.2.1 - June 27, 2018 - - Backport range alpha values from 0 to 1 with int color conversion [#12235](https://github.com/mapbox/mapbox-gl-native/pull/12235) +- Add LatLngForScreenCoordinate to MapSnapshotter API, This allows to convert a LatLng value to the x,y position on the MapSnasphot image [#12221](https://github.com/mapbox/mapbox-gl-native/pull/12221) +- Expose multiple getCameraFor equivalent methods to convert a geometry or a bounds to a camera position with taking in account padding, tilt and bearing [#12290](https://github.com/mapbox/mapbox-gl-native/pull/12290) +- Avoid race condition when calling getMapAsync from a non-UI thread when running instrumentation tests [#12308](https://github.com/mapbox/mapbox-gl-native/pull/12308) + +## 6.2.1 - June 27, 2018 + +- Backport range alpha values from 0 to 1 with int color conversion [#12235](https://github.com/mapbox/mapbox-gl-native/pull/12235) ## 6.3.0-alpha.1 - June 27, 2018 - - Range alpha values from 0 to 1 with int color conversion [#12210](https://github.com/mapbox/mapbox-gl-native/pull/12210) - - Remove reflection lookup for MarkerViewAdapter intialisation [#12218](https://github.com/mapbox/mapbox-gl-native/pull/12218) - - GeoJSON clustering expressions logic change [#12211](https://github.com/mapbox/mapbox-gl-native/pull/12211) - - Add SDF support, allow template images to be tinted [#12181](https://github.com/mapbox/mapbox-gl-native/pull/12181) - - Add android licenses tool, update licenses [#12153](https://github.com/mapbox/mapbox-gl-native/pull/12153) + +- Range alpha values from 0 to 1 with int color conversion [#12210](https://github.com/mapbox/mapbox-gl-native/pull/12210) +- Remove reflection lookup for MarkerViewAdapter intialisation [#12218](https://github.com/mapbox/mapbox-gl-native/pull/12218) +- GeoJSON clustering expressions logic change [#12211](https://github.com/mapbox/mapbox-gl-native/pull/12211) +- Add SDF support, allow template images to be tinted [#12181](https://github.com/mapbox/mapbox-gl-native/pull/12181) +- Add android licenses tool, update licenses [#12153](https://github.com/mapbox/mapbox-gl-native/pull/12153) ## 6.2.0 - June 20, 2018 - - Remove support for Fabric [#12126](https://github.com/mapbox/mapbox-gl-native/pull/12126) - - Dispatch camera start callback only when actually moving [#12172](https://github.com/mapbox/mapbox-gl-native/pull/12172) + +- Remove support for Fabric [#12126](https://github.com/mapbox/mapbox-gl-native/pull/12126) +- Dispatch camera start callback only when actually moving [#12172](https://github.com/mapbox/mapbox-gl-native/pull/12172) ## 6.2.0-beta.3 - June 15, 2018 - - Always commit symbol placement [#12076](https://github.com/mapbox/mapbox-gl-native/pull/12076) - - Ceil map dimensions [#12116](https://github.com/mapbox/mapbox-gl-native/pull/12116) - - Fix match stop conversion [#12128](https://github.com/mapbox/mapbox-gl-native/pull/12128) - - Telemetry bump to v3.1.3 [#12156](https://github.com/mapbox/mapbox-gl-native/pull/12156) + +- Always commit symbol placement [#12076](https://github.com/mapbox/mapbox-gl-native/pull/12076) +- Ceil map dimensions [#12116](https://github.com/mapbox/mapbox-gl-native/pull/12116) +- Fix match stop conversion [#12128](https://github.com/mapbox/mapbox-gl-native/pull/12128) +- Telemetry bump to v3.1.3 [#12156](https://github.com/mapbox/mapbox-gl-native/pull/12156) ## 6.2.0-beta.2 - June 7, 2018 - - Ensure that camera is invalidated before generating telemetry event [#12042](https://github.com/mapbox/mapbox-gl-native/pull/12042) - - Offline download batches [#11284](https://github.com/mapbox/mapbox-gl-native/pull/11284) - - Parse Fragment's xml attributes [#12078](https://github.com/mapbox/mapbox-gl-native/pull/12078) + +- Ensure that camera is invalidated before generating telemetry event [#12042](https://github.com/mapbox/mapbox-gl-native/pull/12042) +- Offline download batches [#11284](https://github.com/mapbox/mapbox-gl-native/pull/11284) +- Parse Fragment's xml attributes [#12078](https://github.com/mapbox/mapbox-gl-native/pull/12078) ## 6.2.0-beta.1 - May 31, 2018 - - Bump mapbox-java to 3.2.0 [#12036](https://github.com/mapbox/mapbox-gl-native/pull/12036) - - Optional camera position for map snapshotter [#12028](https://github.com/mapbox/mapbox-gl-native/pull/12029) - - Expose enableOnUserRequest and disableOnUserRequest on Telemetry [#12024](https://github.com/mapbox/mapbox-gl-native/pull/12024) - - Add style json setter/getter to map snapshotter [#12031](https://github.com/mapbox/mapbox-gl-native/pull/12031) - - Fix literal wrapping in comparison expressions [#12022](https://github.com/mapbox/mapbox-gl-native/pull/12022) - - Null check access token in filesource initializer [#12023](https://github.com/mapbox/mapbox-gl-native/pull/12023) - - Allow literal expression property arguments [#12018](https://github.com/mapbox/mapbox-gl-native/pull/12018) - - Raw expression support [#12007](https://github.com/mapbox/mapbox-gl-native/pull/12007) + +- Bump mapbox-java to 3.2.0 [#12036](https://github.com/mapbox/mapbox-gl-native/pull/12036) +- Optional camera position for map snapshotter [#12028](https://github.com/mapbox/mapbox-gl-native/pull/12029) +- Expose enableOnUserRequest and disableOnUserRequest on Telemetry [#12024](https://github.com/mapbox/mapbox-gl-native/pull/12024) +- Add style json setter/getter to map snapshotter [#12031](https://github.com/mapbox/mapbox-gl-native/pull/12031) +- Fix literal wrapping in comparison expressions [#12022](https://github.com/mapbox/mapbox-gl-native/pull/12022) +- Null check access token in filesource initializer [#12023](https://github.com/mapbox/mapbox-gl-native/pull/12023) +- Allow literal expression property arguments [#12018](https://github.com/mapbox/mapbox-gl-native/pull/12018) +- Raw expression support [#12007](https://github.com/mapbox/mapbox-gl-native/pull/12007) ## 6.2.0-alpha.2 - May 25, 2018 - - UI Thread checking [#12000](https://github.com/mapbox/mapbox-gl-native/pull/12000) - - Don't force having an Mapbox access token [#12001](https://github.com/mapbox/mapbox-gl-native/pull/12001) - - Unknown tokens in URLs are now preserved, rather than replaced with an empty string [#11787](https://github.com/mapbox/mapbox-gl-native/issues/11787) - - Update onMapChange Listener javadoc [#11972](https://github.com/mapbox/mapbox-gl-native/pull/11972) - - Set Tile loaded/rendered instead of marking tile as optional [#11985](https://github.com/mapbox/mapbox-gl-native/pull/11985) - - Wrap glGetString in `MBGL_CHECK_ERROR` too [#11106](https://github.com/mapbox/mapbox-gl-native/pull/11106) - - Accept constant expression in non-dds properties [#11960](https://github.com/mapbox/mapbox-gl-native/pull/11960) - - Style JSON configuration in Snapshotter [#11976](https://github.com/mapbox/mapbox-gl-native/pull/11976) - - Remove mips and armeabi as supported ABI, update to NDK 17 [#11458](https://github.com/mapbox/mapbox-gl-native/pull/11458) - - Re-assign ids when lng jumps to avoid flicker [#11938](https://github.com/mapbox/mapbox-gl-native/pull/11938) - - Change modifier MapView#initialize to allow subclassing [#11969](https://github.com/mapbox/mapbox-gl-native/pull/11969) - - Avoid symbol flickering when longitude is wrapped [#11938](https://github.com/mapbox/mapbox-gl-native/pull/11938) - - Fix hang when parsing very large angles for hue in hsl colors [#11968](https://github.com/mapbox/mapbox-gl-native/pull/11968) - - Clamp TileJSON.bounds latitudes to [-90, 90] [#11964](https://github.com/mapbox/mapbox-gl-native/pull/11964) - - Align URL token replacement with GL-JS [#11953](https://github.com/mapbox/mapbox-gl-native/pull/11953) - - Align match behaviour [#11935](https://github.com/mapbox/mapbox-gl-native/pull/11935) + +- UI Thread checking [#12000](https://github.com/mapbox/mapbox-gl-native/pull/12000) +- Don't force having an Mapbox access token [#12001](https://github.com/mapbox/mapbox-gl-native/pull/12001) +- Unknown tokens in URLs are now preserved, rather than replaced with an empty string [#11787](https://github.com/mapbox/mapbox-gl-native/issues/11787) +- Update onMapChange Listener javadoc [#11972](https://github.com/mapbox/mapbox-gl-native/pull/11972) +- Set Tile loaded/rendered instead of marking tile as optional [#11985](https://github.com/mapbox/mapbox-gl-native/pull/11985) +- Wrap glGetString in `MBGL_CHECK_ERROR` too [#11106](https://github.com/mapbox/mapbox-gl-native/pull/11106) +- Accept constant expression in non-dds properties [#11960](https://github.com/mapbox/mapbox-gl-native/pull/11960) +- Style JSON configuration in Snapshotter [#11976](https://github.com/mapbox/mapbox-gl-native/pull/11976) +- Remove mips and armeabi as supported ABI, update to NDK 17 [#11458](https://github.com/mapbox/mapbox-gl-native/pull/11458) +- Re-assign ids when lng jumps to avoid flicker [#11938](https://github.com/mapbox/mapbox-gl-native/pull/11938) +- Change modifier MapView#initialize to allow subclassing [#11969](https://github.com/mapbox/mapbox-gl-native/pull/11969) +- Avoid symbol flickering when longitude is wrapped [#11938](https://github.com/mapbox/mapbox-gl-native/pull/11938) +- Fix hang when parsing very large angles for hue in hsl colors [#11968](https://github.com/mapbox/mapbox-gl-native/pull/11968) +- Clamp TileJSON.bounds latitudes to [-90, 90] [#11964](https://github.com/mapbox/mapbox-gl-native/pull/11964) +- Align URL token replacement with GL-JS [#11953](https://github.com/mapbox/mapbox-gl-native/pull/11953) +- Align match behaviour [#11935](https://github.com/mapbox/mapbox-gl-native/pull/11935) ## 6.1.3 - May 23, 2018 - - Circle querying fixes [#11571](https://github.com/mapbox/mapbox-gl-native/pull/11571) - - Global symbol query [#11742](https://github.com/mapbox/mapbox-gl-native/pull/11742) - - Change MapView#initialize modifier to allow overriding [#11969](https://github.com/mapbox/mapbox-gl-native/pull/11969) - - Update telemetry to 3.1.2 [#11987](https://github.com/mapbox/mapbox-gl-native/pull/11987) + +- Circle querying fixes [#11571](https://github.com/mapbox/mapbox-gl-native/pull/11571) +- Global symbol query [#11742](https://github.com/mapbox/mapbox-gl-native/pull/11742) +- Change MapView#initialize modifier to allow overriding [#11969](https://github.com/mapbox/mapbox-gl-native/pull/11969) +- Update telemetry to 3.1.2 [#11987](https://github.com/mapbox/mapbox-gl-native/pull/11987) ## 6.1.2 - May 18, 2018 - - Update telemetry to 3.1.1 [#11942](https://github.com/mapbox/mapbox-gl-native/pull/11942) + +- Update telemetry to 3.1.1 [#11942](https://github.com/mapbox/mapbox-gl-native/pull/11942) ## 6.2.0-alpha.1 - May 17, 2018 - - `"to-string"` expression operator converts `null` to empty string rather than to `"null"` [#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904) - - Expose MapView#setOfflineRegion [#1922](https://github.com/mapbox/mapbox-gl-native/pull/11922) - - Add nullability annotations to public API for kotlin language integration [#11925](https://github.com/mapbox/mapbox-gl-native/pull/11925) - - Expose MapView created callbacks on MapFragment and SupportMapFragment [#11934](https://github.com/mapbox/mapbox-gl-native/pull/11934) - - Update mapbox-java to 3.1.0 [#11916](https://github.com/mapbox/mapbox-gl-native/pull/11916) + +- `"to-string"` expression operator converts `null` to empty string rather than to `"null"` [#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904) +- Expose MapView#setOfflineRegion [#1922](https://github.com/mapbox/mapbox-gl-native/pull/11922) +- Add nullability annotations to public API for kotlin language integration [#11925](https://github.com/mapbox/mapbox-gl-native/pull/11925) +- Expose MapView created callbacks on MapFragment and SupportMapFragment [#11934](https://github.com/mapbox/mapbox-gl-native/pull/11934) +- Update mapbox-java to 3.1.0 [#11916](https://github.com/mapbox/mapbox-gl-native/pull/11916) ## 6.1.1 - May 7, 2018 - - Update telemetry to 3.1.0 [#11855](https://github.com/mapbox/mapbox-gl-native/pull/11855) + +- Update telemetry to 3.1.0 [#11855](https://github.com/mapbox/mapbox-gl-native/pull/11855) ## 6.1.0 - May 4, 2018 - - Unwrap LatLngBounds during JNI conversion [#11807](https://github.com/mapbox/mapbox-gl-native/pull/11807) - - Check if renderer is not destroyed before delivering snapshot [#11800](https://github.com/mapbox/mapbox-gl-native/pull/11800) - - Null-check source before removing [#11789](https://github.com/mapbox/mapbox-gl-native/pull/11789) - - Flutter support: promote pixel-ratio to public API NativeMapView [#11772](https://github.com/mapbox/mapbox-gl-native/pull/11772) - - Unwrap LatLngBounds for the shortest path when requesting camera [#11759](https://github.com/mapbox/mapbox-gl-native/pull/11759) - - Flutter support: integrate view callback abstraction [#11706](https://github.com/mapbox/mapbox-gl-native/pull/11706) - - Match expression doc tweaks [#11691](https://github.com/mapbox/mapbox-gl-native/pull/11691) - - Improve stop javadoc to include interpolate [#11677](https://github.com/mapbox/mapbox-gl-native/pull/11677) - - Reduce per-frame render CPU time [#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811) - - Add Korean localization [#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792) - - Add Danish localization; update Hungarian, Russian, Swedish translations [#11136](https://github.com/mapbox/mapbox-gl-native/pull/11136) + +- Unwrap LatLngBounds during JNI conversion [#11807](https://github.com/mapbox/mapbox-gl-native/pull/11807) +- Check if renderer is not destroyed before delivering snapshot [#11800](https://github.com/mapbox/mapbox-gl-native/pull/11800) +- Null-check source before removing [#11789](https://github.com/mapbox/mapbox-gl-native/pull/11789) +- Flutter support: promote pixel-ratio to public API NativeMapView [#11772](https://github.com/mapbox/mapbox-gl-native/pull/11772) +- Unwrap LatLngBounds for the shortest path when requesting camera [#11759](https://github.com/mapbox/mapbox-gl-native/pull/11759) +- Flutter support: integrate view callback abstraction [#11706](https://github.com/mapbox/mapbox-gl-native/pull/11706) +- Match expression doc tweaks [#11691](https://github.com/mapbox/mapbox-gl-native/pull/11691) +- Improve stop javadoc to include interpolate [#11677](https://github.com/mapbox/mapbox-gl-native/pull/11677) +- Reduce per-frame render CPU time [#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811) +- Add Korean localization [#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792) +- Add Danish localization; update Hungarian, Russian, Swedish translations [#11136](https://github.com/mapbox/mapbox-gl-native/pull/11136) ## 5.5.3 - May 4, 2018 - - Check if renderer is not destroyed before delivering snapshot [#11800](https://github.com/mapbox/mapbox-gl-native/pull/11800) + +- Check if renderer is not destroyed before delivering snapshot [#11800](https://github.com/mapbox/mapbox-gl-native/pull/11800) ## 6.0.1 - April 17, 2018 - - Bump telemetry version to 3.0.2 [#11710](https://github.com/mapbox/mapbox-gl-native/pull/11710) + +- Bump telemetry version to 3.0.2 [#11710](https://github.com/mapbox/mapbox-gl-native/pull/11710) ## 6.0.0 - April 17, 2018 - - Bump telemetry version to 3.0.1 [#11700](https://github.com/mapbox/mapbox-gl-native/pull/11700) - - Update layer when changing its min/max zoom [#11687](https://github.com/mapbox/mapbox-gl-native/pull/11687) + +- Bump telemetry version to 3.0.1 [#11700](https://github.com/mapbox/mapbox-gl-native/pull/11700) +- Update layer when changing its min/max zoom [#11687](https://github.com/mapbox/mapbox-gl-native/pull/11687) ## 6.0.0-beta.7 - April 12, 2018 - - Add abs, round, floor, ceil expression operators [#11653](https://github.com/mapbox/mapbox-gl-native/pull/11653) - - LatLngBounds correct center calculation [#11650](https://github.com/mapbox/mapbox-gl-native/pull/11650) - - Bump telemetry to 3.0.0 final [#11658](https://github.com/mapbox/mapbox-gl-native/pull/11658) - - Correctly calculate LatLngBounds [#11647](https://github.com/mapbox/mapbox-gl-native/pull/11647) - - Add convenience step expression [#11641](https://github.com/mapbox/mapbox-gl-native/pull/11641) - - Add javadoc examples for Android [#11540](https://github.com/mapbox/mapbox-gl-native/pull/11540) - - Add paused state to map renderer, don't render snapshots after onPause [#11358](https://github.com/mapbox/mapbox-gl-native/pull/11358) - - Rework internal expression conversion [#11490](https://github.com/mapbox/mapbox-gl-native/pull/11490) - - Fixed gesture event listeners javadoc [#11630](https://github.com/mapbox/mapbox-gl-native/pull/11630) - - Add delete local reference on jni strings [#11608](https://github.com/mapbox/mapbox-gl-native/pull/11608) - - Release local references early [#11599](https://github.com/mapbox/mapbox-gl-native/pull/11599) - - Re-bind uniform locations after re-linking program [#11618](https://github.com/mapbox/mapbox-gl-native/pull/11618) - - Bump mapbox-sdk-services to 3.0.1 [#11593](https://github.com/mapbox/mapbox-gl-native/pull/11593) + +- Add abs, round, floor, ceil expression operators [#11653](https://github.com/mapbox/mapbox-gl-native/pull/11653) +- LatLngBounds correct center calculation [#11650](https://github.com/mapbox/mapbox-gl-native/pull/11650) +- Bump telemetry to 3.0.0 final [#11658](https://github.com/mapbox/mapbox-gl-native/pull/11658) +- Correctly calculate LatLngBounds [#11647](https://github.com/mapbox/mapbox-gl-native/pull/11647) +- Add convenience step expression [#11641](https://github.com/mapbox/mapbox-gl-native/pull/11641) +- Add javadoc examples for Android [#11540](https://github.com/mapbox/mapbox-gl-native/pull/11540) +- Add paused state to map renderer, don't render snapshots after onPause [#11358](https://github.com/mapbox/mapbox-gl-native/pull/11358) +- Rework internal expression conversion [#11490](https://github.com/mapbox/mapbox-gl-native/pull/11490) +- Fixed gesture event listeners javadoc [#11630](https://github.com/mapbox/mapbox-gl-native/pull/11630) +- Add delete local reference on jni strings [#11608](https://github.com/mapbox/mapbox-gl-native/pull/11608) +- Release local references early [#11599](https://github.com/mapbox/mapbox-gl-native/pull/11599) +- Re-bind uniform locations after re-linking program [#11618](https://github.com/mapbox/mapbox-gl-native/pull/11618) +- Bump mapbox-sdk-services to 3.0.1 [#11593](https://github.com/mapbox/mapbox-gl-native/pull/11593) ## 5.5.2 - April 10, 2018 - - Correct animation scale point [#11643](https://github.com/mapbox/mapbox-gl-native/pull/11643) - - Re-bind uniform locations after re-linking program [#11583](https://github.com/mapbox/mapbox-gl-native/pull/11583) - - Invalidate camera position before delivering onMapReady [#11585](https://github.com/mapbox/mapbox-gl-native/pull/11585) - - Null java peer callback [#11358](https://github.com/mapbox/mapbox-gl-native/pull/11358) - - Add missing delete local reference [#11608](https://github.com/mapbox/mapbox-gl-native/pull/11608) - - Release local refs [#11599](https://github.com/mapbox/mapbox-gl-native/pull/11599) + +- Correct animation scale point [#11643](https://github.com/mapbox/mapbox-gl-native/pull/11643) +- Re-bind uniform locations after re-linking program [#11583](https://github.com/mapbox/mapbox-gl-native/pull/11583) +- Invalidate camera position before delivering onMapReady [#11585](https://github.com/mapbox/mapbox-gl-native/pull/11585) +- Null java peer callback [#11358](https://github.com/mapbox/mapbox-gl-native/pull/11358) +- Add missing delete local reference [#11608](https://github.com/mapbox/mapbox-gl-native/pull/11608) +- Release local refs [#11599](https://github.com/mapbox/mapbox-gl-native/pull/11599) ## 6.0.0-beta.6 - April 4, 2018 - - Fix race condition crash for heavily modified annotations [#11551](https://github.com/mapbox/mapbox-gl-native/pull/11551) - - Throw exception when converting PropertyValue with an expression [#11572](https://github.com/mapbox/mapbox-gl-native/pull/11572) - - Invalidate camera position before delivering onMapReady [#11585](https://github.com/mapbox/mapbox-gl-native/pull/11585) - - Rework logical condition convenience expressions [#11555](https://github.com/mapbox/mapbox-gl-native/pull/11555) - - Telemetry library version update to 3.0.0-beta.4 [#11590](https://github.com/mapbox/mapbox-gl-native/pull/11590) + +- Fix race condition crash for heavily modified annotations [#11551](https://github.com/mapbox/mapbox-gl-native/pull/11551) +- Throw exception when converting PropertyValue with an expression [#11572](https://github.com/mapbox/mapbox-gl-native/pull/11572) +- Invalidate camera position before delivering onMapReady [#11585](https://github.com/mapbox/mapbox-gl-native/pull/11585) +- Rework logical condition convenience expressions [#11555](https://github.com/mapbox/mapbox-gl-native/pull/11555) +- Telemetry library version update to 3.0.0-beta.4 [#11590](https://github.com/mapbox/mapbox-gl-native/pull/11590) ## 6.0.0-beta.5 - March 27, 2018 - - Avoid flashing on pitched overzoomed tiles [#11488](https://github.com/mapbox/mapbox-gl-native/pull/11488) - - Literal array conversion of primitive arrays [#11500](https://github.com/mapbox/mapbox-gl-native/pull/11500) - - Make default output from step more descriptive [#11501](https://github.com/mapbox/mapbox-gl-native/pull/11501) - - Expose public Telemetry API [#11503](https://github.com/mapbox/mapbox-gl-native/pull/11503) - - Convert Android int colors with to-color expression [#11506](https://github.com/mapbox/mapbox-gl-native/pull/11506) - - Prevent default style reload when string style json was set [#11520](https://github.com/mapbox/mapbox-gl-native/pull/11520) - - String, number and bool Expressions with multiple values [#11512](https://github.com/mapbox/mapbox-gl-native/pull/11512) - - Telemetry library 3.0.0-beta.3 [#11534](https://github.com/mapbox/mapbox-gl-native/pull/11534) - - Gestures library v0.2.0 [#11535](https://github.com/mapbox/mapbox-gl-native/pull/11535) + +- Avoid flashing on pitched overzoomed tiles [#11488](https://github.com/mapbox/mapbox-gl-native/pull/11488) +- Literal array conversion of primitive arrays [#11500](https://github.com/mapbox/mapbox-gl-native/pull/11500) +- Make default output from step more descriptive [#11501](https://github.com/mapbox/mapbox-gl-native/pull/11501) +- Expose public Telemetry API [#11503](https://github.com/mapbox/mapbox-gl-native/pull/11503) +- Convert Android int colors with to-color expression [#11506](https://github.com/mapbox/mapbox-gl-native/pull/11506) +- Prevent default style reload when string style json was set [#11520](https://github.com/mapbox/mapbox-gl-native/pull/11520) +- String, number and bool Expressions with multiple values [#11512](https://github.com/mapbox/mapbox-gl-native/pull/11512) +- Telemetry library 3.0.0-beta.3 [#11534](https://github.com/mapbox/mapbox-gl-native/pull/11534) +- Gestures library v0.2.0 [#11535](https://github.com/mapbox/mapbox-gl-native/pull/11535) ## 5.5.1 - March 26, 2018 - - Verify optional access of FileSource deactivation [#11480](https://github.com/mapbox/mapbox-gl-native/pull/11480) - - Prevent default style loading when style json was set [#11519](https://github.com/mapbox/mapbox-gl-native/pull/11519) - - Delete local reference when convering Image.java [#11350](https://github.com/mapbox/mapbox-gl-native/pull/11350) - - Use float for pixel ratio when creating a snapshotter [#11367](https://github.com/mapbox/mapbox-gl-native/pull/11367) - - Validate if width and height aren't 0 when creating a snapshot [#11364](https://github.com/mapbox/mapbox-gl-native/pull/11364) - - Null check body of http request [#11413](https://github.com/mapbox/mapbox-gl-native/pull/11413) - - Clamp TileJSON bounds [#11425](https://github.com/mapbox/mapbox-gl-native/pull/11425) + +- Verify optional access of FileSource deactivation [#11480](https://github.com/mapbox/mapbox-gl-native/pull/11480) +- Prevent default style loading when style json was set [#11519](https://github.com/mapbox/mapbox-gl-native/pull/11519) +- Delete local reference when convering Image.java [#11350](https://github.com/mapbox/mapbox-gl-native/pull/11350) +- Use float for pixel ratio when creating a snapshotter [#11367](https://github.com/mapbox/mapbox-gl-native/pull/11367) +- Validate if width and height aren't 0 when creating a snapshot [#11364](https://github.com/mapbox/mapbox-gl-native/pull/11364) +- Null check body of http request [#11413](https://github.com/mapbox/mapbox-gl-native/pull/11413) +- Clamp TileJSON bounds [#11425](https://github.com/mapbox/mapbox-gl-native/pull/11425) ## 6.0.0-beta.4 - March 20, 2018 - - Gesture library 0.1.0 stable [#11483](https://github.com/mapbox/mapbox-gl-native/pull/11483) - - Filters with expressions [#11429](https://github.com/mapbox/mapbox-gl-native/pull/11429) - - Telemetry 3.0.0-beta.2 [#11474](https://github.com/mapbox/mapbox-gl-native/pull/11474) - - High level JNI conversion for geojson [#11471](https://github.com/mapbox/mapbox-gl-native/pull/11471) - - Update to MAS 3.0.0-beta.4 [#11468](https://github.com/mapbox/mapbox-gl-native/pull/11468) - - Support for expression literal on arrays [#11457](https://github.com/mapbox/mapbox-gl-native/pull/11457) - - Fix telemetry integration for two finger tap gesture [#11460](https://github.com/mapbox/mapbox-gl-native/pull/11460) - - Revisit proguard configuration [#11434](https://github.com/mapbox/mapbox-gl-native/pull/11434) - - Expressions accessor support [#11352](https://github.com/mapbox/mapbox-gl-native/pull/11352) - - Calculate camera's LatLng for bounds without map padding [#11410](https://github.com/mapbox/mapbox-gl-native/pull/11410) - - Check for null on http body request [#11413](https://github.com/mapbox/mapbox-gl-native/pull/11413) - - Expose more gesture settings [#11407](https://github.com/mapbox/mapbox-gl-native/pull/11407) - - Revert java 8 language support [#11398](https://github.com/mapbox/mapbox-gl-native/pull/11398) - - Update to MAS 3.0.0-beta.3 [#11373](https://github.com/mapbox/mapbox-gl-native/pull/11373) - - Rework match expression to style specification syntax [#11388](https://github.com/mapbox/mapbox-gl-native/pull/11388) - - Update javadoc configuration for Gradle 4.4 [#11384](https://github.com/mapbox/mapbox-gl-native/pull/11384) - - Rework zoomIn and zoomOut to use ValueAnimators [#11382](https://github.com/mapbox/mapbox-gl-native/pull/11382) - - Delete LocalRef when converting Image.java [#11350](https://github.com/mapbox/mapbox-gl-native/pull/11350) - - Use float for pixelratio when creating a snapshotter [#11367](https://github.com/mapbox/mapbox-gl-native/pull/11367) - - Validate width/height when creating a snapshot [#11364](https://github.com/mapbox/mapbox-gl-native/pull/11364) + +- Gesture library 0.1.0 stable [#11483](https://github.com/mapbox/mapbox-gl-native/pull/11483) +- Filters with expressions [#11429](https://github.com/mapbox/mapbox-gl-native/pull/11429) +- Telemetry 3.0.0-beta.2 [#11474](https://github.com/mapbox/mapbox-gl-native/pull/11474) +- High level JNI conversion for geojson [#11471](https://github.com/mapbox/mapbox-gl-native/pull/11471) +- Update to MAS 3.0.0-beta.4 [#11468](https://github.com/mapbox/mapbox-gl-native/pull/11468) +- Support for expression literal on arrays [#11457](https://github.com/mapbox/mapbox-gl-native/pull/11457) +- Fix telemetry integration for two finger tap gesture [#11460](https://github.com/mapbox/mapbox-gl-native/pull/11460) +- Revisit proguard configuration [#11434](https://github.com/mapbox/mapbox-gl-native/pull/11434) +- Expressions accessor support [#11352](https://github.com/mapbox/mapbox-gl-native/pull/11352) +- Calculate camera's LatLng for bounds without map padding [#11410](https://github.com/mapbox/mapbox-gl-native/pull/11410) +- Check for null on http body request [#11413](https://github.com/mapbox/mapbox-gl-native/pull/11413) +- Expose more gesture settings [#11407](https://github.com/mapbox/mapbox-gl-native/pull/11407) +- Revert java 8 language support [#11398](https://github.com/mapbox/mapbox-gl-native/pull/11398) +- Update to MAS 3.0.0-beta.3 [#11373](https://github.com/mapbox/mapbox-gl-native/pull/11373) +- Rework match expression to style specification syntax [#11388](https://github.com/mapbox/mapbox-gl-native/pull/11388) +- Update javadoc configuration for Gradle 4.4 [#11384](https://github.com/mapbox/mapbox-gl-native/pull/11384) +- Rework zoomIn and zoomOut to use ValueAnimators [#11382](https://github.com/mapbox/mapbox-gl-native/pull/11382) +- Delete LocalRef when converting Image.java [#11350](https://github.com/mapbox/mapbox-gl-native/pull/11350) +- Use float for pixelratio when creating a snapshotter [#11367](https://github.com/mapbox/mapbox-gl-native/pull/11367) +- Validate width/height when creating a snapshot [#11364](https://github.com/mapbox/mapbox-gl-native/pull/11364) ## 6.0.0-beta.3 - March 2, 2018 - - Added missing local reference deletes [#11243](https://github.com/mapbox/mapbox-gl-native/pull/11243), [#11272](https://github.com/mapbox/mapbox-gl-native/pull/11272) - - Remove obsolete camera api [#11201](https://github.com/mapbox/mapbox-gl-native/pull/11201) - - Fix UTF-8 encoding, add missing package-info.java files [#11261](https://github.com/mapbox/mapbox-gl-native/pull/11261) - - Rework expression api [#11210](https://github.com/mapbox/mapbox-gl-native/pull/11210) - - LatLngBounds fixes [#11333](https://github.com/mapbox/mapbox-gl-native/pull/11333), [#11307](https://github.com/mapbox/mapbox-gl-native/pull/11307), [#11308](https://github.com/mapbox/mapbox-gl-native/pull/11308), [#11309](https://github.com/mapbox/mapbox-gl-native/pull/11309), [#11226](https://github.com/mapbox/mapbox-gl-native/pull/11226) - - New gestures library [#11221](https://github.com/mapbox/mapbox-gl-native/pull/11221) - - Expose ImageSource coordinates setter [#11262](https://github.com/mapbox/mapbox-gl-native/pull/11262) - - Add heatmap color property [#11220](https://github.com/mapbox/mapbox-gl-native/pull/11220) - - Add support for mapzen terrarium raster-dem encoding [#11339](https://github.com/mapbox/mapbox-gl-native/pull/11339) + +- Added missing local reference deletes [#11243](https://github.com/mapbox/mapbox-gl-native/pull/11243), [#11272](https://github.com/mapbox/mapbox-gl-native/pull/11272) +- Remove obsolete camera api [#11201](https://github.com/mapbox/mapbox-gl-native/pull/11201) +- Fix UTF-8 encoding, add missing package-info.java files [#11261](https://github.com/mapbox/mapbox-gl-native/pull/11261) +- Rework expression api [#11210](https://github.com/mapbox/mapbox-gl-native/pull/11210) +- LatLngBounds fixes [#11333](https://github.com/mapbox/mapbox-gl-native/pull/11333), [#11307](https://github.com/mapbox/mapbox-gl-native/pull/11307), [#11308](https://github.com/mapbox/mapbox-gl-native/pull/11308), [#11309](https://github.com/mapbox/mapbox-gl-native/pull/11309), [#11226](https://github.com/mapbox/mapbox-gl-native/pull/11226) +- New gestures library [#11221](https://github.com/mapbox/mapbox-gl-native/pull/11221) +- Expose ImageSource coordinates setter [#11262](https://github.com/mapbox/mapbox-gl-native/pull/11262) +- Add heatmap color property [#11220](https://github.com/mapbox/mapbox-gl-native/pull/11220) +- Add support for mapzen terrarium raster-dem encoding [#11339](https://github.com/mapbox/mapbox-gl-native/pull/11339) ## 5.5.0 - March 1, 2018 - - TileJSON Bounds allows values inclusive of world extents [#11178](https://github.com/mapbox/mapbox-gl-native/pull/11178) - - LatLngBounds returned by VisibleRegion when map is rotated [#11226](https://github.com/mapbox/mapbox-gl-native/pull/11226) - - Custom Layer fixes & black list VAO on mali t720 [#11239](https://github.com/mapbox/mapbox-gl-native/pull/11239) - - Check if Activity isn't finishing before showing dialog [#11244](https://github.com/mapbox/mapbox-gl-native/pull/11244) - - Decouple MapPadding from overlain views [#11258](https://github.com/mapbox/mapbox-gl-native/pull/11258) - - Don't disable zoom button controller zooming with gesture disabled zoom [#11259](https://github.com/mapbox/mapbox-gl-native/pull/11259) - - Expose ImageSource coordinates setter [#11262](https://github.com/mapbox/mapbox-gl-native/pull/11262) - - Add missing DeleteLocalRefs [#11272](https://github.com/mapbox/mapbox-gl-native/pull/11272) - - Continue loading style even if we mutate it [#11294](https://github.com/mapbox/mapbox-gl-native/pull/11294) - - Update telemetry version for OkHttp [#11338](https://github.com/mapbox/mapbox-gl-native/pull/11338) + +- TileJSON Bounds allows values inclusive of world extents [#11178](https://github.com/mapbox/mapbox-gl-native/pull/11178) +- LatLngBounds returned by VisibleRegion when map is rotated [#11226](https://github.com/mapbox/mapbox-gl-native/pull/11226) +- Custom Layer fixes & black list VAO on mali t720 [#11239](https://github.com/mapbox/mapbox-gl-native/pull/11239) +- Check if Activity isn't finishing before showing dialog [#11244](https://github.com/mapbox/mapbox-gl-native/pull/11244) +- Decouple MapPadding from overlain views [#11258](https://github.com/mapbox/mapbox-gl-native/pull/11258) +- Don't disable zoom button controller zooming with gesture disabled zoom [#11259](https://github.com/mapbox/mapbox-gl-native/pull/11259) +- Expose ImageSource coordinates setter [#11262](https://github.com/mapbox/mapbox-gl-native/pull/11262) +- Add missing DeleteLocalRefs [#11272](https://github.com/mapbox/mapbox-gl-native/pull/11272) +- Continue loading style even if we mutate it [#11294](https://github.com/mapbox/mapbox-gl-native/pull/11294) +- Update telemetry version for OkHttp [#11338](https://github.com/mapbox/mapbox-gl-native/pull/11338) ## 6.0.0-beta.2 - February 13, 2018 - - Deprecate LocationEngine [#11185](https://github.com/mapbox/mapbox-gl-native/pull/11185) - - Remove LOST from SDK [11186](https://github.com/mapbox/mapbox-gl-native/pull/11186) - - Transparent surface configuration on TextureView [#11065](https://github.com/mapbox/mapbox-gl-native/pull/11065) - - Constrained setLatLng documentation, expose setLatLngZoom method [#11184](https://github.com/mapbox/mapbox-gl-native/pull/11184) - - Integration of new events library [#10999](https://github.com/mapbox/mapbox-gl-native/pull/10999) - - AddImage performance improvement [#11111](https://github.com/mapbox/mapbox-gl-native/pull/11111) - - Migrate MAS to 3.0.0, refactor GeoJson integration [#11149](https://github.com/mapbox/mapbox-gl-native/pull/11149) - - Remove @jar and @aar dependency suffixes [#11161](https://github.com/mapbox/mapbox-gl-native/pull/11161) + +- Deprecate LocationEngine [#11185](https://github.com/mapbox/mapbox-gl-native/pull/11185) +- Remove LOST from SDK [11186](https://github.com/mapbox/mapbox-gl-native/pull/11186) +- Transparent surface configuration on TextureView [#11065](https://github.com/mapbox/mapbox-gl-native/pull/11065) +- Constrained setLatLng documentation, expose setLatLngZoom method [#11184](https://github.com/mapbox/mapbox-gl-native/pull/11184) +- Integration of new events library [#10999](https://github.com/mapbox/mapbox-gl-native/pull/10999) +- AddImage performance improvement [#11111](https://github.com/mapbox/mapbox-gl-native/pull/11111) +- Migrate MAS to 3.0.0, refactor GeoJson integration [#11149](https://github.com/mapbox/mapbox-gl-native/pull/11149) +- Remove @jar and @aar dependency suffixes [#11161](https://github.com/mapbox/mapbox-gl-native/pull/11161) ## 5.4.1 - February 9, 2018 - - Don't recreate TextureView surface as part of view resizing, solves OOM crashes [#11148](https://github.com/mapbox/mapbox-gl-native/pull/11148) - - Don't invoke OnLowMemory before map is ready, solves startup crash on low memory devices [#11109](https://github.com/mapbox/mapbox-gl-native/pull/11109) - - Programmatically create GLSurfaceView, solves fragment bug [#11124](https://github.com/mapbox/mapbox-gl-native/pull/11124) - - Proguard config for optional location provider, solves obfuscation warnings [#11127](https://github.com/mapbox/mapbox-gl-native/pull/11127) - - MapView weak reference in global layout listener, solves memory leak [#11128](https://github.com/mapbox/mapbox-gl-native/pull/11128) + +- Don't recreate TextureView surface as part of view resizing, solves OOM crashes [#11148](https://github.com/mapbox/mapbox-gl-native/pull/11148) +- Don't invoke OnLowMemory before map is ready, solves startup crash on low memory devices [#11109](https://github.com/mapbox/mapbox-gl-native/pull/11109) +- Programmatically create GLSurfaceView, solves fragment bug [#11124](https://github.com/mapbox/mapbox-gl-native/pull/11124) +- Proguard config for optional location provider, solves obfuscation warnings [#11127](https://github.com/mapbox/mapbox-gl-native/pull/11127) +- MapView weak reference in global layout listener, solves memory leak [#11128](https://github.com/mapbox/mapbox-gl-native/pull/11128) ## 5.4.0 - January 30, 2018 - - Blacklist Adreno 2xx GPU for VAO support [#11047](https://github.com/mapbox/mapbox-gl-native/pull/11047) - - Bearing tracking mode GPS_NORTH_FACING [#11095](https://github.com/mapbox/mapbox-gl-native/pull/11095) - - Disable logging for missing location permissions when location is disabled [#11084](https://github.com/mapbox/mapbox-gl-native/pull/11084) - - Create offline handler using the main thread looper [#11021](https://github.com/mapbox/mapbox-gl-native/pull/11021) + +- Blacklist Adreno 2xx GPU for VAO support [#11047](https://github.com/mapbox/mapbox-gl-native/pull/11047) +- Bearing tracking mode GPS_NORTH_FACING [#11095](https://github.com/mapbox/mapbox-gl-native/pull/11095) +- Disable logging for missing location permissions when location is disabled [#11084](https://github.com/mapbox/mapbox-gl-native/pull/11084) +- Create offline handler using the main thread looper [#11021](https://github.com/mapbox/mapbox-gl-native/pull/11021) ## 6.0.0-beta.1 - January 26, 2018 - - Binding integration for expressions [#10654](https://github.com/mapbox/mapbox-gl-native/pull/10654) - - CustomGeometrySource [#9983](https://github.com/mapbox/mapbox-gl-native/pull/9983) - - HillshadeLayer and RasterDemSource [#11031](https://github.com/mapbox/mapbox-gl-native/pull/11031) - - Revisit marker placement for snapshot [#11029](https://github.com/mapbox/mapbox-gl-native/pull/11029) - - SafeVarargs annotation for expressions [#11027](https://github.com/mapbox/mapbox-gl-native/pull/11027) - - Expression#toString [#11024](https://github.com/mapbox/mapbox-gl-native/pull/11024) - - Rename initRenderSurface to onSurfaceCreated [#11023](https://github.com/mapbox/mapbox-gl-native/pull/11023) - - Expose attribution manager as public API [#10942](https://github.com/mapbox/mapbox-gl-native/pull/10942) - - Replace Mapzen vector source example with Mapillary [#10931](https://github.com/mapbox/mapbox-gl-native/pull/10931) - - Add Hebrew localization [#10967](https://github.com/mapbox/mapbox-gl-native/pull/10967) - - Cleanup gradle configuration files [#10903](https://github.com/mapbox/mapbox-gl-native/pull/10903) - - Send double tap event only once [#10855](https://github.com/mapbox/mapbox-gl-native/pull/10855) - - Parameter validation for LatLngBounds#from [#10831](https://github.com/mapbox/mapbox-gl-native/pull/10831) - - Replace JSON parsing [#10815](https://github.com/mapbox/mapbox-gl-native/pull/10815) - - Orientation change regression test [#10814](https://github.com/mapbox/mapbox-gl-native/pull/10814) - - Max & min LatLng constants [#10780](https://github.com/mapbox/mapbox-gl-native/pull/10780) - - LatLng#wrap return new instance of LatLng [#10769](https://github.com/mapbox/mapbox-gl-native/pull/10769) - - Custom library loader [#10733](https://github.com/mapbox/mapbox-gl-native/pull/10733) - - Inconsistent parameters for LatLngBounds.union [#10728](https://github.com/mapbox/mapbox-gl-native/pull/10728) - - Gradle 4.1 / AS 3.0 [#10549](https://github.com/mapbox/mapbox-gl-native/pull/10549) + +- Binding integration for expressions [#10654](https://github.com/mapbox/mapbox-gl-native/pull/10654) +- CustomGeometrySource [#9983](https://github.com/mapbox/mapbox-gl-native/pull/9983) +- HillshadeLayer and RasterDemSource [#11031](https://github.com/mapbox/mapbox-gl-native/pull/11031) +- Revisit marker placement for snapshot [#11029](https://github.com/mapbox/mapbox-gl-native/pull/11029) +- SafeVarargs annotation for expressions [#11027](https://github.com/mapbox/mapbox-gl-native/pull/11027) +- Expression#toString [#11024](https://github.com/mapbox/mapbox-gl-native/pull/11024) +- Rename initRenderSurface to onSurfaceCreated [#11023](https://github.com/mapbox/mapbox-gl-native/pull/11023) +- Expose attribution manager as public API [#10942](https://github.com/mapbox/mapbox-gl-native/pull/10942) +- Replace Mapzen vector source example with Mapillary [#10931](https://github.com/mapbox/mapbox-gl-native/pull/10931) +- Add Hebrew localization [#10967](https://github.com/mapbox/mapbox-gl-native/pull/10967) +- Cleanup gradle configuration files [#10903](https://github.com/mapbox/mapbox-gl-native/pull/10903) +- Send double tap event only once [#10855](https://github.com/mapbox/mapbox-gl-native/pull/10855) +- Parameter validation for LatLngBounds#from [#10831](https://github.com/mapbox/mapbox-gl-native/pull/10831) +- Replace JSON parsing [#10815](https://github.com/mapbox/mapbox-gl-native/pull/10815) +- Orientation change regression test [#10814](https://github.com/mapbox/mapbox-gl-native/pull/10814) +- Max & min LatLng constants [#10780](https://github.com/mapbox/mapbox-gl-native/pull/10780) +- LatLng#wrap return new instance of LatLng [#10769](https://github.com/mapbox/mapbox-gl-native/pull/10769) +- Custom library loader [#10733](https://github.com/mapbox/mapbox-gl-native/pull/10733) +- Inconsistent parameters for LatLngBounds.union [#10728](https://github.com/mapbox/mapbox-gl-native/pull/10728) +- Gradle 4.1 / AS 3.0 [#10549](https://github.com/mapbox/mapbox-gl-native/pull/10549) ## 5.3.2 - January 22, 2018 - - Validate surface creation before destroying [#10890](https://github.com/mapbox/mapbox-gl-native/pull/10890) - - Add filesource activation ot OfflineRegion [#10904](https://github.com/mapbox/mapbox-gl-native/pull/10904) - - Save configuration of UiSettings [#10908](https://github.com/mapbox/mapbox-gl-native/pull/10908) - - Do not overwrite user-set focal point [#10910](https://github.com/mapbox/mapbox-gl-native/pull/10910) - - Camera callbacks for velocity animated movements [#10925](https://github.com/mapbox/mapbox-gl-native/pull/10925) - - Allow changing the used OkHttpClient [#10948](https://github.com/mapbox/mapbox-gl-native/pull/10948) - - Validate zoom level before creating telemetry event [#10959](https://github.com/mapbox/mapbox-gl-native/pull/10959) - - Handle null call instances in HttpRequest [#10987](https://github.com/mapbox/mapbox-gl-native/pull/10987) + +- Validate surface creation before destroying [#10890](https://github.com/mapbox/mapbox-gl-native/pull/10890) +- Add filesource activation ot OfflineRegion [#10904](https://github.com/mapbox/mapbox-gl-native/pull/10904) +- Save configuration of UiSettings [#10908](https://github.com/mapbox/mapbox-gl-native/pull/10908) +- Do not overwrite user-set focal point [#10910](https://github.com/mapbox/mapbox-gl-native/pull/10910) +- Camera callbacks for velocity animated movements [#10925](https://github.com/mapbox/mapbox-gl-native/pull/10925) +- Allow changing the used OkHttpClient [#10948](https://github.com/mapbox/mapbox-gl-native/pull/10948) +- Validate zoom level before creating telemetry event [#10959](https://github.com/mapbox/mapbox-gl-native/pull/10959) +- Handle null call instances in HttpRequest [#10987](https://github.com/mapbox/mapbox-gl-native/pull/10987) ## 5.3.1 - January 10, 2018 - - Blacklist binary program loading for Vivante GC4000 GPUs [#10862](https://github.com/mapbox/mapbox-gl-native/pull/10862) - - Support Genymotion [#10841](https://github.com/mapbox/mapbox-gl-native/pull/10841) - - Getting bitmap from drawable fix [#10763](https://github.com/mapbox/mapbox-gl-native/pull/10763) - - Use US locale when converting between int color and RGBA string [#10810](https://github.com/mapbox/mapbox-gl-native/pull/10810) - - Harden map destruction [#10811](https://github.com/mapbox/mapbox-gl-native/pull/10811) - - RTL support [#10828](https://github.com/mapbox/mapbox-gl-native/pull/10828) - - Allow configuring Http url logging when a request fails [#10830](https://github.com/mapbox/mapbox-gl-native/pull/10830) - - Don't send double tap event multiple times for telemetry [#10854](https://github.com/mapbox/mapbox-gl-native/pull/10854) - - Fix code generation [#10856](https://github.com/mapbox/mapbox-gl-native/pull/10856) - - Use the correct cancelable callback after posting cancel [#10871](https://github.com/mapbox/mapbox-gl-native/pull/10871) + +- Blacklist binary program loading for Vivante GC4000 GPUs [#10862](https://github.com/mapbox/mapbox-gl-native/pull/10862) +- Support Genymotion [#10841](https://github.com/mapbox/mapbox-gl-native/pull/10841) +- Getting bitmap from drawable fix [#10763](https://github.com/mapbox/mapbox-gl-native/pull/10763) +- Use US locale when converting between int color and RGBA string [#10810](https://github.com/mapbox/mapbox-gl-native/pull/10810) +- Harden map destruction [#10811](https://github.com/mapbox/mapbox-gl-native/pull/10811) +- RTL support [#10828](https://github.com/mapbox/mapbox-gl-native/pull/10828) +- Allow configuring Http url logging when a request fails [#10830](https://github.com/mapbox/mapbox-gl-native/pull/10830) +- Don't send double tap event multiple times for telemetry [#10854](https://github.com/mapbox/mapbox-gl-native/pull/10854) +- Fix code generation [#10856](https://github.com/mapbox/mapbox-gl-native/pull/10856) +- Use the correct cancelable callback after posting cancel [#10871](https://github.com/mapbox/mapbox-gl-native/pull/10871) ## 5.3.0 - December 20, 2017 - - Add support for TinySDF [#10706](https://github.com/mapbox/mapbox-gl-native/pull/10706) - - Save restore MyLocationViewSettings [#10746](https://github.com/mapbox/mapbox-gl-native/pull/10746) - - Post animation callback invocation [#10664](https://github.com/mapbox/mapbox-gl-native/pull/10664) - - Allow configuring Http logging [#10681](https://github.com/mapbox/mapbox-gl-native/pull/10681) - - Fix reverse scale gesture [#10688](https://github.com/mapbox/mapbox-gl-native/pull/10688) - - Update offline region metadata documentation [#10693](https://github.com/mapbox/mapbox-gl-native/pull/10693) - - Post camera listener invocation [#10690](https://github.com/mapbox/mapbox-gl-native/pull/10690) - - Activate filesource for offline region creation [#10718](https://github.com/mapbox/mapbox-gl-native/pull/10718) - - Update Spanish/Vietnamese translations [#10740](https://github.com/mapbox/mapbox-gl-native/pull/10740) - - Update instrumented make target [#10724](https://github.com/mapbox/mapbox-gl-native/pull/10724) - - Remove black flash on start for fragments [#10717](https://github.com/mapbox/mapbox-gl-native/pull/10717) - - CompassView decode crash [#10717](https://github.com/mapbox/mapbox-gl-native/pull/10717) - - Android SDK renaming [#10609](https://github.com/mapbox/mapbox-gl-native/pull/10609) - - Map touch listener based lists [#10749](https://github.com/mapbox/mapbox-gl-native/pull/10749) + +- Add support for TinySDF [#10706](https://github.com/mapbox/mapbox-gl-native/pull/10706) +- Save restore MyLocationViewSettings [#10746](https://github.com/mapbox/mapbox-gl-native/pull/10746) +- Post animation callback invocation [#10664](https://github.com/mapbox/mapbox-gl-native/pull/10664) +- Allow configuring Http logging [#10681](https://github.com/mapbox/mapbox-gl-native/pull/10681) +- Fix reverse scale gesture [#10688](https://github.com/mapbox/mapbox-gl-native/pull/10688) +- Update offline region metadata documentation [#10693](https://github.com/mapbox/mapbox-gl-native/pull/10693) +- Post camera listener invocation [#10690](https://github.com/mapbox/mapbox-gl-native/pull/10690) +- Activate filesource for offline region creation [#10718](https://github.com/mapbox/mapbox-gl-native/pull/10718) +- Update Spanish/Vietnamese translations [#10740](https://github.com/mapbox/mapbox-gl-native/pull/10740) +- Update instrumented make target [#10724](https://github.com/mapbox/mapbox-gl-native/pull/10724) +- Remove black flash on start for fragments [#10717](https://github.com/mapbox/mapbox-gl-native/pull/10717) +- CompassView decode crash [#10717](https://github.com/mapbox/mapbox-gl-native/pull/10717) +- Android SDK renaming [#10609](https://github.com/mapbox/mapbox-gl-native/pull/10609) +- Map touch listener based lists [#10749](https://github.com/mapbox/mapbox-gl-native/pull/10749) ## 5.2.1 - December 6, 2017 - - Close race condition in RunLoop [#10537](https://github.com/mapbox/mapbox-gl-native/pull/10537) - - OkHttp 3.9.1 [#10515](https://github.com/mapbox/mapbox-gl-native/pull/10515) - - Attribution anchor point fix [#10558](https://github.com/mapbox/mapbox-gl-native/pull/10558) - - Pre API 19 VerifyError [#10579](https://github.com/mapbox/mapbox-gl-native/pull/10579) - - Set larger Http request limit [#10567](https://github.com/mapbox/mapbox-gl-native/pull/10567) - - Remove jar generation from maven publish [#10625](https://github.com/mapbox/mapbox-gl-native/pull/10625) - - Enable Map Rendering when paused for multiple window support [#10509](https://github.com/mapbox/mapbox-gl-native/pull/10509) - - Activate FileSource when listing offline regions [#10531](https://github.com/mapbox/mapbox-gl-native/pull/10531) - - Harden MarkerView integration by checking for null bitmap [#10532](https://github.com/mapbox/mapbox-gl-native/pull/10532) - - Use concurrent lists for camera change listeners [#10542](https://github.com/mapbox/mapbox-gl-native/pull/10542) - - Handle destroy activity as part of theme switching [#10589](https://github.com/mapbox/mapbox-gl-native/pull/10589) - - add FileSource activation/deactivation to MapSnapshotter [#10556](https://github.com/mapbox/mapbox-gl-native/pull/10556) + +- Close race condition in RunLoop [#10537](https://github.com/mapbox/mapbox-gl-native/pull/10537) +- OkHttp 3.9.1 [#10515](https://github.com/mapbox/mapbox-gl-native/pull/10515) +- Attribution anchor point fix [#10558](https://github.com/mapbox/mapbox-gl-native/pull/10558) +- Pre API 19 VerifyError [#10579](https://github.com/mapbox/mapbox-gl-native/pull/10579) +- Set larger Http request limit [#10567](https://github.com/mapbox/mapbox-gl-native/pull/10567) +- Remove jar generation from maven publish [#10625](https://github.com/mapbox/mapbox-gl-native/pull/10625) +- Enable Map Rendering when paused for multiple window support [#10509](https://github.com/mapbox/mapbox-gl-native/pull/10509) +- Activate FileSource when listing offline regions [#10531](https://github.com/mapbox/mapbox-gl-native/pull/10531) +- Harden MarkerView integration by checking for null bitmap [#10532](https://github.com/mapbox/mapbox-gl-native/pull/10532) +- Use concurrent lists for camera change listeners [#10542](https://github.com/mapbox/mapbox-gl-native/pull/10542) +- Handle destroy activity as part of theme switching [#10589](https://github.com/mapbox/mapbox-gl-native/pull/10589) +- add FileSource activation/deactivation to MapSnapshotter [#10556](https://github.com/mapbox/mapbox-gl-native/pull/10556) ## 5.2.0 - November 17, 2017 @@ -1703,345 +1999,348 @@ Please see https://github.com/square/okhttp/issues/2679 for more information. ## 5.1.5 - October 31, 2017 -* Remove obsolete terminate context/display calls [#10162](https://github.com/mapbox/mapbox-gl-native/pull/10162) -* Determine need for clip ID based on actual layers/tiles [#10216](https://github.com/mapbox/mapbox-gl-native/pull/10216) -* Correctly alter sprite URLs [#10217](https://github.com/mapbox/mapbox-gl-native/pull/10217) -* Russian and Ukrainian localizations [#9945](https://github.com/mapbox/mapbox-gl-native/pull/9945) +- Remove obsolete terminate context/display calls [#10162](https://github.com/mapbox/mapbox-gl-native/pull/10162) +- Determine need for clip ID based on actual layers/tiles [#10216](https://github.com/mapbox/mapbox-gl-native/pull/10216) +- Correctly alter sprite URLs [#10217](https://github.com/mapbox/mapbox-gl-native/pull/10217) +- Russian and Ukrainian localizations [#9945](https://github.com/mapbox/mapbox-gl-native/pull/9945) ## 5.1.4 - September 25, 2017 -* Update translations [#10033](https://github.com/mapbox/mapbox-gl-native/pull/10033) & [#9945](https://github.com/mapbox/mapbox-gl-native/pull/9945) -* Continue rendering tiles despite erros [#10012](https://github.com/mapbox/mapbox-gl-native/pull/10012) -* Fix layer z-fighting [#9942](https://github.com/mapbox/mapbox-gl-native/pull/9942) -* Align line vertex to 4-byte boundary [#9943](https://github.com/mapbox/mapbox-gl-native/pull/9943) -* Bump proguard config for OkHttp [#9970](https://github.com/mapbox/mapbox-gl-native/pull/9970) -* Remove database on schema downgrade [#9837](https://github.com/mapbox/mapbox-gl-native/pull/9837) -* Disable rotation gesture when pinch zooming [#10026](https://github.com/mapbox/mapbox-gl-native/pull/10026) -* Do not check if connection is local request [#9968](https://github.com/mapbox/mapbox-gl-native/pull/9968) -* Harden offline region deletion [#9967](https://github.com/mapbox/mapbox-gl-native/pull/9967) -* Clear out mapCallback's OnMapReadyListeners on destroy [#9957](https://github.com/mapbox/mapbox-gl-native/pull/9957) -* Avoid adding duplicate points to bounds [#9955](https://github.com/mapbox/mapbox-gl-native/pull/9955) -* Download is complete fix [#9913](https://github.com/mapbox/mapbox-gl-native/pull/9913) -* MAS 2.2.3 [#9901](https://github.com/mapbox/mapbox-gl-native/pull/9901) -* Russian and Ukrainian localizations [#9945](https://github.com/mapbox/mapbox-gl-native/pull/9945) +- Update translations [#10033](https://github.com/mapbox/mapbox-gl-native/pull/10033) & [#9945](https://github.com/mapbox/mapbox-gl-native/pull/9945) +- Continue rendering tiles despite erros [#10012](https://github.com/mapbox/mapbox-gl-native/pull/10012) +- Fix layer z-fighting [#9942](https://github.com/mapbox/mapbox-gl-native/pull/9942) +- Align line vertex to 4-byte boundary [#9943](https://github.com/mapbox/mapbox-gl-native/pull/9943) +- Bump proguard config for OkHttp [#9970](https://github.com/mapbox/mapbox-gl-native/pull/9970) +- Remove database on schema downgrade [#9837](https://github.com/mapbox/mapbox-gl-native/pull/9837) +- Disable rotation gesture when pinch zooming [#10026](https://github.com/mapbox/mapbox-gl-native/pull/10026) +- Do not check if connection is local request [#9968](https://github.com/mapbox/mapbox-gl-native/pull/9968) +- Harden offline region deletion [#9967](https://github.com/mapbox/mapbox-gl-native/pull/9967) +- Clear out mapCallback's OnMapReadyListeners on destroy [#9957](https://github.com/mapbox/mapbox-gl-native/pull/9957) +- Avoid adding duplicate points to bounds [#9955](https://github.com/mapbox/mapbox-gl-native/pull/9955) +- Download is complete fix [#9913](https://github.com/mapbox/mapbox-gl-native/pull/9913) +- MAS 2.2.3 [#9901](https://github.com/mapbox/mapbox-gl-native/pull/9901) +- Russian and Ukrainian localizations [#9945](https://github.com/mapbox/mapbox-gl-native/pull/9945) ## 5.1.3 - August 18, 2017 -* Use separate attribute component for line normals [#9753](https://github.com/mapbox/mapbox-gl-native/pull/9753) -* Track state of initial overlain views margins [#9391](https://github.com/mapbox/mapbox-gl-native/pull/9391) -* Compability for Samsung devices forcing 3-4 array vector length [#9746](https://github.com/mapbox/mapbox-gl-native/pull/9746) -* Smallest LatLngBounds when visible region crosses dateline [#9747](https://github.com/mapbox/mapbox-gl-native/pull/9747) -* Readd ProjectMeters [#9766](https://github.com/mapbox/mapbox-gl-native/pull/9766) -* Enable location change animation of MyLocationView by default [#9779](https://github.com/mapbox/mapbox-gl-native/pull/9779) -* Avoid IndexOutOfBoundsException when destroying map object [#9789](https://github.com/mapbox/mapbox-gl-native/pull/9789) -* MAS 2.2.1 [#9796](https://github.com/mapbox/mapbox-gl-native/pull/9796) +- Use separate attribute component for line normals [#9753](https://github.com/mapbox/mapbox-gl-native/pull/9753) +- Track state of initial overlain views margins [#9391](https://github.com/mapbox/mapbox-gl-native/pull/9391) +- Compability for Samsung devices forcing 3-4 array vector length [#9746](https://github.com/mapbox/mapbox-gl-native/pull/9746) +- Smallest LatLngBounds when visible region crosses dateline [#9747](https://github.com/mapbox/mapbox-gl-native/pull/9747) +- Readd ProjectMeters [#9766](https://github.com/mapbox/mapbox-gl-native/pull/9766) +- Enable location change animation of MyLocationView by default [#9779](https://github.com/mapbox/mapbox-gl-native/pull/9779) +- Avoid IndexOutOfBoundsException when destroying map object [#9789](https://github.com/mapbox/mapbox-gl-native/pull/9789) +- MAS 2.2.1 [#9796](https://github.com/mapbox/mapbox-gl-native/pull/9796) ## 5.1.2 - August 2, 2017 -* Disable program caching on Ardreno GPU 3xx, 4xx and 5xx [#9625](https://github.com/mapbox/mapbox-gl-native/pull/9625) -* GeoJSON proguard issue [#9577](https://github.com/mapbox/mapbox-gl-native/pull/9577) -* Harden click events of shape annotations [#9585](https://github.com/mapbox/mapbox-gl-native/pull/9585) -* Validate Marker before opening InfoWindow [#9586](https://github.com/mapbox/mapbox-gl-native/pull/9586) -* Fix added to map check [#9602](https://github.com/mapbox/mapbox-gl-native/pull/9602) -* Don't query shape annotations if none were added [#9606](https://github.com/mapbox/mapbox-gl-native/pull/9606) -* Fix compass direction [#9632](https://github.com/mapbox/mapbox-gl-native/pull/9632) -* Remove preview image integration [#9657](https://github.com/mapbox/mapbox-gl-native/pull/9657) -* Try/catch initialization of telemetry [#9658](https://github.com/mapbox/mapbox-gl-native/pull/9658) -* Fix typo OnCameraMoveStartedListener [#9664](https://github.com/mapbox/mapbox-gl-native/pull/9664) -* Bump MAS dependency to 5.2.0 [#9671](https://github.com/mapbox/mapbox-gl-native/pull/9671) +- Disable program caching on Ardreno GPU 3xx, 4xx and 5xx [#9625](https://github.com/mapbox/mapbox-gl-native/pull/9625) +- GeoJSON proguard issue [#9577](https://github.com/mapbox/mapbox-gl-native/pull/9577) +- Harden click events of shape annotations [#9585](https://github.com/mapbox/mapbox-gl-native/pull/9585) +- Validate Marker before opening InfoWindow [#9586](https://github.com/mapbox/mapbox-gl-native/pull/9586) +- Fix added to map check [#9602](https://github.com/mapbox/mapbox-gl-native/pull/9602) +- Don't query shape annotations if none were added [#9606](https://github.com/mapbox/mapbox-gl-native/pull/9606) +- Fix compass direction [#9632](https://github.com/mapbox/mapbox-gl-native/pull/9632) +- Remove preview image integration [#9657](https://github.com/mapbox/mapbox-gl-native/pull/9657) +- Try/catch initialization of telemetry [#9658](https://github.com/mapbox/mapbox-gl-native/pull/9658) +- Fix typo OnCameraMoveStartedListener [#9664](https://github.com/mapbox/mapbox-gl-native/pull/9664) +- Bump MAS dependency to 5.2.0 [#9671](https://github.com/mapbox/mapbox-gl-native/pull/9671) ## 5.1.1 - July 21, 2017 -* Rework attribution binding [#9433](https://github.com/mapbox/mapbox-gl-native/pull/9433) -* BackendScope changes [#9538](https://github.com/mapbox/mapbox-gl-native/pull/9538) -* Invisible MarkerView performance fix [#9420](https://github.com/mapbox/mapbox-gl-native/pull/9420) -* Polyline/Polygon click listeners [#9443](https://github.com/mapbox/mapbox-gl-native/pull/9443) -* Hit test Marker/MarkerViews [#9424](https://github.com/mapbox/mapbox-gl-native/pull/9424) -* Fine tune fling gesture [#9532](https://github.com/mapbox/mapbox-gl-native/pull/9532) -* Bump OkHttp 3.8.0, Android 7.x crashes [#9522](https://github.com/mapbox/mapbox-gl-native/pull/9522) -* MyLocationView tint fix [#9410](https://github.com/mapbox/mapbox-gl-native/pull/9410) -* VisibleRegion logic [#9428](https://github.com/mapbox/mapbox-gl-native/pull/9428) -* Validate motion event [#9434](https://github.com/mapbox/mapbox-gl-native/pull/9434) -* Add French localization [#9545](https://github.com/mapbox/mapbox-gl-native/pull/9545) -* Fix public.xml [#9525](https://github.com/mapbox/mapbox-gl-native/pull/9525/files) -* Manage InfoWindow selection in AnnotationManager [#9567](https://github.com/mapbox/mapbox-gl-native/pull/9567) -* Increase touch target size [#9565](https://github.com/mapbox/mapbox-gl-native/pull/9565) -* Work around Adreno 2xx GPU bugs [#9573](https://github.com/mapbox/mapbox-gl-native/pull/9573) +- Rework attribution binding [#9433](https://github.com/mapbox/mapbox-gl-native/pull/9433) +- BackendScope changes [#9538](https://github.com/mapbox/mapbox-gl-native/pull/9538) +- Invisible MarkerView performance fix [#9420](https://github.com/mapbox/mapbox-gl-native/pull/9420) +- Polyline/Polygon click listeners [#9443](https://github.com/mapbox/mapbox-gl-native/pull/9443) +- Hit test Marker/MarkerViews [#9424](https://github.com/mapbox/mapbox-gl-native/pull/9424) +- Fine tune fling gesture [#9532](https://github.com/mapbox/mapbox-gl-native/pull/9532) +- Bump OkHttp 3.8.0, Android 7.x crashes [#9522](https://github.com/mapbox/mapbox-gl-native/pull/9522) +- MyLocationView tint fix [#9410](https://github.com/mapbox/mapbox-gl-native/pull/9410) +- VisibleRegion logic [#9428](https://github.com/mapbox/mapbox-gl-native/pull/9428) +- Validate motion event [#9434](https://github.com/mapbox/mapbox-gl-native/pull/9434) +- Add French localization [#9545](https://github.com/mapbox/mapbox-gl-native/pull/9545) +- Fix public.xml [#9525](https://github.com/mapbox/mapbox-gl-native/pull/9525/files) +- Manage InfoWindow selection in AnnotationManager [#9567](https://github.com/mapbox/mapbox-gl-native/pull/9567) +- Increase touch target size [#9565](https://github.com/mapbox/mapbox-gl-native/pull/9565) +- Work around Adreno 2xx GPU bugs [#9573](https://github.com/mapbox/mapbox-gl-native/pull/9573) ## 5.1.0 - June 30, 2017 -* Update to MAS 2.1.3 [#9402](https://github.com/mapbox/mapbox-gl-native/pull/9402) -* Downgrade LOST to v1.1.1 [#9394](https://github.com/mapbox/mapbox-gl-native/pull/9394) -* OnCameraIdle hook into quickzoom gesture [#9339](https://github.com/mapbox/mapbox-gl-native/pull/9339) -* LatLngBounds conversion regression, add test [#9324](https://github.com/mapbox/mapbox-gl-native/pull/9324) +- Update to MAS 2.1.3 [#9402](https://github.com/mapbox/mapbox-gl-native/pull/9402) +- Downgrade LOST to v1.1.1 [#9394](https://github.com/mapbox/mapbox-gl-native/pull/9394) +- OnCameraIdle hook into quickzoom gesture [#9339](https://github.com/mapbox/mapbox-gl-native/pull/9339) +- LatLngBounds conversion regression, add test [#9324](https://github.com/mapbox/mapbox-gl-native/pull/9324) ## 5.1.0-beta.5 - June 21, 2017 -* Update MAS dependency to 2.1.2 [#9311](https://github.com/mapbox/mapbox-gl-native/pull/9311) -* Update LOST dependency to 3.0.1 [#9302](https://github.com/mapbox/mapbox-gl-native/pull/9302) -* Fix Pulse example Parcelable creator [#9283](https://github.com/mapbox/mapbox-gl-native/pull/9283) -* Custom marker view anchoring [#9282](https://github.com/mapbox/mapbox-gl-native/pull/9282) -* Update Activity test generation [#9276](https://github.com/mapbox/mapbox-gl-native/pull/9276) -* Validate camera position before transforming [#9275](https://github.com/mapbox/mapbox-gl-native/pull/9275) -* Revisit javadoc [#9266](https://github.com/mapbox/mapbox-gl-native/pull/9266) -* Build with NDK 15 [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263) -* Snapshot with view content [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263) -* Update source changed javadoc [#9243](https://github.com/mapbox/mapbox-gl-native/pull/9243) -* Run tests on UI-thread [#9198](https://github.com/mapbox/mapbox-gl-native/pull/9198) -* Fix trackball on worker thread [#9305](https://github.com/mapbox/mapbox-gl-native/pull/9305) +- Update MAS dependency to 2.1.2 [#9311](https://github.com/mapbox/mapbox-gl-native/pull/9311) +- Update LOST dependency to 3.0.1 [#9302](https://github.com/mapbox/mapbox-gl-native/pull/9302) +- Fix Pulse example Parcelable creator [#9283](https://github.com/mapbox/mapbox-gl-native/pull/9283) +- Custom marker view anchoring [#9282](https://github.com/mapbox/mapbox-gl-native/pull/9282) +- Update Activity test generation [#9276](https://github.com/mapbox/mapbox-gl-native/pull/9276) +- Validate camera position before transforming [#9275](https://github.com/mapbox/mapbox-gl-native/pull/9275) +- Revisit javadoc [#9266](https://github.com/mapbox/mapbox-gl-native/pull/9266) +- Build with NDK 15 [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263) +- Snapshot with view content [#9263](https://github.com/mapbox/mapbox-gl-native/pull/9263) +- Update source changed javadoc [#9243](https://github.com/mapbox/mapbox-gl-native/pull/9243) +- Run tests on UI-thread [#9198](https://github.com/mapbox/mapbox-gl-native/pull/9198) +- Fix trackball on worker thread [#9305](https://github.com/mapbox/mapbox-gl-native/pull/9305) ## 5.1.0-beta.4 - June 9, 2017 -* Option to disable location change animation [#9210](https://github.com/mapbox/mapbox-gl-native/pull/9210) -* Invalidating MyLocationView bearing when not following [#9212](https://github.com/mapbox/mapbox-gl-native/pull/9212) -* Remove upgrade runtime exceptions [#9191](https://github.com/mapbox/mapbox-gl-native/pull/9191) -* Check source usage before removal [#9129](https://github.com/mapbox/mapbox-gl-native/pull/9129) -* Fix tracking mode + camera race condition [#9133](https://github.com/mapbox/mapbox-gl-native/pull/9133) -* Harden orientation changes [#9128](https://github.com/mapbox/mapbox-gl-native/pull/9128) -* Infinite location animation updates [#9194](https://github.com/mapbox/mapbox-gl-native/pull/9194) -* Invoke callback with valid fling gestures [#9192](https://github.com/mapbox/mapbox-gl-native/pull/9192) -* Keep location tracking after screen rotation [#9187](https://github.com/mapbox/mapbox-gl-native/pull/9187) -* Update components with camera values when animating [#9174](https://github.com/mapbox/mapbox-gl-native/pull/9174) -* Validate if gestures should execute [#9173](https://github.com/mapbox/mapbox-gl-native/pull/9173) -* Custom location source and LOST integration [#9142](https://github.com/mapbox/mapbox-gl-native/pull/9142) +- Option to disable location change animation [#9210](https://github.com/mapbox/mapbox-gl-native/pull/9210) +- Invalidating MyLocationView bearing when not following [#9212](https://github.com/mapbox/mapbox-gl-native/pull/9212) +- Remove upgrade runtime exceptions [#9191](https://github.com/mapbox/mapbox-gl-native/pull/9191) +- Check source usage before removal [#9129](https://github.com/mapbox/mapbox-gl-native/pull/9129) +- Fix tracking mode + camera race condition [#9133](https://github.com/mapbox/mapbox-gl-native/pull/9133) +- Harden orientation changes [#9128](https://github.com/mapbox/mapbox-gl-native/pull/9128) +- Infinite location animation updates [#9194](https://github.com/mapbox/mapbox-gl-native/pull/9194) +- Invoke callback with valid fling gestures [#9192](https://github.com/mapbox/mapbox-gl-native/pull/9192) +- Keep location tracking after screen rotation [#9187](https://github.com/mapbox/mapbox-gl-native/pull/9187) +- Update components with camera values when animating [#9174](https://github.com/mapbox/mapbox-gl-native/pull/9174) +- Validate if gestures should execute [#9173](https://github.com/mapbox/mapbox-gl-native/pull/9173) +- Custom location source and LOST integration [#9142](https://github.com/mapbox/mapbox-gl-native/pull/9142) ## 5.1.0-beta.3 - May 26, 2017 -* Add binding support for Light [#9013](https://github.com/mapbox/mapbox-gl-native/pull/9013) -* Update attribution with new Mapbox wordmark [#8774](https://github.com/mapbox/mapbox-gl-native/pull/8774) -* LatLngBounds bearing default value [#9102](https://github.com/mapbox/mapbox-gl-native/pull/9102) -* Stop location updates when toggling MyLocationView [#9099](https://github.com/mapbox/mapbox-gl-native/pull/9099) -* Horizontally rotated in snapshot [#9083](https://github.com/mapbox/mapbox-gl-native/pull/9083) -* Disable letter spacing for Arabic text [#9071](https://github.com/mapbox/mapbox-gl-native/pull/9071) -* Correct bearing conversion when animating the map [#9050](https://github.com/mapbox/mapbox-gl-native/pull/9050) -* Don't leak selected markers when removing [#9047](https://github.com/mapbox/mapbox-gl-native/pull/9047) -* Bump tools and support lib version [#9046](https://github.com/mapbox/mapbox-gl-native/pull/9046) -* MarkerView deselect events with OnMarkerViewClickListener [#9047](https://github.com/mapbox/mapbox-gl-native/pull/9047) -* LOST update to v3.0.0 [#9112](https://github.com/mapbox/mapbox-gl-native/pull/9112) -* Convert dp to pixels for meters per pixel at latitude [#9048](https://github.com/mapbox/mapbox-gl-native/pull/9048) +- Add binding support for Light [#9013](https://github.com/mapbox/mapbox-gl-native/pull/9013) +- Update attribution with new Mapbox wordmark [#8774](https://github.com/mapbox/mapbox-gl-native/pull/8774) +- LatLngBounds bearing default value [#9102](https://github.com/mapbox/mapbox-gl-native/pull/9102) +- Stop location updates when toggling MyLocationView [#9099](https://github.com/mapbox/mapbox-gl-native/pull/9099) +- Horizontally rotated in snapshot [#9083](https://github.com/mapbox/mapbox-gl-native/pull/9083) +- Disable letter spacing for Arabic text [#9071](https://github.com/mapbox/mapbox-gl-native/pull/9071) +- Correct bearing conversion when animating the map [#9050](https://github.com/mapbox/mapbox-gl-native/pull/9050) +- Don't leak selected markers when removing [#9047](https://github.com/mapbox/mapbox-gl-native/pull/9047) +- Bump tools and support lib version [#9046](https://github.com/mapbox/mapbox-gl-native/pull/9046) +- MarkerView deselect events with OnMarkerViewClickListener [#9047](https://github.com/mapbox/mapbox-gl-native/pull/9047) +- LOST update to v3.0.0 [#9112](https://github.com/mapbox/mapbox-gl-native/pull/9112) +- Convert dp to pixels for meters per pixel at latitude [#9048](https://github.com/mapbox/mapbox-gl-native/pull/9048) ## 5.1.0-beta.2 - May 12, 2017 5.1.0-beta.2 builds further on 5.1.0-beta.1 and adds: -* When a layer is added, reload its source's tiles [#8963](https://github.com/mapbox/mapbox-gl-native/pull/8963) -* Update release script to support CircleCI builds [#8950](https://github.com/mapbox/mapbox-gl-native/pull/8950) -* URL getter on Sources [#8959](https://github.com/mapbox/mapbox-gl-native/pull/8959) -* Build SNAPSHOT from release branch CI configuration [#8958](https://github.com/mapbox/mapbox-gl-native/pull/8958) -* Fix UI test filter in Makefile [#8960](https://github.com/mapbox/mapbox-gl-native/pull/8960) -* Bump & fixup dependencies [#8921](https://github.com/mapbox/mapbox-gl-native/pull/8921) -* Ignore already deleted region [#8920](https://github.com/mapbox/mapbox-gl-native/pull/8920) -* Keep offline observer when timeout occurs [#8919](https://github.com/mapbox/mapbox-gl-native/pull/8919) -* Show error message when no browser installed [#8920](https://github.com/mapbox/mapbox-gl-native/pull/8920) -* Reset observers of removed Sources and Layers [#8900](https://github.com/mapbox/mapbox-gl-native/pull/8900) -* Only build custom layer .so for debug builds [#8885](https://github.com/mapbox/mapbox-gl-native/pull/8885) -* Update localizations [#8883](https://github.com/mapbox/mapbox-gl-native/pull/8883) -* Reset observers of removed Sources and Layers [#8862](https://github.com/mapbox/mapbox-gl-native/pull/8862) -* Remove force style cascade [#8866](https://github.com/mapbox/mapbox-gl-native/pull/8866) -* Update proguard config [#8944](https://github.com/mapbox/mapbox-gl-native/pull/8944) -* Update LOST to 2.3.0-SNAPSHOT [#8872](https://github.com/mapbox/mapbox-gl-native/pull/8872) -* Update logo [#8774](https://github.com/mapbox/mapbox-gl-native/pull/8774) -* Camera change listener v2.0 [#8644](https://github.com/mapbox/mapbox-gl-native/pull/8644) -* Allow filesource url transform reset [#8957](https://github.com/mapbox/mapbox-gl-native/pull/8957) +- When a layer is added, reload its source's tiles [#8963](https://github.com/mapbox/mapbox-gl-native/pull/8963) +- Update release script to support CircleCI builds [#8950](https://github.com/mapbox/mapbox-gl-native/pull/8950) +- URL getter on Sources [#8959](https://github.com/mapbox/mapbox-gl-native/pull/8959) +- Build SNAPSHOT from release branch CI configuration [#8958](https://github.com/mapbox/mapbox-gl-native/pull/8958) +- Fix UI test filter in Makefile [#8960](https://github.com/mapbox/mapbox-gl-native/pull/8960) +- Bump & fixup dependencies [#8921](https://github.com/mapbox/mapbox-gl-native/pull/8921) +- Ignore already deleted region [#8920](https://github.com/mapbox/mapbox-gl-native/pull/8920) +- Keep offline observer when timeout occurs [#8919](https://github.com/mapbox/mapbox-gl-native/pull/8919) +- Show error message when no browser installed [#8920](https://github.com/mapbox/mapbox-gl-native/pull/8920) +- Reset observers of removed Sources and Layers [#8900](https://github.com/mapbox/mapbox-gl-native/pull/8900) +- Only build custom layer .so for debug builds [#8885](https://github.com/mapbox/mapbox-gl-native/pull/8885) +- Update localizations [#8883](https://github.com/mapbox/mapbox-gl-native/pull/8883) +- Reset observers of removed Sources and Layers [#8862](https://github.com/mapbox/mapbox-gl-native/pull/8862) +- Remove force style cascade [#8866](https://github.com/mapbox/mapbox-gl-native/pull/8866) +- Update proguard config [#8944](https://github.com/mapbox/mapbox-gl-native/pull/8944) +- Update LOST to 2.3.0-SNAPSHOT [#8872](https://github.com/mapbox/mapbox-gl-native/pull/8872) +- Update logo [#8774](https://github.com/mapbox/mapbox-gl-native/pull/8774) +- Camera change listener v2.0 [#8644](https://github.com/mapbox/mapbox-gl-native/pull/8644) +- Allow filesource url transform reset [#8957](https://github.com/mapbox/mapbox-gl-native/pull/8957) ## 5.1.0-beta.1 - May 2, 2017 5.1.0-beta.1 builds further on 5.0.2 and adds: -* Support for FillExtrusionLayer [#8431](https://github.com/mapbox/mapbox-gl-native/pull/8431) -* Limit Viewport [#8622](https://github.com/mapbox/mapbox-gl-native/pull/8622) -* Transition Properties for Layer attributes [#8509](https://github.com/mapbox/mapbox-gl-native/pull/8509) -* Style wide transition duration and transition offset in milliseconds [#8576](https://github.com/mapbox/mapbox-gl-native/pull/8576) -* Transifex integration, Catalan & Dutch translations [#8556](https://github.com/mapbox/mapbox-gl-native/pull/8556) -* LatLngBounds includes with another bounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) -* LatLngBounds includes takes in account LatLng on the edges (cfr. core) [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) -* LatLngBounds facility getters/setters for LatLnbg on the edges of the bounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) -* Expose world bounds in LatLngBounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) -* OfflineRegion are validated if the bounds is found in the world bounds, else onError will be invoked [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) -* Polygon holes [#8557](https://github.com/mapbox/mapbox-gl-native/pull/8557) and [#8722](https://github.com/mapbox/mapbox-gl-native/pull/8722) -* Custom location source [#8710](https://github.com/mapbox/mapbox-gl-native/pull/8710) -* Expose source layer identifier [#8709](https://github.com/mapbox/mapbox-gl-native/pull/8709) -* Ensure surface is created after display and context [#8759](https://github.com/mapbox/mapbox-gl-native/pull/8759) -* Harden telemetry event dispatch [#8767](https://github.com/mapbox/mapbox-gl-native/pull/8767) -* Move LatLngBounds calculation for CameraUpdateFactory to core [#8765](https://github.com/mapbox/mapbox-gl-native/pull/8765) -* Spanish, Lithuanian, and Vietnamese localizations [#8852](https://github.com/mapbox/mapbox-gl-native/pull/8852) -* Warning when updating a non-added annotation [#8832](https://github.com/mapbox/mapbox-gl-native/pull/8832) -* Share location source between components [#8825](https://github.com/mapbox/mapbox-gl-native/pull/8825) -* Test application runtime permissions for pre lollipop devices [#8823](https://github.com/mapbox/mapbox-gl-native/pull/8823) -* Do not call OnMarkerClick listener twice [#8804](https://github.com/mapbox/mapbox-gl-native/pull/8804) -* Rework instrumentation tests [#8793](https://github.com/mapbox/mapbox-gl-native/pull/8793) -* Set first render flag to false when destroying the surface [#8739](https://github.com/mapbox/mapbox-gl-native/pull/8739) -* Post resetting tracking settings to avoid race condition reset [#8738](https://github.com/mapbox/mapbox-gl-native/pull/8738) -* Expose Source Layer identifier [#8709](https://github.com/mapbox/mapbox-gl-native/pull/8709) -* Derived source attribution [#8630](https://github.com/mapbox/mapbox-gl-native/pull/8630) -* Consistent use of duration unit [#8578](https://github.com/mapbox/mapbox-gl-native/pull/8578) -* Swedish localization [#8883](https://github.com/mapbox/mapbox-gl-native/pull/8883) -* Streets v10, Outdoors v10, Satellite Streets v10, Traffic Day v2, Traffic Night v2 [#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301) +- Support for FillExtrusionLayer [#8431](https://github.com/mapbox/mapbox-gl-native/pull/8431) +- Limit Viewport [#8622](https://github.com/mapbox/mapbox-gl-native/pull/8622) +- Transition Properties for Layer attributes [#8509](https://github.com/mapbox/mapbox-gl-native/pull/8509) +- Style wide transition duration and transition offset in milliseconds [#8576](https://github.com/mapbox/mapbox-gl-native/pull/8576) +- Transifex integration, Catalan & Dutch translations [#8556](https://github.com/mapbox/mapbox-gl-native/pull/8556) +- LatLngBounds includes with another bounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +- LatLngBounds includes takes in account LatLng on the edges (cfr. core) [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +- LatLngBounds facility getters/setters for LatLnbg on the edges of the bounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +- Expose world bounds in LatLngBounds [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +- OfflineRegion are validated if the bounds is found in the world bounds, else onError will be invoked [#8517](https://github.com/mapbox/mapbox-gl-native/pull/8517) +- Polygon holes [#8557](https://github.com/mapbox/mapbox-gl-native/pull/8557) and [#8722](https://github.com/mapbox/mapbox-gl-native/pull/8722) +- Custom location source [#8710](https://github.com/mapbox/mapbox-gl-native/pull/8710) +- Expose source layer identifier [#8709](https://github.com/mapbox/mapbox-gl-native/pull/8709) +- Ensure surface is created after display and context [#8759](https://github.com/mapbox/mapbox-gl-native/pull/8759) +- Harden telemetry event dispatch [#8767](https://github.com/mapbox/mapbox-gl-native/pull/8767) +- Move LatLngBounds calculation for CameraUpdateFactory to core [#8765](https://github.com/mapbox/mapbox-gl-native/pull/8765) +- Spanish, Lithuanian, and Vietnamese localizations [#8852](https://github.com/mapbox/mapbox-gl-native/pull/8852) +- Warning when updating a non-added annotation [#8832](https://github.com/mapbox/mapbox-gl-native/pull/8832) +- Share location source between components [#8825](https://github.com/mapbox/mapbox-gl-native/pull/8825) +- Test application runtime permissions for pre lollipop devices [#8823](https://github.com/mapbox/mapbox-gl-native/pull/8823) +- Do not call OnMarkerClick listener twice [#8804](https://github.com/mapbox/mapbox-gl-native/pull/8804) +- Rework instrumentation tests [#8793](https://github.com/mapbox/mapbox-gl-native/pull/8793) +- Set first render flag to false when destroying the surface [#8739](https://github.com/mapbox/mapbox-gl-native/pull/8739) +- Post resetting tracking settings to avoid race condition reset [#8738](https://github.com/mapbox/mapbox-gl-native/pull/8738) +- Expose Source Layer identifier [#8709](https://github.com/mapbox/mapbox-gl-native/pull/8709) +- Derived source attribution [#8630](https://github.com/mapbox/mapbox-gl-native/pull/8630) +- Consistent use of duration unit [#8578](https://github.com/mapbox/mapbox-gl-native/pull/8578) +- Swedish localization [#8883](https://github.com/mapbox/mapbox-gl-native/pull/8883) +- Streets v10, Outdoors v10, Satellite Streets v10, Traffic Day v2, Traffic Night v2 [#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301) ## 5.0.2 - April 3, 2017 5.0.2 is a patch release that contains the following changes: -* Binary shader caching [#8604](https://github.com/mapbox/mapbox-gl-native/pull/8604) -* Fix resource transform callback [#8582](https://github.com/mapbox/mapbox-gl-native/pull/8582) -* Restore onTouch behaviour to 4.x version [#8585](https://github.com/mapbox/mapbox-gl-native/pull/8585) -* Restore anchoring after updating MarkerView Icon [#8519](https://github.com/mapbox/mapbox-gl-native/pull/8519) +- Binary shader caching [#8604](https://github.com/mapbox/mapbox-gl-native/pull/8604) +- Fix resource transform callback [#8582](https://github.com/mapbox/mapbox-gl-native/pull/8582) +- Restore onTouch behaviour to 4.x version [#8585](https://github.com/mapbox/mapbox-gl-native/pull/8585) +- Restore anchoring after updating MarkerView Icon [#8519](https://github.com/mapbox/mapbox-gl-native/pull/8519) ## 5.0.1 - March 22nd, 2017 5.0.1 is a patch release that addresses a shader precision issue that created a rendering problem on some devices. -* Use `highp` for color attributes [#8385](https://github.com/mapbox/mapbox-gl-native/issues/8385) +- Use `highp` for color attributes [#8385](https://github.com/mapbox/mapbox-gl-native/issues/8385) ## 5.0.0 - March 17th, 2017 5.0.0 final release contains: -* Support for data-driven styles [#7752](https://github.com/mapbox/mapbox-gl-native/pull/7752) -* Additional APIs to manage runtime styling layers [#8195](https://github.com/mapbox/mapbox-gl-native/pull/8195) -* Allow query all features in sources (`querySourceFeatures`) [#5792](https://github.com/mapbox/mapbox-gl-native/issues/5792) -* Improve accessibility TalkBack support by including content description in views [#8230](https://github.com/mapbox/mapbox-gl-native/pull/8230) -* Consistent double tap zoom acceleration [#7514](https://github.com/mapbox/mapbox-gl-native/issues/7514) -* Allow zooming/scaling to use `AnimationOptions` [#8181](https://github.com/mapbox/mapbox-gl-native/pull/8181) -* Cleanup inconsistencies `float` vs `double` [#4445](https://github.com/mapbox/mapbox-gl-native/issues/4445) -* Add `mapbox_` prefix to attributes [#6482](https://github.com/mapbox/mapbox-gl-native/issues/6482) -* Update LOST to 2.x [#6573](https://github.com/mapbox/mapbox-gl-native/issues/6537) -* MAS submodules (`geojson`, `telemetry`) are now smaller to reduce the overall method count [#7642](https://github.com/mapbox/mapbox-gl-native/pull/7642) -* Telemetry Service is now include automatically via Manifest merge to simplify set up [#8338](https://github.com/mapbox/mapbox-gl-native/pull/8338) -* Support for Android Nougat [#5910](5910-move-listener-logic-for-nougat) +- Support for data-driven styles [#7752](https://github.com/mapbox/mapbox-gl-native/pull/7752) +- Additional APIs to manage runtime styling layers [#8195](https://github.com/mapbox/mapbox-gl-native/pull/8195) +- Allow query all features in sources (`querySourceFeatures`) [#5792](https://github.com/mapbox/mapbox-gl-native/issues/5792) +- Improve accessibility TalkBack support by including content description in views [#8230](https://github.com/mapbox/mapbox-gl-native/pull/8230) +- Consistent double tap zoom acceleration [#7514](https://github.com/mapbox/mapbox-gl-native/issues/7514) +- Allow zooming/scaling to use `AnimationOptions` [#8181](https://github.com/mapbox/mapbox-gl-native/pull/8181) +- Cleanup inconsistencies `float` vs `double` [#4445](https://github.com/mapbox/mapbox-gl-native/issues/4445) +- Add `mapbox_` prefix to attributes [#6482](https://github.com/mapbox/mapbox-gl-native/issues/6482) +- Update LOST to 2.x [#6573](https://github.com/mapbox/mapbox-gl-native/issues/6537) +- MAS submodules (`geojson`, `telemetry`) are now smaller to reduce the overall method count [#7642](https://github.com/mapbox/mapbox-gl-native/pull/7642) +- Telemetry Service is now include automatically via Manifest merge to simplify set up [#8338](https://github.com/mapbox/mapbox-gl-native/pull/8338) +- Support for Android Nougat [#5910](5910-move-listener-logic-for-nougat) - Move location listening logic to `onStart`/`onStop` activity lifecylce methods -* Removal of `accessToken` on `MapView` and `MapboxMap` [#5621](https://github.com/mapbox/mapbox-gl-native/issues/5621) -* Introduction of new make targets [#5940](https://github.com/mapbox/mapbox-gl-native/issues/5940) +- Removal of `accessToken` on `MapView` and `MapboxMap` [#5621](https://github.com/mapbox/mapbox-gl-native/issues/5621) +- Introduction of new make targets [#5940](https://github.com/mapbox/mapbox-gl-native/issues/5940) - Targets for testing, running and using external tools directly from the command line -* Cleanup Gradle files [#6009](https://github.com/mapbox/mapbox-gl-native/issues/6009) +- Cleanup Gradle files [#6009](https://github.com/mapbox/mapbox-gl-native/issues/6009) - Introducing single purpose `.gradle` files -* Checkstyle integration [#7442](https://github.com/mapbox/mapbox-gl-native/pull/7442) -* Transform refactor [#6532](https://github.com/mapbox/mapbox-gl-native/issues/6532) +- Checkstyle integration [#7442](https://github.com/mapbox/mapbox-gl-native/pull/7442) +- Transform refactor [#6532](https://github.com/mapbox/mapbox-gl-native/issues/6532) - All camera related code is moved to a dedicated transform class cfr. core architecture -* Encapsulate gestures [#6557](https://github.com/mapbox/mapbox-gl-native/issues/6557) +- Encapsulate gestures [#6557](https://github.com/mapbox/mapbox-gl-native/issues/6557) - All gesture event code is encapsulated in `MapGestureDetector` - All key event code is encapsulated in `MapKeyListener` -* Transparent background for `MyLocationView` [#7116](https://github.com/mapbox/mapbox-gl-native/issues/7116) -* Correctly scale accuracy circle for `MyLocationView` [#8255](https://github.com/mapbox/mapbox-gl-native/pull/8255) -* Update documentation on generate sanity tests [#7147](https://github.com/mapbox/mapbox-gl-native/issues/7147) -* Update documentation on style templates [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) -* Fix `NullPointerException` during save instance state [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) -* Move management style to core [#7275](https://github.com/mapbox/mapbox-gl-native/issues/7275) -* Fix `OnCameraChange` not called for the final position of animation bug [#7350](https://github.com/mapbox/mapbox-gl-native/issues/7350) -* `MapboxAccountManager` refactor [#6534](https://github.com/mapbox/mapbox-gl-native/issues/6534) +- Transparent background for `MyLocationView` [#7116](https://github.com/mapbox/mapbox-gl-native/issues/7116) +- Correctly scale accuracy circle for `MyLocationView` [#8255](https://github.com/mapbox/mapbox-gl-native/pull/8255) +- Update documentation on generate sanity tests [#7147](https://github.com/mapbox/mapbox-gl-native/issues/7147) +- Update documentation on style templates [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) +- Fix `NullPointerException` during save instance state [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) +- Move management style to core [#7275](https://github.com/mapbox/mapbox-gl-native/issues/7275) +- Fix `OnCameraChange` not called for the final position of animation bug [#7350](https://github.com/mapbox/mapbox-gl-native/issues/7350) +- `MapboxAccountManager` refactor [#6534](https://github.com/mapbox/mapbox-gl-native/issues/6534) - Consolidating the location where tokens are set - Rename to reflect the increased responsibilities introduced in prior releases -* AnnotationManager refactor [#6067](https://github.com/mapbox/mapbox-gl-native/issues/6067) +- AnnotationManager refactor [#6067](https://github.com/mapbox/mapbox-gl-native/issues/6067) - Extracting all business logic related to annotations into a separate class cfr. to core and the iOS codebase -* Gesture handling improvements: +- Gesture handling improvements: - Fix missing call to `onFling` when while pinch zooming [#7666](https://github.com/mapbox/mapbox-gl-native/issues/7666) - Round tap-zoom gestures to nearest integer [#8027](https://github.com/mapbox/mapbox-gl-native/pull/8027) -* Support for style-wide transition animation duration and delay [#6779](https://github.com/mapbox/mapbox-gl-native/issues/6779) -* Allow callback parameter for style setting [#8262](https://github.com/mapbox/mapbox-gl-native/issues/8262) -* Support for all animated camera changes to configure dismissing tracking modes [#7854](https://github.com/mapbox/mapbox-gl-native/issues/7854) -* Avoid disabling location tracking on all gestures [#7878](https://github.com/mapbox/mapbox-gl-native/issues/7878) -* `LatLng` objects produced by the SDK are wrapped by default [#4522](https://github.com/mapbox/mapbox-gl-native/issues/4522) -* Proguard update for new SDK packages [#8437](https://github.com/mapbox/mapbox-gl-native/pull/8437) -* Javadoc cleanup [#8438](https://github.com/mapbox/mapbox-gl-native/pull/8438) -* MarkerViewClickListener and MapClickListener called simultaneously [#8447](https://github.com/mapbox/mapbox-gl-native/pull/8447) -* Fix LOST v2.0.0 integration [#8445](https://github.com/mapbox/mapbox-gl-native/pull/8445) -* Crash with OnMapChangeListener [#8380](https://github.com/mapbox/mapbox-gl-native/pull/8380) -* Feature query crash [#8374](https://github.com/mapbox/mapbox-gl-native/pull/8374) -* flyTo fix [#8302](https://github.com/mapbox/mapbox-gl-native/pull/8302) -* Don't dispatch MarkerView motion event up to MapView [#8447](https://github.com/mapbox/mapbox-gl-native/pull/8447) +- Support for style-wide transition animation duration and delay [#6779](https://github.com/mapbox/mapbox-gl-native/issues/6779) +- Allow callback parameter for style setting [#8262](https://github.com/mapbox/mapbox-gl-native/issues/8262) +- Support for all animated camera changes to configure dismissing tracking modes [#7854](https://github.com/mapbox/mapbox-gl-native/issues/7854) +- Avoid disabling location tracking on all gestures [#7878](https://github.com/mapbox/mapbox-gl-native/issues/7878) +- `LatLng` objects produced by the SDK are wrapped by default [#4522](https://github.com/mapbox/mapbox-gl-native/issues/4522) +- Proguard update for new SDK packages [#8437](https://github.com/mapbox/mapbox-gl-native/pull/8437) +- Javadoc cleanup [#8438](https://github.com/mapbox/mapbox-gl-native/pull/8438) +- MarkerViewClickListener and MapClickListener called simultaneously [#8447](https://github.com/mapbox/mapbox-gl-native/pull/8447) +- Fix LOST v2.0.0 integration [#8445](https://github.com/mapbox/mapbox-gl-native/pull/8445) +- Crash with OnMapChangeListener [#8380](https://github.com/mapbox/mapbox-gl-native/pull/8380) +- Feature query crash [#8374](https://github.com/mapbox/mapbox-gl-native/pull/8374) +- flyTo fix [#8302](https://github.com/mapbox/mapbox-gl-native/pull/8302) +- Don't dispatch MarkerView motion event up to MapView [#8447](https://github.com/mapbox/mapbox-gl-native/pull/8447) ## 5.0.0-beta.3 - March 10th, 2017 5.0.0-beta.3 focuses on addressing stability issues and bug fixes. It also includes: -* Allow query all features in sources (`querySourceFeatures`) [#5792](https://github.com/mapbox/mapbox-gl-native/issues/5792) -* Improve accessibility TalkBack support by including content description in views [#8230](https://github.com/mapbox/mapbox-gl-native/pull/8230) -* Allow zooming/scaling to use `AnimationOptions` [#8181](https://github.com/mapbox/mapbox-gl-native/pull/8181) -* Telemetry Service is now include automatically via Manifest merge to simplify set up [#8338](https://github.com/mapbox/mapbox-gl-native/pull/8338) -* Correctly scale accuracy circle for `MyLocationView` [#8255](https://github.com/mapbox/mapbox-gl-native/pull/8255) -* Round tap-zoom gestures to nearest integer [#8027](https://github.com/mapbox/mapbox-gl-native/pull/8027) -* Allow callback parameter for style setting [#8262](https://github.com/mapbox/mapbox-gl-native/issues/8262) -* Avoid disabling location tracking on all gestures [#7878](https://github.com/mapbox/mapbox-gl-native/issues/7878) +- Allow query all features in sources (`querySourceFeatures`) [#5792](https://github.com/mapbox/mapbox-gl-native/issues/5792) +- Improve accessibility TalkBack support by including content description in views [#8230](https://github.com/mapbox/mapbox-gl-native/pull/8230) +- Allow zooming/scaling to use `AnimationOptions` [#8181](https://github.com/mapbox/mapbox-gl-native/pull/8181) +- Telemetry Service is now include automatically via Manifest merge to simplify set up [#8338](https://github.com/mapbox/mapbox-gl-native/pull/8338) +- Correctly scale accuracy circle for `MyLocationView` [#8255](https://github.com/mapbox/mapbox-gl-native/pull/8255) +- Round tap-zoom gestures to nearest integer [#8027](https://github.com/mapbox/mapbox-gl-native/pull/8027) +- Allow callback parameter for style setting [#8262](https://github.com/mapbox/mapbox-gl-native/issues/8262) +- Avoid disabling location tracking on all gestures [#7878](https://github.com/mapbox/mapbox-gl-native/issues/7878) ## 5.0.0-beta.2 - March 1st, 2017 5.0.0-beta.2 focuses on addressing stability issues and bug fixes. It also includes: -* Data-driven styling for `{text,icon}-{color,opacity,halo-color,halo-blur,halo-width}` [#7939](https://github.com/mapbox/mapbox-gl-native/pull/7939) -* Additional APIs to manage runtime styling layers [#8195](https://github.com/mapbox/mapbox-gl-native/pull/8195) +- Data-driven styling for `{text,icon}-{color,opacity,halo-color,halo-blur,halo-width}` [#7939](https://github.com/mapbox/mapbox-gl-native/pull/7939) +- Additional APIs to manage runtime styling layers [#8195](https://github.com/mapbox/mapbox-gl-native/pull/8195) ## 5.0.0-beta.1 - February 14th, 2017 -* Support for data-driven styles [#7752](https://github.com/mapbox/mapbox-gl-native/pull/7752) -* Consistent double tap zoom acceleration [#7514](https://github.com/mapbox/mapbox-gl-native/issues/7514) -* Cleanup inconsistencies `float` vs `double` [#4445](https://github.com/mapbox/mapbox-gl-native/issues/4445) -* Add `mapbox_` prefix to attributes [#6482](https://github.com/mapbox/mapbox-gl-native/issues/6482) -* Update LOST to 2.0.0 [#6573](https://github.com/mapbox/mapbox-gl-native/issues/6537) -* MAS submodules (geojson, telemetry) are now smaller to reduce the overall method count [#7642](https://github.com/mapbox/mapbox-gl-native/pull/7642) -* Support for Android Nougat [#5910](5910-move-listener-logic-for-nougat) +- Support for data-driven styles [#7752](https://github.com/mapbox/mapbox-gl-native/pull/7752) +- Consistent double tap zoom acceleration [#7514](https://github.com/mapbox/mapbox-gl-native/issues/7514) +- Cleanup inconsistencies `float` vs `double` [#4445](https://github.com/mapbox/mapbox-gl-native/issues/4445) +- Add `mapbox_` prefix to attributes [#6482](https://github.com/mapbox/mapbox-gl-native/issues/6482) +- Update LOST to 2.0.0 [#6573](https://github.com/mapbox/mapbox-gl-native/issues/6537) +- MAS submodules (geojson, telemetry) are now smaller to reduce the overall method count [#7642](https://github.com/mapbox/mapbox-gl-native/pull/7642) +- Support for Android Nougat [#5910](5910-move-listener-logic-for-nougat) - Move location listening logic to onStart/onStop Activity lifecylce methods -* Removal of `accessToken` on `MapView` and `MapboxMap` [#5621](https://github.com/mapbox/mapbox-gl-native/issues/5621) -* Introduction of new make targets [#5940](https://github.com/mapbox/mapbox-gl-native/issues/5940) +- Removal of `accessToken` on `MapView` and `MapboxMap` [#5621](https://github.com/mapbox/mapbox-gl-native/issues/5621) +- Introduction of new make targets [#5940](https://github.com/mapbox/mapbox-gl-native/issues/5940) - Targets for testing, running and using external tools directly from the command line -* Cleanup Gradle files [#6009](https://github.com/mapbox/mapbox-gl-native/issues/6009) +- Cleanup Gradle files [#6009](https://github.com/mapbox/mapbox-gl-native/issues/6009) - Introducing single purpose `.gradle` files -* Checkstyle integration [#7442](https://github.com/mapbox/mapbox-gl-native/pull/7442) -* Transform refactor [#6532](https://github.com/mapbox/mapbox-gl-native/issues/6532) +- Checkstyle integration [#7442](https://github.com/mapbox/mapbox-gl-native/pull/7442) +- Transform refactor [#6532](https://github.com/mapbox/mapbox-gl-native/issues/6532) - All camera related code is moved to a dedicated transform class cfr. core architecture -* Encapsulate Gestures [#6557](https://github.com/mapbox/mapbox-gl-native/issues/6557) +- Encapsulate Gestures [#6557](https://github.com/mapbox/mapbox-gl-native/issues/6557) - All gesture event code is encapsulated in `MapGestureDetector` - All key event code is encapsulated in `MapKeyListener` -* Transparent background for `MyLocationView` [#7116](https://github.com/mapbox/mapbox-gl-native/issues/7116) -* Update documentation on generate sanity tests [#7147](https://github.com/mapbox/mapbox-gl-native/issues/7147) -* Update documentation on style templates [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) -* `NullPointerException` during save instance state [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) -* Move management style to core [#7275](https://github.com/mapbox/mapbox-gl-native/issues/7275) -* `OnCameraChange` not called for the final position of animation bug [#7350](https://github.com/mapbox/mapbox-gl-native/issues/7350) -* `MapboxAccountManager` refactor [#6534](https://github.com/mapbox/mapbox-gl-native/issues/6534) +- Transparent background for `MyLocationView` [#7116](https://github.com/mapbox/mapbox-gl-native/issues/7116) +- Update documentation on generate sanity tests [#7147](https://github.com/mapbox/mapbox-gl-native/issues/7147) +- Update documentation on style templates [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) +- `NullPointerException` during save instance state [#7157](https://github.com/mapbox/mapbox-gl-native/issues/7157) +- Move management style to core [#7275](https://github.com/mapbox/mapbox-gl-native/issues/7275) +- `OnCameraChange` not called for the final position of animation bug [#7350](https://github.com/mapbox/mapbox-gl-native/issues/7350) +- `MapboxAccountManager` refactor [#6534](https://github.com/mapbox/mapbox-gl-native/issues/6534) - Consolidating the location where tokens are set - Rename to reflect the increased responsibilities introduced in prior releases -* AnnotationManager refactor [#6067](https://github.com/mapbox/mapbox-gl-native/issues/6067) +- AnnotationManager refactor [#6067](https://github.com/mapbox/mapbox-gl-native/issues/6067) - Extracting all business logic related to annotations into a separate class cfr. to core and the iOS codebase -* Gesture handling bugs +- Gesture handling bugs - Avoid calls to onFling when while pinch zooming [#7666](https://github.com/mapbox/mapbox-gl-native/issues/7666) -* Support for style-wide transition animation duration and delay [#6779](https://github.com/mapbox/mapbox-gl-native/issues/6779) -* Support for all animated camera changes to configure dismissing tracking modes [#7854](https://github.com/mapbox/mapbox-gl-native/issues/7854) -* `LatLng` objects produced by the SDK are wrapped by default for [compatibility](https://developers.google.com/android/reference/com/google/android/gms/maps/model/LatLng) with the Google Maps API on Android [#4522](https://github.com/mapbox/mapbox-gl-native/issues/4522) +- Support for style-wide transition animation duration and delay [#6779](https://github.com/mapbox/mapbox-gl-native/issues/6779) +- Support for all animated camera changes to configure dismissing tracking modes [#7854](https://github.com/mapbox/mapbox-gl-native/issues/7854) +- `LatLng` objects produced by the SDK are wrapped by default for [compatibility](https://developers.google.com/android/reference/com/google/android/gms/maps/model/LatLng) with the Google Maps API on Android [#4522](https://github.com/mapbox/mapbox-gl-native/issues/4522) ## 4.2.2 - January 27, 2017 Mapbox Android 4.2.2 builds further on v4.2.1 and resolves: -* OnFling gesture improvements - - Improve fling by calculating animation time based on velocity [#7676](https://github.com/mapbox/mapbox-gl-native/pull/7676) - - Avoid triggering a fling after a scale gesture [#7675](https://github.com/mapbox/mapbox-gl-native/issues/7675) -* Deselect marker on infowindow click [#7784](https://github.com/mapbox/mapbox-gl-native/issues/7784) -* Update build tools to Bitrise supported one [#7729](https://github.com/mapbox/mapbox-gl-native/issues/7729) -* Removal of redudant log statements in native_map_view.cpp [#7801](https://github.com/mapbox/mapbox-gl-native/issues/7801) -* Invalidate markersviews when updating their position [#7794](https://github.com/mapbox/mapbox-gl-native/issues/7794) -* Avoid clustering unclusterable GeoJSON [#7633](https://github.com/mapbox/mapbox-gl-native/pull/7633) -* Prevent null pointer exceptions when receiving connecitivy change events [#6858](https://github.com/mapbox/mapbox-gl-native/issues/6858) + +- OnFling gesture improvements + +* Improve fling by calculating animation time based on velocity [#7676](https://github.com/mapbox/mapbox-gl-native/pull/7676) +* Avoid triggering a fling after a scale gesture [#7675](https://github.com/mapbox/mapbox-gl-native/issues/7675) + +- Deselect marker on infowindow click [#7784](https://github.com/mapbox/mapbox-gl-native/issues/7784) +- Update build tools to Bitrise supported one [#7729](https://github.com/mapbox/mapbox-gl-native/issues/7729) +- Removal of redudant log statements in native_map_view.cpp [#7801](https://github.com/mapbox/mapbox-gl-native/issues/7801) +- Invalidate markersviews when updating their position [#7794](https://github.com/mapbox/mapbox-gl-native/issues/7794) +- Avoid clustering unclusterable GeoJSON [#7633](https://github.com/mapbox/mapbox-gl-native/pull/7633) +- Prevent null pointer exceptions when receiving connecitivy change events [#6858](https://github.com/mapbox/mapbox-gl-native/issues/6858) ## 4.2.1 - December 22, 2016 Mapbox Android 4.2.1 is a bugfix release build on top of 4.2.0 and resolves: -* Gesture handling bugs +- Gesture handling bugs - Reverse fling when tilted [#7383](https://github.com/mapbox/mapbox-gl-native/pull/7383) - Rotation is hard trigger [#7299](https://github.com/mapbox/mapbox-gl-native/pull/7299) -* Null pointer exception on TrackingSettings [#7505](https://github.com/mapbox/mapbox-gl-native/pull/7505) -* Patches to our CI integration [#7363](https://github.com/mapbox/mapbox-gl-native/pull/7363) & [#7385](https://github.com/mapbox/mapbox-gl-native/pull/7385) -* Screen density is now correctly applied for attributes [#7327](https://github.com/mapbox/mapbox-gl-native/pull/7327) -* Usage of LocalBroadCastReceiver [#7511](https://github.com/mapbox/mapbox-gl-native/pull/7511) +- Null pointer exception on TrackingSettings [#7505](https://github.com/mapbox/mapbox-gl-native/pull/7505) +- Patches to our CI integration [#7363](https://github.com/mapbox/mapbox-gl-native/pull/7363) & [#7385](https://github.com/mapbox/mapbox-gl-native/pull/7385) +- Screen density is now correctly applied for attributes [#7327](https://github.com/mapbox/mapbox-gl-native/pull/7327) +- Usage of LocalBroadCastReceiver [#7511](https://github.com/mapbox/mapbox-gl-native/pull/7511) ## 4.2.0 - December 14, 2016 Mapbox Android 4.2.0 contains all 4.2.0-beta.5 changes and adds: -* Adds additional documentation to APIs -* Resolved issue with marker views occasionally not showing up until a gesture was performed on map [#7239](https://github.com/mapbox/mapbox-gl-native/pull/7239) -* Added horizontal accuracy to location events [#7237](https://github.com/mapbox/mapbox-gl-native/pull/7237) -* Resolved issue with changing visibility of a layer [#7242](https://github.com/mapbox/mapbox-gl-native/pull/7242) -* Proguard improvement and fixes +- Adds additional documentation to APIs +- Resolved issue with marker views occasionally not showing up until a gesture was performed on map [#7239](https://github.com/mapbox/mapbox-gl-native/pull/7239) +- Added horizontal accuracy to location events [#7237](https://github.com/mapbox/mapbox-gl-native/pull/7237) +- Resolved issue with changing visibility of a layer [#7242](https://github.com/mapbox/mapbox-gl-native/pull/7242) +- Proguard improvement and fixes ## 4.2.0-beta.5 - October 25, 2016 @@ -2051,27 +2350,27 @@ Mapbox Android 4.2.0-beta.5 adds no new features, only bug fixes. Mapbox Android 4.2.0-beta.4 contains all 4.2.0-beta.3 changes and adds: -* Query rendered features by source [#6516](https://github.com/mapbox/mapbox-gl-native/issues/6516) -* Decreased logging for release builds [#6787](https://github.com/mapbox/mapbox-gl-native/pull/6787) -* setConnected method to manually set a connected flag [#6618](https://github.com/mapbox/mapbox-gl-native/pull/6618) +- Query rendered features by source [#6516](https://github.com/mapbox/mapbox-gl-native/issues/6516) +- Decreased logging for release builds [#6787](https://github.com/mapbox/mapbox-gl-native/pull/6787) +- setConnected method to manually set a connected flag [#6618](https://github.com/mapbox/mapbox-gl-native/pull/6618) ## 4.2.0-beta.3 - September 21, 2016 Mapbox Android 4.2.0-beta.3 contains all 4.2.0-beta.2 changes and adds: -* Configurable API endpoint [#6309](https://github.com/mapbox/mapbox-gl-native/pull/6309) -* Adjusted logging level for failed OkHttp requests [6356](https://github.com/mapbox/mapbox-gl-native/issues/6356) -* Offline improvements: +- Configurable API endpoint [#6309](https://github.com/mapbox/mapbox-gl-native/pull/6309) +- Adjusted logging level for failed OkHttp requests [6356](https://github.com/mapbox/mapbox-gl-native/issues/6356) +- Offline improvements: - Fix SQLite crashes by reverting WAL journal mode [#6320](https://github.com/mapbox/mapbox-gl-native/pull/6320) ## 4.2.0-beta.2 - August 25, 2016 Mapbox Android 4.2.0-beta.2 contains all 4.2.0-beta.1 changes and adds: -* Query rendered features [#5869](https://github.com/mapbox/mapbox-gl-native/issues/5869) -* Clustering [#5852](https://github.com/mapbox/mapbox-gl-native/issues/5852) -* Integrated support for [Mapbox Android Services](https://www.mapbox.com/android-sdk/#mapbox_android_services) -* Offline improvements: +- Query rendered features [#5869](https://github.com/mapbox/mapbox-gl-native/issues/5869) +- Clustering [#5852](https://github.com/mapbox/mapbox-gl-native/issues/5852) +- Integrated support for [Mapbox Android Services](https://www.mapbox.com/android-sdk/#mapbox_android_services) +- Offline improvements: - Enable external storage to host the tiles database [#5589](https://github.com/mapbox/mapbox-gl-native/issues/5589) - Stop delivering status updates when offline download is canceled [#5538](https://github.com/mapbox/mapbox-gl-native/issues/5538) - Update SQLite schema with WAL journal mode and normal sync [#5796](https://github.com/mapbox/mapbox-gl-native/pull/5796) @@ -2081,118 +2380,118 @@ Mapbox Android 4.2.0-beta.2 contains all 4.2.0-beta.1 changes and adds: Mapbox Android 4.2.0 introduces the Runtime Style API and improves performance. -* Runtime Style API ([#5610](https://github.com/mapbox/mapbox-gl-native/issues/5610)) -* Earcut ([#2444](https://github.com/mapbox/mapbox-gl-native/pull/2444)) -* Map view rendered with `SurfaceView` for improved performance [#5000](https://github.com/mapbox/mapbox-gl-native/issues/5000) +- Runtime Style API ([#5610](https://github.com/mapbox/mapbox-gl-native/issues/5610)) +- Earcut ([#2444](https://github.com/mapbox/mapbox-gl-native/pull/2444)) +- Map view rendered with `SurfaceView` for improved performance [#5000](https://github.com/mapbox/mapbox-gl-native/issues/5000) ## 4.1.1 - July 19, 2016 Mapbox Android 4.1.1 is a patch release and is recommended to upgrade to it as soon as possible. -* Default Styles Caching Crash ([#5722](https://github.com/mapbox/mapbox-gl-native/issues/5722)) +- Default Styles Caching Crash ([#5722](https://github.com/mapbox/mapbox-gl-native/issues/5722)) ## 4.1.0 - June 29, 2016 Mapbox Android 4.1.0 builds off our ambitious 4.0.0 version with 3 major new features being released. -* View Based Annotations ([#3276](https://github.com/mapbox/mapbox-gl-native/issues/3276)) -* UserLocationView Refactor ([#4396](https://github.com/mapbox/mapbox-gl-native/issues/4396)) -* MapboxAccountManager ([#5004](https://github.com/mapbox/mapbox-gl-native/issues/5004)) +- View Based Annotations ([#3276](https://github.com/mapbox/mapbox-gl-native/issues/3276)) +- UserLocationView Refactor ([#4396](https://github.com/mapbox/mapbox-gl-native/issues/4396)) +- MapboxAccountManager ([#5004](https://github.com/mapbox/mapbox-gl-native/issues/5004)) ## 4.1.0-beta.3 - June 20, 2016 -* New samples: - * [Location picker](https://github.com/mapbox/mapbox-gl-native/pull/5391) - * [Animate and rotate multiple markers](https://github.com/mapbox/mapbox-gl-native/issues/5299) - * [Scaling marker activity](https://github.com/mapbox/mapbox-gl-native/issues/5409) -* Marker improvements: - * [Expose MarkerView alpha](https://github.com/mapbox/mapbox-gl-native/pull/5329) - * [Icon should be optional for MarkerView](https://github.com/mapbox/mapbox-gl-native/pull/5328) - * [Expose an API to enable selection/deselection of markers on a map tap](https://github.com/mapbox/mapbox-gl-native/pull/5312) - * [Bring selected MarkerView to the front](https://github.com/mapbox/mapbox-gl-native/pull/5294) -* [Make gesture focal point configurable](https://github.com/mapbox/mapbox-gl-native/pull/5332) +- New samples: + - [Location picker](https://github.com/mapbox/mapbox-gl-native/pull/5391) + - [Animate and rotate multiple markers](https://github.com/mapbox/mapbox-gl-native/issues/5299) + - [Scaling marker activity](https://github.com/mapbox/mapbox-gl-native/issues/5409) +- Marker improvements: + - [Expose MarkerView alpha](https://github.com/mapbox/mapbox-gl-native/pull/5329) + - [Icon should be optional for MarkerView](https://github.com/mapbox/mapbox-gl-native/pull/5328) + - [Expose an API to enable selection/deselection of markers on a map tap](https://github.com/mapbox/mapbox-gl-native/pull/5312) + - [Bring selected MarkerView to the front](https://github.com/mapbox/mapbox-gl-native/pull/5294) +- [Make gesture focal point configurable](https://github.com/mapbox/mapbox-gl-native/pull/5332) ## 4.1.0-beta.2 - June 8, 2016 -* Dynamically Update InfoWindow ([#5237](https://github.com/mapbox/mapbox-gl-native/issues/5237)) -* armeabi ABI Work On armv7 Devices ([#3985](https://github.com/mapbox/mapbox-gl-native/issues/3985)) -* Remove Adapter Requirement For MarkerView ([#5214](https://github.com/mapbox/mapbox-gl-native/issues/5214)) -* Always Current Version Style URL Constants ([#5193](https://github.com/mapbox/mapbox-gl-native/issues/5193)) -* Random NullPointerException On Telemetry ([#5186](https://github.com/mapbox/mapbox-gl-native/issues/5186)) +- Dynamically Update InfoWindow ([#5237](https://github.com/mapbox/mapbox-gl-native/issues/5237)) +- armeabi ABI Work On armv7 Devices ([#3985](https://github.com/mapbox/mapbox-gl-native/issues/3985)) +- Remove Adapter Requirement For MarkerView ([#5214](https://github.com/mapbox/mapbox-gl-native/issues/5214)) +- Always Current Version Style URL Constants ([#5193](https://github.com/mapbox/mapbox-gl-native/issues/5193)) +- Random NullPointerException On Telemetry ([#5186](https://github.com/mapbox/mapbox-gl-native/issues/5186)) ## 4.1.0-beta.1 - May 26, 2016 -Mapbox Android 4.1.0 builds off our ambitious 4.0.0 version with 3 major new features being released. To help us produce the highest quality SDK possible we're releasing an official Beta release first so that everyone has time to explore it and help hardened it before the official 4.1.0 Final Release. +Mapbox Android 4.1.0 builds off our ambitious 4.0.0 version with 3 major new features being released. To help us produce the highest quality SDK possible we're releasing an official Beta release first so that everyone has time to explore it and help hardened it before the official 4.1.0 Final Release. -* View Based Annotations ([#3276](https://github.com/mapbox/mapbox-gl-native/issues/3276)) -* UserLocationView Refactor ([#4396](https://github.com/mapbox/mapbox-gl-native/issues/4396)) -* MapboxAccountManager ([#5004](https://github.com/mapbox/mapbox-gl-native/issues/5004)) +- View Based Annotations ([#3276](https://github.com/mapbox/mapbox-gl-native/issues/3276)) +- UserLocationView Refactor ([#4396](https://github.com/mapbox/mapbox-gl-native/issues/4396)) +- MapboxAccountManager ([#5004](https://github.com/mapbox/mapbox-gl-native/issues/5004)) ## 4.0.1 - May 12, 2016 Mapbox Android 4.0.1 is a patch release to make this bug fix available sooner. -* MapboxMap.removeAnnotations() doesn't remove markers ([#4553](https://github.com/mapbox/mapbox-gl-native/issues/4553)) +- MapboxMap.removeAnnotations() doesn't remove markers ([#4553](https://github.com/mapbox/mapbox-gl-native/issues/4553)) ## 4.0.0 - March 30, 2016 Mapbox Android 4.0.0 contains the following 3 major new features. -* MapboxMap API Change ([#3145](https://github.com/mapbox/mapbox-gl-native/issues/3145)) -* Offline Maps ([#3891](https://github.com/mapbox/mapbox-gl-native/issues/3891)) -* Telemetry ([#2421](https://github.com/mapbox/mapbox-gl-native/issues/2421)) +- MapboxMap API Change ([#3145](https://github.com/mapbox/mapbox-gl-native/issues/3145)) +- Offline Maps ([#3891](https://github.com/mapbox/mapbox-gl-native/issues/3891)) +- Telemetry ([#2421](https://github.com/mapbox/mapbox-gl-native/issues/2421)) ## 4.0.0-rc.1 - March 25, 2016 -* Default Value Bug Fix for MapboxMapOptions ([#4398](https://github.com/mapbox/mapbox-gl-native/issues/4398)) -* NullPointerException When Scrolling ([#4424](https://github.com/mapbox/mapbox-gl-native/issues/4424)) -* Platform Specific CHANGELOGS ([#4432](https://github.com/mapbox/mapbox-gl-native/issues/4432)) -* Introduce LatLng.wrap() ([#4475](https://github.com/mapbox/mapbox-gl-native/issues/4475)) +- Default Value Bug Fix for MapboxMapOptions ([#4398](https://github.com/mapbox/mapbox-gl-native/issues/4398)) +- NullPointerException When Scrolling ([#4424](https://github.com/mapbox/mapbox-gl-native/issues/4424)) +- Platform Specific CHANGELOGS ([#4432](https://github.com/mapbox/mapbox-gl-native/issues/4432)) +- Introduce LatLng.wrap() ([#4475](https://github.com/mapbox/mapbox-gl-native/issues/4475)) ## 4.0.0-beta.2 - March 21, 2016 -* arm64 ABI Support ([#3128](https://github.com/mapbox/mapbox-gl-native/issues/3128)) -* Unify Offline And Cache Databases ([#4362](https://github.com/mapbox/mapbox-gl-native/issues/4362)) -* Offline Database Vacuuming ([#4342](https://github.com/mapbox/mapbox-gl-native/pull/4342)) -* Telemetry User Agent Fix ([#4328](https://github.com/mapbox/mapbox-gl-native/issues/4328)) -* OnCameraChange Bug Fix ([#4327](https://github.com/mapbox/mapbox-gl-native/issues/4327)) -* OnCameraChangeListener vs getCameraPosition ([#4326](https://github.com/mapbox/mapbox-gl-native/issues/4326)) +- arm64 ABI Support ([#3128](https://github.com/mapbox/mapbox-gl-native/issues/3128)) +- Unify Offline And Cache Databases ([#4362](https://github.com/mapbox/mapbox-gl-native/issues/4362)) +- Offline Database Vacuuming ([#4342](https://github.com/mapbox/mapbox-gl-native/pull/4342)) +- Telemetry User Agent Fix ([#4328](https://github.com/mapbox/mapbox-gl-native/issues/4328)) +- OnCameraChange Bug Fix ([#4327](https://github.com/mapbox/mapbox-gl-native/issues/4327)) +- OnCameraChangeListener vs getCameraPosition ([#4326](https://github.com/mapbox/mapbox-gl-native/issues/4326)) ## 4.0.0-beta.1 - March 15, 2016 Mapbox Android 4.0.0 is the most ambitious Android release to date with 3 major new features being released. To help us produce the highest quality SDK possible we're releasing an official Beta release first so that everyone has time to explore it and help hardened it before the official 4.0.0 Final Release. -* MapboxMap API Change ([#3145](https://github.com/mapbox/mapbox-gl-native/issues/3145)) -* Offline Maps ([#3891](https://github.com/mapbox/mapbox-gl-native/issues/3891)) -* Telemetry ([#2421](https://github.com/mapbox/mapbox-gl-native/issues/2421)) +- MapboxMap API Change ([#3145](https://github.com/mapbox/mapbox-gl-native/issues/3145)) +- Offline Maps ([#3891](https://github.com/mapbox/mapbox-gl-native/issues/3891)) +- Telemetry ([#2421](https://github.com/mapbox/mapbox-gl-native/issues/2421)) ## 3.2.0 - January 28, 2016 -* Fixed crash caused by annotation image with non-integer width or height ([#3031](https://github.com/mapbox/mapbox-gl-native/issues/3031)) -* Tracking Mode Reverses Bearing Fix ([#3664](https://github.com/mapbox/mapbox-gl-native/issues/3664)) -* GPS Extra Rotation Fix ([#3661](https://github.com/mapbox/mapbox-gl-native/issues/3661)) -* Added new methods for getting and setting the min and max zoom levels: `getMinZoom`, `setMinZoom`, `getMaxZoom`, `setMaxZoom`. ([#509](https://github.com/mapbox/mapbox-gl-native/issues/509)) +- Fixed crash caused by annotation image with non-integer width or height ([#3031](https://github.com/mapbox/mapbox-gl-native/issues/3031)) +- Tracking Mode Reverses Bearing Fix ([#3664](https://github.com/mapbox/mapbox-gl-native/issues/3664)) +- GPS Extra Rotation Fix ([#3661](https://github.com/mapbox/mapbox-gl-native/issues/3661)) +- Added new methods for getting and setting the min and max zoom levels: `getMinZoom`, `setMinZoom`, `getMaxZoom`, `setMaxZoom`. ([#509](https://github.com/mapbox/mapbox-gl-native/issues/509)) ## 3.1.0 - January 20, 2016 -* Camera API Callback Improvements ([#3412](https://github.com/mapbox/mapbox-gl-native/issues/3412)) -* Coordinate Deprecated For LatLng ([#3309](https://github.com/mapbox/mapbox-gl-native/issues/3309)) -* Responsive User Dot Location Tracking ([#2049](https://github.com/mapbox/mapbox-gl-native/issues/2049)) +- Camera API Callback Improvements ([#3412](https://github.com/mapbox/mapbox-gl-native/issues/3412)) +- Coordinate Deprecated For LatLng ([#3309](https://github.com/mapbox/mapbox-gl-native/issues/3309)) +- Responsive User Dot Location Tracking ([#2049](https://github.com/mapbox/mapbox-gl-native/issues/2049)) ## 3.0.0 - December 21, 2015 -* Added Camera API ([#3244](https://github.com/mapbox/mapbox-gl-native/issues/3244)) -* Custom Layer Support ([#3248](https://github.com/mapbox/mapbox-gl-native/issues/3348)) -* Reverse Tilt Gesutre Detection ([#3245](https://github.com/mapbox/mapbox-gl-native/issues/3245)) -* Decoupled Location Provider ([#2954](https://github.com/mapbox/mapbox-gl-native/issues/2954)) +- Added Camera API ([#3244](https://github.com/mapbox/mapbox-gl-native/issues/3244)) +- Custom Layer Support ([#3248](https://github.com/mapbox/mapbox-gl-native/issues/3348)) +- Reverse Tilt Gesutre Detection ([#3245](https://github.com/mapbox/mapbox-gl-native/issues/3245)) +- Decoupled Location Provider ([#2954](https://github.com/mapbox/mapbox-gl-native/issues/2954)) ## 2.3.0 - December 4, 2015 -* Added Tilt / Pitch Support ([#2805](https://github.com/mapbox/mapbox-gl-native/issues/2805)) -* Keep InfoWindow Open When Panning ([#3121](https://github.com/mapbox/mapbox-gl-native/issues/3121)) -* Concurrent Multiple Open InfoWindows ([#3115](https://github.com/mapbox/mapbox-gl-native/issues/3115)) -* OkHttp Replace curl ([#2856](https://github.com/mapbox/mapbox-gl-native/issues/2856)) -* GPS and Compass Customization Support ([#2858](https://github.com/mapbox/mapbox-gl-native/issues/2858)) +- Added Tilt / Pitch Support ([#2805](https://github.com/mapbox/mapbox-gl-native/issues/2805)) +- Keep InfoWindow Open When Panning ([#3121](https://github.com/mapbox/mapbox-gl-native/issues/3121)) +- Concurrent Multiple Open InfoWindows ([#3115](https://github.com/mapbox/mapbox-gl-native/issues/3115)) +- OkHttp Replace curl ([#2856](https://github.com/mapbox/mapbox-gl-native/issues/2856)) +- GPS and Compass Customization Support ([#2858](https://github.com/mapbox/mapbox-gl-native/issues/2858)) ## 2.2.0 - October 28, 2015 diff --git a/platform/android/Makefile b/platform/android/Makefile index 81bc2dc97..4d190b4dc 100644 --- a/platform/android/Makefile +++ b/platform/android/Makefile @@ -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 diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index dad475c3d..e4581125e 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -95,7 +95,7 @@ android { jniDebuggable true } } - namespace 'com.mapbox.mapboxsdk' + namespace 'org.maplibre.android' lint { checkAllWarnings true disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission', 'WrongThreadInterprocedural' diff --git a/platform/android/MapboxGLAndroidSDK/proguard-rules.pro b/platform/android/MapboxGLAndroidSDK/proguard-rules.pro index 926abbcb6..e8d1cdbf6 100644 --- a/platform/android/MapboxGLAndroidSDK/proguard-rules.pro +++ b/platform/android/MapboxGLAndroidSDK/proguard-rules.pro @@ -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.** diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/CMakeLists.txt b/platform/android/MapboxGLAndroidSDK/src/cpp/CMakeLists.txt index 8f931f4ed..e562fa065 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/CMakeLists.txt +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/CMakeLists.txt @@ -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 diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/marker.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/marker.hpp index 3a657e369..40061d2e7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/marker.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/marker.hpp @@ -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 getPosition(jni::JNIEnv&, const jni::Object&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polygon.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polygon.hpp index 69c441636..a8fc8633b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polygon.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polygon.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polyline.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polyline.hpp index 793354503..51db46701 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polyline.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/annotation/polyline.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/connectivity_listener.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/connectivity_listener.hpp index 9a0cfd214..61b45a21c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/connectivity_listener.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/connectivity_listener.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.cpp b/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.cpp index 893eb7743..776f42d30 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.cpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.cpp @@ -1,7 +1,7 @@ #include "file_source.hpp" #include "attach_env.hpp" -#include "mapbox.hpp" +#include "maplibre.hpp" #include #include @@ -33,8 +33,8 @@ FileSource::FileSource(jni::JNIEnv& _env, [](const mbgl::ResourceOptions& resourceOptions, const mbgl::ClientOptions& clientOptions) { auto env{android::AttachEnv()}; std::unique_ptr 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( *env, assetManager, resourceOptions.clone(), clientOptions.clone()); } diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.hpp index b0ddd4c02..421ef2e46 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/file_source.hpp @@ -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"; } diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng.hpp index d44143d92..6f4e387ac 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng.hpp @@ -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> New(jni::JNIEnv&, const mbgl::LatLng&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_bounds.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_bounds.hpp index 6016061af..f82d4cd99 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_bounds.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_bounds.hpp @@ -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> New(jni::JNIEnv&, mbgl::LatLngBounds); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_quad.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_quad.hpp index f5d93c731..5ae73190f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_quad.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/lat_lng_quad.hpp @@ -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> New(jni::JNIEnv&, std::array); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/projected_meters.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/projected_meters.hpp index baad1efc8..d8b0aceb5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/projected_meters.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/geometry/projected_meters.hpp @@ -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> New(jni::JNIEnv&, double, double); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/http_file_source.cpp b/platform/android/MapboxGLAndroidSDK/src/cpp/http_file_source.cpp index f417a4425..f0c5c219d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/http_file_source.cpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/http_file_source.cpp @@ -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(); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/i18n/collator_jni.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/i18n/collator_jni.hpp index 0567d50e5..62b018ddd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/i18n/collator_jni.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/i18n/collator_jni.hpp @@ -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 unaccent(jni::JNIEnv&, const jni::String&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/jni_native.cpp b/platform/android/MapboxGLAndroidSDK/src/cpp/jni_native.cpp index 44aea3074..638c722cf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/jni_native.cpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/jni_native.cpp @@ -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); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/logger.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/logger.hpp index 2eaa2b523..11bdd7d06 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/logger.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/logger.hpp @@ -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); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/map/camera_position.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/map/camera_position.hpp index b677f04ea..5fdbe65f7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/map/camera_position.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/map/camera_position.hpp @@ -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> New(jni::JNIEnv&, mbgl::CameraOptions, float pixelRatio); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/map/image.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/map/image.hpp index 7549bc646..168a80fb1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/map/image.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/map/image.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer.hpp index dc84aaad7..41f0259a5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer_runnable.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer_runnable.hpp index 06826b4cb..392e8a002 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer_runnable.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/map_renderer_runnable.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/mapbox.cpp b/platform/android/MapboxGLAndroidSDK/src/cpp/mapbox.cpp deleted file mode 100644 index 5246739cf..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/mapbox.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "mapbox.hpp" - -namespace mbgl { -namespace android { - -jni::Local> Mapbox::getAssetManager(jni::JNIEnv& env) { - static auto& javaClass = jni::Class::Singleton(env); - auto method = javaClass.GetStaticMethod()>(env, "getAssetManager"); - return javaClass.Call(env, method); -} - -jboolean Mapbox::hasInstance(jni::JNIEnv& env) { - static auto& javaClass = jni::Class::Singleton(env); - auto method = javaClass.GetStaticMethod(env, "hasInstance"); - return javaClass.Call(env, method); -} - -void Mapbox::registerNative(jni::JNIEnv& env) { - jni::Class::Singleton(env); -} - -} // namespace android -} // namespace mbgl diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.cpp b/platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.cpp new file mode 100644 index 000000000..29583e2a8 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.cpp @@ -0,0 +1,23 @@ +#include "maplibre.hpp" + +namespace mbgl { +namespace android { + +jni::Local> MapLibre::getAssetManager(jni::JNIEnv& env) { + static auto& javaClass = jni::Class::Singleton(env); + auto method = javaClass.GetStaticMethod()>(env, "getAssetManager"); + return javaClass.Call(env, method); +} + +jboolean MapLibre::hasInstance(jni::JNIEnv& env) { + static auto& javaClass = jni::Class::Singleton(env); + auto method = javaClass.GetStaticMethod(env, "hasInstance"); + return javaClass.Call(env, method); +} + +void MapLibre::registerNative(jni::JNIEnv& env) { + jni::Class::Singleton(env); +} + +} // namespace android +} // namespace mbgl diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/mapbox.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.hpp similarity index 77% rename from platform/android/MapboxGLAndroidSDK/src/cpp/mapbox.hpp rename to platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.hpp index 813f5bf17..54475b50d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/mapbox.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/maplibre.hpp @@ -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> getAssetManager(jni::JNIEnv&); static void registerNative(jni::JNIEnv&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.cpp b/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.cpp index b80693ed4..59f071914 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.cpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.cpp @@ -1005,7 +1005,7 @@ void NativeMapView::addLayer(JNIEnv& env, jlong nativeLayerPtr, const jni::Strin before ? std::optional(jni::Make(env, before)) : std::optional()); } 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& 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()); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.hpp index 9a01d4e31..3012b4f5d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/native_map_view.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_manager.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_manager.hpp index 596377e61..dbc5c2b77 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_manager.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_manager.hpp @@ -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&, 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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region.hpp index 848d8b34f..592a0e217 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region.hpp @@ -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); }; - 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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_definition.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_definition.hpp index cfef3ab21..83673ee4d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_definition.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_definition.hpp @@ -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> New(jni::JNIEnv&, const mbgl::OfflineGeometryRegionDefinition&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_error.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_error.hpp index 151e05ab1..9c547a30f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_error.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_error.hpp @@ -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> New(jni::JNIEnv&, mbgl::Response::Error); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_status.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_status.hpp index 9ef48ec35..835720442 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_status.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/offline/offline_region_status.hpp @@ -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> New(jni::JNIEnv&, mbgl::OfflineRegionStatus status); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshot.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshot.hpp index 271dc455c..02a4f07f5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshot.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshot.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.cpp b/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.cpp index 6201cd6ed..45d6e5a07 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.cpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.cpp @@ -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(jni::Make(env, below)) : std::optional()); } 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& 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()); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.hpp index 557a9ae95..c2f69a076 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/snapshotter/map_snapshotter.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted.hpp index a7a0f7219..5123894ba 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted.hpp @@ -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> New(jni::JNIEnv &, const style::expression::Formatted &value); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted_section.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted_section.hpp index f759a94e8..22775a7fc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted_section.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/formatted_section.hpp @@ -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&); }; diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/background_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/background_layer.hpp index 94cf41b4d..43d0ad017 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/background_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/background_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/circle_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/circle_layer.hpp index 4a54bc39a..0eac16810 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/circle_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/circle_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/custom_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/custom_layer.hpp index 88c1cbc2c..e3d5baa04 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/custom_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/custom_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_extrusion_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_extrusion_layer.hpp index 6aa0130dd..1b3055227 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_extrusion_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_extrusion_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_layer.hpp index 6fd292845..1ad9ef808 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/fill_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/heatmap_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/heatmap_layer.hpp index bf88367df..94f64362c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/heatmap_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/heatmap_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/hillshade_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/hillshade_layer.hpp index 260a71f1d..50559a59a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/hillshade_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/hillshade_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp index d46b9cce1..9bd1f8600 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp.ejs b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp.ejs index 771ffd664..b74797908 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp.ejs +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/layer.hpp.ejs @@ -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') { -%> diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/line_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/line_layer.hpp index 2e878d689..ed40f78f2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/line_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/line_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/location_indicator_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/location_indicator_layer.hpp index 8da3e5565..387a58d0a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/location_indicator_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/location_indicator_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/raster_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/raster_layer.hpp index 152f9aeff..06d3c25cd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/raster_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/raster_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/symbol_layer.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/symbol_layer.hpp index 382c38653..fc181d185 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/symbol_layer.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/layers/symbol_layer.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/light.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/light.hpp index d21849a36..23b07994f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/light.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/light.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/position.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/position.hpp index eb4f5ac67..b93207124 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/position.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/position.hpp @@ -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> fromPosition(jni::JNIEnv&, jfloat, jfloat, jfloat); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/custom_geometry_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/custom_geometry_source.hpp index c403367ce..7dc9f5486 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/custom_geometry_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/custom_geometry_source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/geojson_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/geojson_source.hpp index ad7365778..e0453ecdc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/geojson_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/geojson_source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/image_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/image_source.hpp index da88feac7..4a75e722f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/image_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/image_source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_dem_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_dem_source.hpp index 581e8f8bc..bc1d9b60f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_dem_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_dem_source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_source.hpp index e1bc5ca7a..22835e33e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/raster_source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/source.hpp index 400ec1df4..b7782c348 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/unknown_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/unknown_source.hpp index ab5a2da82..ee47d087b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/unknown_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/unknown_source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/vector_source.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/vector_source.hpp index ed14dc896..4ea8d9c39 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/vector_source.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/sources/vector_source.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/style/transition_options.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/style/transition_options.hpp index fc54f0813..2aaf97eb4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/style/transition_options.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/style/transition_options.hpp @@ -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> fromTransitionOptions(jni::JNIEnv&, jlong duration, diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/text/local_glyph_rasterizer_jni.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/text/local_glyph_rasterizer_jni.hpp index e80e84833..5d0a77998 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/text/local_glyph_rasterizer_jni.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/text/local_glyph_rasterizer_jni.hpp @@ -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&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/util/default_style.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/util/default_style.hpp index ba5352d6a..c2e30ba60 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/util/default_style.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/util/default_style.hpp @@ -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> New(jni::JNIEnv&, const mbgl::util::DefaultStyle&); static mbgl::util::DefaultStyle getDefaultStyle(jni::JNIEnv&, const jni::Object&); diff --git a/platform/android/MapboxGLAndroidSDK/src/cpp/util/tile_server_options.hpp b/platform/android/MapboxGLAndroidSDK/src/cpp/util/tile_server_options.hpp index a2ebf21a3..68b420c2d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/cpp/util/tile_server_options.hpp +++ b/platform/android/MapboxGLAndroidSDK/src/cpp/util/tile_server_options.hpp @@ -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> New(jni::JNIEnv&, const mbgl::TileServerOptions&); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/package-info.java deleted file mode 100644 index 1e2dc542f..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Annotation API classes. - */ -package com.mapbox.mapboxsdk.annotations; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/package-info.java deleted file mode 100644 index 57d840af5..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Attribution API classes. - */ -package com.mapbox.mapboxsdk.attribution; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/PackageInfo.kt deleted file mode 100644 index 6d39c28a3..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/PackageInfo.kt +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Camera API classes. - */ -package com.mapbox.mapboxsdk.camera diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/package-info.java deleted file mode 100644 index 165394c03..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Constant API classes. - */ -package com.mapbox.mapboxsdk.constants; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java deleted file mode 100644 index f58f57bda..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/MapboxConfigurationException.java +++ /dev/null @@ -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. - *

- * 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. - *

- * - * @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); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/package-info.java deleted file mode 100644 index 09ecd55c1..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Exception API classes. - */ -package com.mapbox.mapboxsdk.exceptions; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/PackageInfo.kt deleted file mode 100644 index 5f1b5dd26..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/PackageInfo.kt +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Geometry API classes. - */ -package com.mapbox.mapboxsdk.geometry diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerFeatureProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerFeatureProvider.java deleted file mode 100644 index 1ad948908..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerFeatureProvider.java +++ /dev/null @@ -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; - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerSourceProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerSourceProvider.java deleted file mode 100644 index 96d073dac..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerSourceProvider.java +++ /dev/null @@ -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 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) - ); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxLatLngAnimator.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxLatLngAnimator.java deleted file mode 100644 index a32bf63ef..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxLatLngAnimator.java +++ /dev/null @@ -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 { - - MapboxLatLngAnimator(@NonNull LatLng[] values, @NonNull AnimationsValueChangeListener updateListener, - int maxAnimationFps) { - super(values, updateListener, maxAnimationFps); - } - - @NonNull - @Override - TypeEvaluator provideEvaluator() { - return new LatLngEvaluator(); - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/package-info.java deleted file mode 100644 index 70dd8cf27..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Location layer component camera and render modes. - */ -package com.mapbox.mapboxsdk.location.modes; \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/package-info.java deleted file mode 100644 index d37eddffc..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Location layer component. - */ -package com.mapbox.mapboxsdk.location; \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/package-info.java deleted file mode 100644 index 3476ff7cd..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Log API classes. - */ -package com.mapbox.mapboxsdk.log; \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/package-info.java deleted file mode 100644 index 08ddc0bf8..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Maps API classes. - */ -package com.mapbox.mapboxsdk.maps; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/package-info.java deleted file mode 100644 index b14b30265..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android EGL API classes. - */ -package com.mapbox.mapboxsdk.maps.renderer.egl; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/package-info.java deleted file mode 100644 index aefcffef4..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android GLSurfaceView API classes. - */ -package com.mapbox.mapboxsdk.maps.renderer.glsurfaceview; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/package-info.java deleted file mode 100644 index f5d8021ea..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Renderer API classes. - */ -package com.mapbox.mapboxsdk.maps.renderer; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/package-info.java deleted file mode 100644 index d3585d41f..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android TextureView API classes. - */ -package com.mapbox.mapboxsdk.maps.renderer.textureview; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/package-info.java deleted file mode 100644 index 5e8d20f06..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Widgets API classes. - */ -package com.mapbox.mapboxsdk.maps.widgets; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/package-info.java deleted file mode 100644 index d2f42025d..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Modular Http API classes. - */ -package com.mapbox.mapboxsdk.module.http; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/package-info.java deleted file mode 100644 index e296baeff..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Modular Library Loader API classes. - */ -package com.mapbox.mapboxsdk.module.loader; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/package-info.java deleted file mode 100644 index 1b207820c..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Network API classes. - */ -package com.mapbox.mapboxsdk.net; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/PackageInfo.kt deleted file mode 100644 index 6fc17da6a..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/PackageInfo.kt +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Offline API classes. - */ -package com.mapbox.mapboxsdk.offline diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/package-info.java deleted file mode 100644 index f18c1402d..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android API classes. - */ -package com.mapbox.mapboxsdk; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/PackageInfo.kt deleted file mode 100644 index 66a5aacd0..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/PackageInfo.kt +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Snapshotter API classes. - */ -package com.mapbox.mapboxsdk.snapshotter diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/package-info.java deleted file mode 100644 index 85950735e..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Storage API classes. - */ -package com.mapbox.mapboxsdk.storage; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/package-info.java deleted file mode 100644 index ee2b96fa6..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Expression API classes. - */ -package com.mapbox.mapboxsdk.style.expressions; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs deleted file mode 100644 index 9fc7dcc07..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs +++ /dev/null @@ -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 The online documentation - */ -@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; - -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/package-info.java deleted file mode 100644 index 2a84cdc17..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Style Layer API classes. - */ -package com.mapbox.mapboxsdk.style.layers; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs deleted file mode 100644 index 7d6b2a4af..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs +++ /dev/null @@ -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 Layer style documentation - */ -<% 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 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 <%- 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 <%- 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 <%- 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 <%- camelizeWithLeadingLowercase(property.name) %>(Expression value) { - return new LayoutPropertyValue<>("<%- property.name %>", value); - } - -<% } -%> -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs deleted file mode 100644 index 771c72991..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs +++ /dev/null @@ -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 The online documentation - */ -@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); -<% } -%> -<% } -%> -} \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/package-info.java deleted file mode 100644 index a613bf958..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Style Light API classes. - */ -package com.mapbox.mapboxsdk.style.light; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/PackageInfo.kt deleted file mode 100644 index 211fe62f1..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/PackageInfo.kt +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Style Sources API classes. - */ -package com.mapbox.mapboxsdk.style.sources diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/PackageInfo.kt deleted file mode 100644 index 74f3ebea5..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/PackageInfo.kt +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Formatted Expression Types API classes. - */ -package com.mapbox.mapboxsdk.style.types diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/package-info.java deleted file mode 100644 index 52c7014bc..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Text API classes. - */ -package com.mapbox.mapboxsdk.text; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MapFragmentUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MapFragmentUtils.java deleted file mode 100644 index 1f4ab252f..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MapFragmentUtils.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.mapbox.mapboxsdk.utils; - -import android.content.Context; -import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.maps.MapboxMapOptions; - -/** - * MapFragment utility class. - *

- * Used to extract duplicate code between {@link com.mapbox.mapboxsdk.maps.MapFragment} and - * {@link com.mapbox.mapboxsdk.maps.SupportMapFragment}. - *

- */ -public class MapFragmentUtils { - - /** - * Convert MapboxMapOptions to a bundle of fragment arguments. - * - * @param options The MapboxMapOptions to convert - * @return a bundle of converted fragment arguments - */ - @NonNull - public static Bundle createFragmentArgs(MapboxMapOptions options) { - Bundle bundle = new Bundle(); - bundle.putParcelable(MapboxConstants.FRAG_ARG_MAPBOXMAPOPTIONS, options); - return bundle; - } - - /** - * Convert a bundle of fragment arguments to MapboxMapOptions. - * - * @param context The context of the activity hosting the fragment - * @param args The fragment arguments - * @return converted MapboxMapOptions - */ - @Nullable - public static MapboxMapOptions resolveArgs(@NonNull Context context, @Nullable Bundle args) { - MapboxMapOptions options; - if (args != null && args.containsKey(MapboxConstants.FRAG_ARG_MAPBOXMAPOPTIONS)) { - options = args.getParcelable(MapboxConstants.FRAG_ARG_MAPBOXMAPOPTIONS); - } else { - // load default options - options = MapboxMapOptions.createFromAttributes(context); - } - return options; - } -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/package-info.java deleted file mode 100644 index 9306a5b18..000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains the Mapbox Maps Android Utility API classes. - */ -package com.mapbox.mapboxsdk.utils; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoader.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/LibraryLoader.java similarity index 89% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoader.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/LibraryLoader.java index 03a1975df..cc6fdfb60 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoader.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/LibraryLoader.java @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.log.Logger; /** * Loads the mapbox-gl shared library @@ -13,7 +13,7 @@ public abstract class LibraryLoader { private static final String TAG = "Mbgl-LibraryLoader"; - private static final LibraryLoader DEFAULT = Mapbox.getModuleProvider() + private static final LibraryLoader DEFAULT = MapLibre.getModuleProvider() .createLibraryLoaderProvider() .getDefaultLibraryLoader(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoaderProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/LibraryLoaderProvider.java similarity index 89% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoaderProvider.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/LibraryLoaderProvider.java index c9d98bf76..2273cae38 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/LibraryLoaderProvider.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/LibraryLoaderProvider.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; /** * Injects the default library loader. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapLibre.java similarity index 81% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapLibre.java index ef1526c5b..4ed7255b8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapLibre.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; import android.annotation.SuppressLint; import android.content.Context; @@ -10,13 +10,13 @@ import androidx.annotation.Nullable; import androidx.annotation.UiThread; import timber.log.Timber; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException; -import com.mapbox.mapboxsdk.net.ConnectivityReceiver; -import com.mapbox.mapboxsdk.storage.FileSource; -import com.mapbox.mapboxsdk.util.DefaultStyle; -import com.mapbox.mapboxsdk.util.TileServerOptions; -import com.mapbox.mapboxsdk.utils.ThreadUtils; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.exceptions.MapLibreConfigurationException; +import org.maplibre.android.net.ConnectivityReceiver; +import org.maplibre.android.storage.FileSource; +import org.maplibre.android.util.DefaultStyle; +import org.maplibre.android.util.TileServerOptions; +import org.maplibre.android.utils.ThreadUtils; /** * The entry point to initialize the MapLibre Android SDK. @@ -29,11 +29,11 @@ import com.mapbox.mapboxsdk.utils.ThreadUtils; @UiThread @SuppressLint("StaticFieldLeak") @Keep -public final class Mapbox { +public final class MapLibre { - private static final String TAG = "Mbgl-Mapbox"; + private static final String TAG = "Mbgl-MapLibre"; private static ModuleProvider moduleProvider; - private static Mapbox INSTANCE; + private static MapLibre INSTANCE; private Context context; @Nullable @@ -42,23 +42,23 @@ public final class Mapbox { private TileServerOptions tileServerOptions; /** - * Get an instance of Mapbox. + * Get an instance of MapLibre. *

* This class manages the API key, application context, and connectivity state. *

* * @param context Android context which holds or is an application context - * @return the single instance of Mapbox + * @return the single instance of MapLibre */ @UiThread @NonNull - public static synchronized Mapbox getInstance(@NonNull Context context) { + public static synchronized MapLibre getInstance(@NonNull Context context) { ThreadUtils.init(context); ThreadUtils.checkThread(TAG); if (INSTANCE == null) { Context appContext = context.getApplicationContext(); FileSource.initializeFileDirsPaths(appContext); - INSTANCE = new Mapbox(appContext, null); + INSTANCE = new MapLibre(appContext, null); ConnectivityReceiver.instance(appContext); } @@ -73,7 +73,7 @@ public final class Mapbox { } /** - * Get an instance of Mapbox. + * Get an instance of MapLibre. *

* This class manages the API key, application context, and connectivity state. *

@@ -84,19 +84,19 @@ public final class Mapbox { * bootstrap the SDK. The predefined configuration includes * rules for converting resource URLs between normal and canonical forms * and set of predefined styles available on the server. - * @return the single instance of Mapbox + * @return the single instance of MapLibre */ @UiThread @NonNull - public static synchronized Mapbox getInstance(@NonNull Context context, @Nullable String apiKey, - WellKnownTileServer tileServer) { + public static synchronized MapLibre getInstance(@NonNull Context context, @Nullable String apiKey, + WellKnownTileServer tileServer) { ThreadUtils.init(context); ThreadUtils.checkThread(TAG); if (INSTANCE == null) { Timber.plant(); Context appContext = context.getApplicationContext(); FileSource.initializeFileDirsPaths(appContext); - INSTANCE = new Mapbox(appContext, apiKey); + INSTANCE = new MapLibre(appContext, apiKey); ConnectivityReceiver.instance(appContext); } else { INSTANCE.apiKey = apiKey; @@ -110,12 +110,12 @@ public final class Mapbox { return INSTANCE; } - Mapbox(@NonNull Context context, @Nullable String apiKey) { + MapLibre(@NonNull Context context, @Nullable String apiKey) { this.context = context; this.apiKey = apiKey; } - Mapbox(@NonNull Context context, @Nullable String apiKey, @NonNull TileServerOptions options) { + MapLibre(@NonNull Context context, @Nullable String apiKey, @NonNull TileServerOptions options) { this.context = context; this.apiKey = apiKey; this.tileServerOptions = options; @@ -232,16 +232,16 @@ public final class Mapbox { } /** - * Runtime validation of Mapbox creation. + * Runtime validation of MapLibre creation. */ private static void validateMapbox() { if (INSTANCE == null) { - throw new MapboxConfigurationException(); + throw new MapLibreConfigurationException(); } } /** - * Runtime validation of Mapbox access token + * Runtime validation of MapLibre access token * * @param apiKey the access token to validate * @return true is valid, false otherwise @@ -251,7 +251,7 @@ public final class Mapbox { return false; } - apiKey = apiKey.trim().toLowerCase(MapboxConstants.MAPBOX_LOCALE); + apiKey = apiKey.trim().toLowerCase(MapLibreConstants.MAPLIBRE_LOCALE); return apiKey.length() != 0; } @@ -260,14 +260,14 @@ public final class Mapbox { */ public static void throwIfApiKeyInvalid(@Nullable String apiKey) { if (!isApiKeyValid(apiKey)) { - throw new MapboxConfigurationException( + throw new MapLibreConfigurationException( "A valid API key is required, currently provided key is: " + apiKey); } } /** - * Internal use. Check if the {@link Mapbox#INSTANCE} is present. + * Internal use. Check if the {@link MapLibre#INSTANCE} is present. */ public static boolean hasInstance() { return INSTANCE != null; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/MapStrictMode.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapStrictMode.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/MapStrictMode.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapStrictMode.java index c7f995964..ec45a191f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/MapStrictMode.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapStrictMode.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; /** * Using this class you can enable a strict mode that will throw the {@link MapStrictModeException} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/MapStrictModeException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapStrictModeException.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/MapStrictModeException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapStrictModeException.java index acedcbed6..90e5937fa 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/MapStrictModeException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/MapStrictModeException.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; public class MapStrictModeException extends RuntimeException { MapStrictModeException(String message) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/ModuleProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/ModuleProvider.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/ModuleProvider.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/ModuleProvider.java index 3258bc4ab..78e412bbe 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/ModuleProvider.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/ModuleProvider.java @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.http.HttpRequest; +import org.maplibre.android.http.HttpRequest; /** * Injects concrete instances of configurable abstractions diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/ModuleProviderImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/ModuleProviderImpl.java similarity index 63% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/ModuleProviderImpl.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/ModuleProviderImpl.java index dce686505..96f983b57 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/ModuleProviderImpl.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/ModuleProviderImpl.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.http.HttpRequest; -import com.mapbox.mapboxsdk.module.http.HttpRequestImpl; -import com.mapbox.mapboxsdk.module.loader.LibraryLoaderProviderImpl; +import org.maplibre.android.http.HttpRequest; +import org.maplibre.android.module.http.HttpRequestImpl; +import org.maplibre.android.module.loader.LibraryLoaderProviderImpl; public class ModuleProviderImpl implements ModuleProvider { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/WellKnownTileServer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/WellKnownTileServer.java similarity index 70% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/WellKnownTileServer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/WellKnownTileServer.java index 0d9cd44c4..be41d9085 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/WellKnownTileServer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/WellKnownTileServer.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk; +package org.maplibre.android; public enum WellKnownTileServer { Mapbox, diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Annotation.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Annotation.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Annotation.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Annotation.java index 324c4ae49..dbcdc52fa 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Annotation.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Annotation.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.maps.MapView; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.maps.MapView; +import org.maplibre.android.maps.MapLibreMap; /** * Annotation is an overlay on top of a Map. @@ -17,7 +17,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; *

* @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public abstract class Annotation implements Comparable { @@ -29,7 +29,7 @@ public abstract class Annotation implements Comparable { * Internal C++ id is stored as unsigned int. */ private long id = -1; // -1 unless added to a MapView - protected MapboxMap mapboxMap; + protected MapLibreMap maplibreMap; protected MapView mapView; protected Annotation() { @@ -52,10 +52,10 @@ public abstract class Annotation implements Comparable { * Do not use this method, used internally by the SDK. */ public void remove() { - if (mapboxMap == null) { + if (maplibreMap == null) { return; } - mapboxMap.removeAnnotation(this); + maplibreMap.removeAnnotation(this); } /** @@ -70,10 +70,10 @@ public abstract class Annotation implements Comparable { /** * Do not use this method, used internally by the SDK. * - * @param mapboxMap the hosting mapbox map + * @param maplibreMap the hosting mapbox map */ - public void setMapboxMap(MapboxMap mapboxMap) { - this.mapboxMap = mapboxMap; + public void setMapboxMap(MapLibreMap maplibreMap) { + this.maplibreMap = maplibreMap; } /** @@ -81,8 +81,8 @@ public abstract class Annotation implements Comparable { * * @return the MapboxMap */ - protected MapboxMap getMapboxMap() { - return mapboxMap; + protected MapLibreMap getMapboxMap() { + return maplibreMap; } /** diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/ArrowDirection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/ArrowDirection.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/ArrowDirection.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/ArrowDirection.java index fcc9ed2de..1078d355a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/ArrowDirection.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/ArrowDirection.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import androidx.annotation.IntDef; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BaseMarkerOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BaseMarkerOptions.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BaseMarkerOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BaseMarkerOptions.java index 384ff8c0a..977d56257 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BaseMarkerOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BaseMarkerOptions.java @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.os.Parcelable; -import com.mapbox.mapboxsdk.geometry.LatLng; +import org.maplibre.android.geometry.LatLng; /** * Abstract builder class for composing custom Marker objects. @@ -13,7 +13,7 @@ import com.mapbox.mapboxsdk.geometry.LatLng; * @param Type of the builder to be used for composing a custom Marker * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public abstract class BaseMarkerOptions> implements Parcelable { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BasePointCollection.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BasePointCollection.java index 0c2c858bf..2322f06ab 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BasePointCollection.java @@ -1,9 +1,9 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import androidx.annotation.Keep; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.geometry.LatLng; +import org.maplibre.android.geometry.LatLng; import java.util.ArrayList; import java.util.List; @@ -13,7 +13,7 @@ import java.util.List; * * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public abstract class BasePointCollection extends Annotation { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Bubble.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Bubble.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Bubble.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Bubble.java index 6f7612f3c..1fffd41e6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Bubble.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Bubble.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.graphics.Canvas; import android.graphics.ColorFilter; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BubbleLayout.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BubbleLayout.java index b41fe2fc4..53091b2bd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BubbleLayout.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.content.Context; import android.content.res.TypedArray; @@ -11,7 +11,9 @@ import android.widget.LinearLayout; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.R; +import org.maplibre.android.R; +import org.maplibre.android.maps.Style; +import org.maplibre.android.style.layers.SymbolLayer; /** * Bubble View for Android with custom stroke width and color, arrow size, position and direction. @@ -19,10 +21,10 @@ import com.mapbox.mapboxsdk.R; * However, even though the Maps SDK for Android team hasn't continued work on this class, * the class is still completely fine to use. This class can be used to create a custom * {@link android.view.View}, which is then turned into a {@link android.graphics.Bitmap}. - * After the bitmap is added to the {@link com.mapbox.mapboxsdk.maps.Style} object, a - * {@link com.mapbox.mapboxsdk.style.layers.SymbolLayer} or the + * After the bitmap is added to the {@link Style} object, a + * {@link SymbolLayer} or the * - * Mapbox Annotation Plugin can reference the image ID. + * MapLibre Annotation Plugin can reference the image ID. */ @Deprecated public class BubbleLayout extends LinearLayout { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubblePopupHelper.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BubblePopupHelper.java similarity index 93% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubblePopupHelper.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BubblePopupHelper.java index b174cbc74..7a005a8fe 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubblePopupHelper.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/BubblePopupHelper.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.content.Context; import android.graphics.drawable.Drawable; @@ -8,7 +8,7 @@ import android.widget.PopupWindow; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.R; +import org.maplibre.android.R; @Deprecated class BubblePopupHelper { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Icon.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Icon.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Icon.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Icon.java index d63c52100..b2a9ab7fd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Icon.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Icon.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.graphics.Bitmap; import android.util.DisplayMetrics; @@ -13,7 +13,7 @@ import java.nio.ByteBuffer; * * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public class Icon { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/IconFactory.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/IconFactory.java index 09f7365f3..fb125c724 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/IconFactory.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.annotation.SuppressLint; import android.content.Context; @@ -13,10 +13,10 @@ import android.view.WindowManager; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.exceptions.TooManyIconsException; -import com.mapbox.mapboxsdk.utils.BitmapUtils; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.R; +import org.maplibre.android.exceptions.TooManyIconsException; +import org.maplibre.android.utils.BitmapUtils; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -31,7 +31,7 @@ import java.io.InputStream; * * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public final class IconFactory { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/InfoWindow.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/InfoWindow.java index 13f1c29cf..47ce5a4ce 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/InfoWindow.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.content.res.Resources; import android.graphics.PointF; @@ -14,10 +14,10 @@ import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.maps.MapView; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.R; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.maps.MapView; +import org.maplibre.android.maps.MapLibreMap; import java.lang.ref.WeakReference; @@ -34,13 +34,13 @@ import java.lang.ref.WeakReference; *

* @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public class InfoWindow { private WeakReference boundMarker; - private WeakReference mapboxMap; + private WeakReference mapboxMap; protected WeakReference view; private float markerHeightOffset; @@ -53,27 +53,27 @@ public class InfoWindow { @LayoutRes private int layoutRes; - InfoWindow(MapView mapView, int layoutResId, MapboxMap mapboxMap) { + InfoWindow(MapView mapView, int layoutResId, MapLibreMap maplibreMap) { layoutRes = layoutResId; View view = LayoutInflater.from(mapView.getContext()).inflate(layoutResId, mapView, false); - initialize(view, mapboxMap); + initialize(view, maplibreMap); } - InfoWindow(@NonNull View view, MapboxMap mapboxMap) { - initialize(view, mapboxMap); + InfoWindow(@NonNull View view, MapLibreMap maplibreMap) { + initialize(view, maplibreMap); } - private void initialize(@NonNull View view, MapboxMap mapboxMap) { - this.mapboxMap = new WeakReference<>(mapboxMap); + private void initialize(@NonNull View view, MapLibreMap maplibreMap) { + this.mapboxMap = new WeakReference<>(maplibreMap); isVisible = false; this.view = new WeakReference<>(view); view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - MapboxMap mapboxMap = InfoWindow.this.mapboxMap.get(); - if (mapboxMap != null) { - MapboxMap.OnInfoWindowClickListener onInfoWindowClickListener = mapboxMap.getOnInfoWindowClickListener(); + MapLibreMap maplibreMap = InfoWindow.this.mapboxMap.get(); + if (maplibreMap != null) { + MapLibreMap.OnInfoWindowClickListener onInfoWindowClickListener = maplibreMap.getOnInfoWindowClickListener(); boolean handledDefaultClick = false; if (onInfoWindowClickListener != null) { handledDefaultClick = onInfoWindowClickListener.onInfoWindowClick(getBoundMarker()); @@ -90,9 +90,9 @@ public class InfoWindow { view.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { - MapboxMap mapboxMap = InfoWindow.this.mapboxMap.get(); - if (mapboxMap != null) { - MapboxMap.OnInfoWindowLongClickListener listener = mapboxMap.getOnInfoWindowLongClickListener(); + MapLibreMap maplibreMap = InfoWindow.this.mapboxMap.get(); + if (maplibreMap != null) { + MapLibreMap.OnInfoWindowLongClickListener listener = maplibreMap.getOnInfoWindowLongClickListener(); if (listener != null) { listener.onInfoWindowLongClick(getBoundMarker()); } @@ -103,7 +103,7 @@ public class InfoWindow { } private void closeInfoWindow() { - MapboxMap mapbox = mapboxMap.get(); + MapLibreMap mapbox = mapboxMap.get(); Marker marker = boundMarker.get(); if (marker != null && mapbox != null) { mapbox.deselectMarker(marker); @@ -129,16 +129,16 @@ public class InfoWindow { MapView.LayoutParams lp = new MapView.LayoutParams(MapView.LayoutParams.WRAP_CONTENT, MapView.LayoutParams.WRAP_CONTENT); - MapboxMap mapboxMap = this.mapboxMap.get(); + MapLibreMap maplibreMap = this.mapboxMap.get(); View view = this.view.get(); - if (view != null && mapboxMap != null) { + if (view != null && maplibreMap != null) { view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); markerHeightOffset = offsetY; markerWidthOffset = -offsetX; // Calculate default Android x,y coordinate - coordinates = mapboxMap.getProjection().toScreenLocation(position); + coordinates = maplibreMap.getProjection().toScreenLocation(position); float x = coordinates.x - (view.getMeasuredWidth() / 2) + offsetX; float y = coordinates.y - view.getMeasuredHeight() + offsetY; @@ -222,8 +222,8 @@ public class InfoWindow { */ @NonNull InfoWindow close() { - MapboxMap mapboxMap = this.mapboxMap.get(); - if (isVisible && mapboxMap != null) { + MapLibreMap maplibreMap = this.mapboxMap.get(); + if (isVisible && maplibreMap != null) { isVisible = false; View view = this.view.get(); if (view != null && view.getParent() != null) { @@ -231,7 +231,7 @@ public class InfoWindow { } Marker marker = getBoundMarker(); - MapboxMap.OnInfoWindowCloseListener listener = mapboxMap.getOnInfoWindowCloseListener(); + MapLibreMap.OnInfoWindowCloseListener listener = maplibreMap.getOnInfoWindowCloseListener(); if (listener != null) { listener.onInfoWindowClose(marker); } @@ -247,13 +247,13 @@ public class InfoWindow { * * @param overlayItem the tapped overlay item */ - void adaptDefaultMarker(@NonNull Marker overlayItem, MapboxMap mapboxMap, @NonNull MapView mapView) { + void adaptDefaultMarker(@NonNull Marker overlayItem, MapLibreMap maplibreMap, @NonNull MapView mapView) { View view = this.view.get(); if (view == null) { view = LayoutInflater.from(mapView.getContext()).inflate(layoutRes, mapView, false); - initialize(view, mapboxMap); + initialize(view, maplibreMap); } - this.mapboxMap = new WeakReference<>(mapboxMap); + this.mapboxMap = new WeakReference<>(maplibreMap); String title = overlayItem.getTitle(); TextView titleTextView = ((TextView) view.findViewById(R.id.infowindow_title)); if (!TextUtils.isEmpty(title)) { @@ -291,11 +291,11 @@ public class InfoWindow { * Will result in getting this {@link InfoWindow} and updating the view being displayed. */ public void update() { - MapboxMap mapboxMap = this.mapboxMap.get(); + MapLibreMap maplibreMap = this.mapboxMap.get(); Marker marker = boundMarker.get(); View view = this.view.get(); - if (mapboxMap != null && marker != null && view != null) { - coordinates = mapboxMap.getProjection().toScreenLocation(marker.getPosition()); + if (maplibreMap != null && marker != null && view != null) { + coordinates = maplibreMap.getProjection().toScreenLocation(marker.getPosition()); if (view instanceof BubbleLayout) { view.setX(coordinates.x + viewWidthOffset - markerWidthOffset); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Marker.java similarity index 86% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Marker.java index e51290934..2ce185053 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Marker.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.view.View; @@ -6,16 +6,16 @@ import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.maps.MapView; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.R; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.maps.MapView; +import org.maplibre.android.maps.MapLibreMap; /** * Marker is an annotation that shows an icon image at a geographical location. The default marker * uses a provided icon. This icon can be customized using {@link IconFactory} to generate an * {@link Icon} using a provided image. Markers are added to the map by first giving a - * {@link LatLng} and using {@link MapboxMap#addMarker(MarkerOptions)}. The marker icon will be + * {@link LatLng} and using {@link MapLibreMap#addMarker(MarkerOptions)}. The marker icon will be * centered at this position so it is common to add padding to the icon image before usage. *

* Markers are designed to be interactive. They receive click events by default, and are often used @@ -24,7 +24,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; *

* @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public class Marker extends Annotation { @@ -123,7 +123,7 @@ public class Marker extends Annotation { */ public void setPosition(LatLng position) { this.position = position; - MapboxMap map = getMapboxMap(); + MapLibreMap map = getMapboxMap(); if (map != null) { map.updateMarker(this); } @@ -148,7 +148,7 @@ public class Marker extends Annotation { public void setIcon(@Nullable Icon icon) { this.icon = icon; this.iconId = icon != null ? icon.getId() : null; - MapboxMap map = getMapboxMap(); + MapLibreMap map = getMapboxMap(); if (map != null) { map.updateMarker(this); } @@ -191,12 +191,12 @@ public class Marker extends Annotation { * Update only for default Marker's InfoWindow content for Title and Snippet */ private void refreshInfoWindowContent() { - if (isInfoWindowShown() && mapView != null && mapboxMap != null && mapboxMap.getInfoWindowAdapter() == null) { + if (isInfoWindowShown() && mapView != null && maplibreMap != null && maplibreMap.getInfoWindowAdapter() == null) { InfoWindow infoWindow = getInfoWindow(mapView); if (mapView.getContext() != null) { - infoWindow.adaptDefaultMarker(this, mapboxMap, mapView); + infoWindow.adaptDefaultMarker(this, maplibreMap, mapView); } - MapboxMap map = getMapboxMap(); + MapLibreMap map = getMapboxMap(); if (map != null) { map.updateMarker(this); } @@ -205,23 +205,23 @@ public class Marker extends Annotation { } /** - * Do not use this method, used internally by the SDK. Use {@link MapboxMap#selectMarker(Marker)} + * Do not use this method, used internally by the SDK. Use {@link MapLibreMap#selectMarker(Marker)} * if you want to programmatically display the markers info window. * - * @param mapboxMap The hosting mapbox map. + * @param maplibreMap The hosting mapbox map. * @param mapView The hosting map view. * @return The info window that was shown. */ @Nullable - public InfoWindow showInfoWindow(@NonNull MapboxMap mapboxMap, @NonNull MapView mapView) { - setMapboxMap(mapboxMap); + public InfoWindow showInfoWindow(@NonNull MapLibreMap maplibreMap, @NonNull MapView mapView) { + setMapboxMap(maplibreMap); setMapView(mapView); - MapboxMap.InfoWindowAdapter infoWindowAdapter = getMapboxMap().getInfoWindowAdapter(); + MapLibreMap.InfoWindowAdapter infoWindowAdapter = getMapboxMap().getInfoWindowAdapter(); if (infoWindowAdapter != null) { // end developer is using a custom InfoWindowAdapter View content = infoWindowAdapter.getInfoWindow(this); if (content != null) { - infoWindow = new InfoWindow(content, mapboxMap); + infoWindow = new InfoWindow(content, maplibreMap); showInfoWindow(infoWindow, mapView); return infoWindow; } @@ -229,7 +229,7 @@ public class Marker extends Annotation { InfoWindow infoWindow = getInfoWindow(mapView); if (mapView.getContext() != null) { - infoWindow.adaptDefaultMarker(this, mapboxMap, mapView); + infoWindow.adaptDefaultMarker(this, maplibreMap, mapView); } return showInfoWindow(infoWindow, mapView); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/MarkerOptions.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/MarkerOptions.java index b98806a04..f99614132 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/MarkerOptions.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.graphics.Bitmap; import android.os.Parcel; @@ -7,8 +7,8 @@ import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.exceptions.InvalidMarkerPositionException; -import com.mapbox.mapboxsdk.geometry.LatLng; +import org.maplibre.android.exceptions.InvalidMarkerPositionException; +import org.maplibre.android.geometry.LatLng; /** *

@@ -23,7 +23,7 @@ import com.mapbox.mapboxsdk.geometry.LatLng; * * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public final class MarkerOptions extends BaseMarkerOptions implements Parcelable { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Polygon.java similarity index 88% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Polygon.java index 7ce2c64bd..3bbcbe784 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Polygon.java @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.graphics.Color; import androidx.annotation.Keep; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.maps.MapLibreMap; import java.util.ArrayList; import java.util.List; @@ -15,7 +15,7 @@ import java.util.List; * Polygon is a geometry annotation that's a closed loop of coordinates. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public final class Polygon extends BasePointCollection { @@ -103,9 +103,9 @@ public final class Polygon extends BasePointCollection { @Override void update() { - MapboxMap mapboxMap = getMapboxMap(); - if (mapboxMap != null) { - mapboxMap.updatePolygon(this); + MapLibreMap maplibreMap = getMapboxMap(); + if (maplibreMap != null) { + maplibreMap.updatePolygon(this); } } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolygonOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/PolygonOptions.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolygonOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/PolygonOptions.java index 3e4c3803e..c1efdf99b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolygonOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/PolygonOptions.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.os.Parcel; @@ -7,7 +7,7 @@ import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.geometry.LatLng; +import org.maplibre.android.geometry.LatLng; import java.util.ArrayList; import java.util.List; @@ -16,7 +16,7 @@ import java.util.List; * Builder for composing {@link Polygon} objects. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public final class PolygonOptions implements Parcelable { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polyline.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Polyline.java similarity index 83% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polyline.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Polyline.java index 5203fc32b..1ada433cc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polyline.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/Polyline.java @@ -1,16 +1,16 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.graphics.Color; import androidx.annotation.Keep; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.maps.MapLibreMap; /** * Polyline is a geometry feature with an unclosed list of coordinates drawn as a line * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public final class Polyline extends BasePointCollection { @@ -64,9 +64,9 @@ public final class Polyline extends BasePointCollection { @Override void update() { - MapboxMap mapboxMap = getMapboxMap(); - if (mapboxMap != null) { - mapboxMap.updatePolyline(this); + MapLibreMap maplibreMap = getMapboxMap(); + if (maplibreMap != null) { + maplibreMap.updatePolyline(this); } } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolylineOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/PolylineOptions.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolylineOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/PolylineOptions.java index 69a424d30..f47a5d1ae 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolylineOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/PolylineOptions.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.annotations; +package org.maplibre.android.annotations; import android.os.Parcel; import android.os.Parcelable; @@ -6,7 +6,7 @@ import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.geometry.LatLng; +import org.maplibre.android.geometry.LatLng; import java.util.ArrayList; import java.util.List; @@ -15,7 +15,7 @@ import java.util.List; * Builder for composing {@link Polyline} objects. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public final class PolylineOptions implements Parcelable { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/package-info.java new file mode 100644 index 000000000..f3bb4d3ac --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/annotations/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Annotation API classes. + */ +package org.maplibre.android.annotations; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/Attribution.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/Attribution.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/Attribution.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/Attribution.java index eaa2953f4..cdb726315 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/Attribution.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/Attribution.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.attribution; +package org.maplibre.android.attribution; import androidx.annotation.Nullable; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionLayout.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionLayout.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionLayout.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionLayout.java index 6c242288e..e97996993 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionLayout.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionLayout.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.attribution; +package org.maplibre.android.attribution; import android.graphics.Bitmap; import android.graphics.PointF; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionMeasure.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionMeasure.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionMeasure.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionMeasure.java index cd6f14ad3..ddf633878 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionMeasure.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionMeasure.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.attribution; +package org.maplibre.android.attribution; import android.graphics.Bitmap; import android.graphics.PointF; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionParser.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionParser.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionParser.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionParser.java index 48e3bdaba..d5b845f70 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/attribution/AttributionParser.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/AttributionParser.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.attribution; +package org.maplibre.android.attribution; import android.content.Context; import android.text.Html; @@ -130,10 +130,10 @@ public class AttributionParser { } /** - * Invoked to validate if an url is valid for the Mapbox configuration. + * Invoked to validate if an url is valid for the MapLibre configuration. * * @param url the url to be validated - * @return if the url is valid for Mapbox + * @return if the url is valid for MapLibre */ private boolean isValidForMapbox(@NonNull String url) { return withMapboxAttribution || !url.equals(Attribution.MAPBOX_URL); @@ -191,7 +191,7 @@ public class AttributionParser { *

* AttributionData, set with {@link #withAttributionData(String...)}, is the only required property to build * the underlying AttributionParser. Other properties include trimming the copyright sign, hiding - * attribution as improve this map and Mapbox. + * attribution as improve this map and MapLibre. *

*/ public static class Options { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/package-info.java new file mode 100644 index 000000000..c552dc461 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/attribution/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Attribution API classes. + */ +package org.maplibre.android.attribution; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraPosition.kt similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraPosition.kt index 251f975e8..1ccc441ff 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraPosition.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.camera +package org.maplibre.android.camera import android.content.res.TypedArray import android.os.Build @@ -7,13 +7,13 @@ import android.os.Parcelable import androidx.annotation.FloatRange import androidx.annotation.Keep import androidx.annotation.Size -import com.mapbox.mapboxsdk.R -import com.mapbox.mapboxsdk.camera.CameraPosition.Builder -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory.CameraPositionUpdate -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory.ZoomUpdate -import com.mapbox.mapboxsdk.constants.MapboxConstants -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.utils.MathUtils +import org.maplibre.android.R +import org.maplibre.android.camera.CameraPosition.Builder +import org.maplibre.android.camera.CameraUpdateFactory.CameraPositionUpdate +import org.maplibre.android.camera.CameraUpdateFactory.ZoomUpdate +import org.maplibre.android.constants.MapLibreConstants +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.utils.MathUtils import java.util.Arrays /** @@ -291,14 +291,14 @@ class CameraPosition * Set the tilt of the camera in degrees * * - * value is clamped to [MapboxConstants.MINIMUM_TILT] and [MapboxConstants.MAXIMUM_TILT]. + * value is clamped to [MapLibreConstants.MINIMUM_TILT] and [MapLibreConstants.MAXIMUM_TILT]. * * * @param tilt Tilt value of the camera * @return this */ - fun tilt(@FloatRange(from = MapboxConstants.MINIMUM_TILT, to = MapboxConstants.MAXIMUM_TILT) tilt: Double): Builder { - this.tilt = MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT) + fun tilt(@FloatRange(from = MapLibreConstants.MINIMUM_TILT, to = MapLibreConstants.MAXIMUM_TILT) tilt: Double): Builder { + this.tilt = MathUtils.clamp(tilt, MapLibreConstants.MINIMUM_TILT, MapLibreConstants.MAXIMUM_TILT) return this } @@ -306,13 +306,13 @@ class CameraPosition * Set the zoom of the camera * * - * Zoom ranges from [MapboxConstants.MINIMUM_ZOOM] to [MapboxConstants.MAXIMUM_ZOOM] + * Zoom ranges from [MapLibreConstants.MINIMUM_ZOOM] to [MapLibreConstants.MAXIMUM_ZOOM] * * * @param zoom Zoom value of the camera * @return this */ - fun zoom(@FloatRange(from = MapboxConstants.MINIMUM_ZOOM.toDouble(), to = MapboxConstants.MAXIMUM_ZOOM.toDouble()) zoom: Double): Builder { + fun zoom(@FloatRange(from = MapLibreConstants.MINIMUM_ZOOM.toDouble(), to = MapLibreConstants.MAXIMUM_ZOOM.toDouble()) zoom: Double): Builder { this.zoom = zoom return this } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraUpdate.kt similarity index 51% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraUpdate.kt index 5cbf20174..831825a10 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdate.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraUpdate.kt @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.camera +package org.maplibre.android.camera -import com.mapbox.mapboxsdk.maps.MapboxMap +import org.maplibre.android.maps.MapLibreMap /** * Interface definition for camera updates. @@ -9,8 +9,8 @@ interface CameraUpdate { /** * Get the camera position from the camera update. * - * @param mapboxMap Map object to build the position from + * @param maplibreMap Map object to build the position from * @return the camera position from the implementing camera update */ - fun getCameraPosition(mapboxMap: MapboxMap): CameraPosition? + fun getCameraPosition(maplibreMap: MapLibreMap): CameraPosition? } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraUpdateFactory.kt similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraUpdateFactory.kt index e3fc13436..2c1f2541d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraUpdateFactory.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/CameraUpdateFactory.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.camera +package org.maplibre.android.camera import android.graphics.Point import android.graphics.PointF import androidx.annotation.IntDef -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.MapboxMap +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.MapLibreMap import timber.log.Timber import java.lang.Double.max import java.util.Arrays @@ -267,9 +267,9 @@ object CameraUpdateFactory { // class CameraPositionUpdate(val bearing: Double, val target: LatLng?, val tilt: Double, val zoom: Double, val padding: DoubleArray?) : CameraUpdate { - override fun getCameraPosition(mapboxMap: MapboxMap): CameraPosition { + override fun getCameraPosition(maplibreMap: MapLibreMap): CameraPosition { if (target == null) { - val previousPosition = mapboxMap.cameraPosition + val previousPosition = maplibreMap.cameraPosition return CameraPosition.Builder(this).target(previousPosition.target).build() } return CameraPosition.Builder(this).build() @@ -327,15 +327,15 @@ object CameraUpdateFactory { ) { } - override fun getCameraPosition(mapboxMap: MapboxMap): CameraPosition? { + override fun getCameraPosition(maplibreMap: MapLibreMap): CameraPosition? { return if (bearing == null && tilt == null) { // use current camera position tilt and bearing - mapboxMap.getCameraForLatLngBounds(bounds, padding) + maplibreMap.getCameraForLatLngBounds(bounds, padding) } else { // use provided tilt and bearing assert(bearing != null) assert(tilt != null) - mapboxMap.getCameraForLatLngBounds(bounds, padding, bearing!!, tilt!!) + maplibreMap.getCameraForLatLngBounds(bounds, padding, bearing!!, tilt!!) } } @@ -460,12 +460,12 @@ object CameraUpdateFactory { } } - override fun getCameraPosition(mapboxMap: MapboxMap): CameraPosition { - val cameraPosition = mapboxMap.cameraPosition + override fun getCameraPosition(maplibreMap: MapLibreMap): CameraPosition { + val cameraPosition = maplibreMap.cameraPosition return if (type != ZOOM_TO_POINT) { CameraPosition.Builder(cameraPosition).zoom(transformZoom(cameraPosition.zoom)).build() } else { - CameraPosition.Builder(cameraPosition).zoom(transformZoom(cameraPosition.zoom)).target(mapboxMap.projection.fromScreenLocation(PointF(x, y))).build() + CameraPosition.Builder(cameraPosition).zoom(transformZoom(cameraPosition.zoom)).target(maplibreMap.projection.fromScreenLocation(PointF(x, y))).build() } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/PackageInfo.kt new file mode 100644 index 000000000..905c02aea --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/camera/PackageInfo.kt @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Camera API classes. + */ +package org.maplibre.android.camera diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/GeometryConstants.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/GeometryConstants.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/GeometryConstants.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/GeometryConstants.java index 6f6e77792..3aa8d011c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/GeometryConstants.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/GeometryConstants.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.constants; +package org.maplibre.android.constants; /** * Contains constants used throughout the sdk classes. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/MapLibreConstants.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/MapLibreConstants.java index 96bb4e8d8..7978f5792 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/MapLibreConstants.java @@ -1,21 +1,21 @@ -package com.mapbox.mapboxsdk.constants; +package org.maplibre.android.constants; import java.util.Locale; /** - * MapboxConstants exposes Mapbox related constants + * MapLibreConstants exposes MapLibre related constants */ -public class MapboxConstants { +public class MapLibreConstants { /** * Default Locale for data processing (ex: String.toLowerCase(MAPBOX_LOCALE, "foo")) */ - public static final Locale MAPBOX_LOCALE = Locale.US; + public static final Locale MAPLIBRE_LOCALE = Locale.US; /** * The name of the desired preferences file for Android's SharedPreferences. */ - public static final String MAPBOX_SHARED_PREFERENCES = "MapboxSharedPreferences"; + public static final String MAPLIBRE_SHARED_PREFERENCES = "MapboxSharedPreferences"; /** * Key used to switch storage to external in AndroidManifest.xml @@ -75,7 +75,7 @@ public class MapboxConstants { /** * Value by which the default rotation threshold will be increased when scaling * - * @deprecated unused, see {@link com.mapbox.mapboxsdk.maps.UiSettings#setDisableRotateWhenScaling(boolean)} + * @deprecated unused, see {@link org.maplibre.android.maps.UiSettings#setDisableRotateWhenScaling(boolean)} */ @Deprecated public static final float ROTATION_THRESHOLD_INCREASE_WHEN_SCALING = 25f; @@ -192,7 +192,7 @@ public class MapboxConstants { /** * Fragment Argument Key for MapboxMapOptions */ - public static final String FRAG_ARG_MAPBOXMAPOPTIONS = "MapboxMapOptions"; + public static final String FRAG_ARG_MAPLIBREMAPOPTIONS = "MapboxMapOptions"; /** * Layer Id of annotations layer diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/package-info.java new file mode 100644 index 000000000..4fb43817d --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/constants/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Constant API classes. + */ +package org.maplibre.android.constants; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/CalledFromWorkerThreadException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/CalledFromWorkerThreadException.java similarity index 79% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/CalledFromWorkerThreadException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/CalledFromWorkerThreadException.java index 32e852d31..da6b57d2b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/CalledFromWorkerThreadException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/CalledFromWorkerThreadException.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.exceptions; +package org.maplibre.android.exceptions; public class CalledFromWorkerThreadException extends RuntimeException { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/ConversionException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/ConversionException.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/ConversionException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/ConversionException.java index 0d16c53b8..f7ba7d593 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/ConversionException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/ConversionException.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.exceptions; +package org.maplibre.android.exceptions; /** * A ConversionException is thrown when a conversion failed to execute. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/IconBitmapChangedException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/IconBitmapChangedException.java similarity index 77% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/IconBitmapChangedException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/IconBitmapChangedException.java index 1f6b0efc4..a366672a0 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/IconBitmapChangedException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/IconBitmapChangedException.java @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.exceptions; +package org.maplibre.android.exceptions; -import com.mapbox.mapboxsdk.annotations.Icon; -import com.mapbox.mapboxsdk.annotations.Marker; -import com.mapbox.mapboxsdk.maps.MapView; +import org.maplibre.android.annotations.Icon; +import org.maplibre.android.annotations.Marker; +import org.maplibre.android.maps.MapView; /** *

diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidLatLngBoundsException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/InvalidLatLngBoundsException.java similarity index 89% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidLatLngBoundsException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/InvalidLatLngBoundsException.java index c1d038581..7ec457ef4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidLatLngBoundsException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/InvalidLatLngBoundsException.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.exceptions; +package org.maplibre.android.exceptions; /** * An InvalidLatLngBoundsException is thrown by LatLngBounds diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/InvalidMarkerPositionException.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/InvalidMarkerPositionException.java index 44ee83265..882d902a5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/InvalidMarkerPositionException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/InvalidMarkerPositionException.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.exceptions; +package org.maplibre.android.exceptions; /** * A InvalidMarkerPositionException is thrown when a Marker object is created with an invalid LatLng position. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/MapLibreConfigurationException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/MapLibreConfigurationException.java new file mode 100644 index 000000000..f59ac774f --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/MapLibreConfigurationException.java @@ -0,0 +1,35 @@ +package org.maplibre.android.exceptions; + +import org.maplibre.android.MapLibre; +import org.maplibre.android.WellKnownTileServer; + +import android.content.Context; + +import androidx.annotation.NonNull; + +/** + * A MapboxConfigurationException is thrown by MapLibreMap when the SDK hasn't been properly initialised. + *

+ * This occurs either when {@link MapLibre} is not correctly initialised or the provided apiKey + * through {@link MapLibre#getInstance(Context, String, WellKnownTileServer)} isn't valid. + *

+ * + * @see MapLibre#getInstance(Context, String, WellKnownTileServer) + */ +public class MapLibreConfigurationException extends RuntimeException { + + /** + * Creates a MapLibre configuration exception thrown by MapboxMap when the SDK hasn't been properly initialised. + */ + public MapLibreConfigurationException() { + super("\nUsing MapView requires calling MapLibre.getInstance(Context context, String apiKey, " + + "WellKnownTileServer wellKnownTileServer) before inflating or creating the view."); + } + + /** + * Creates a MapLibre configuration exception thrown by MapboxMap when the SDK hasn't been properly initialised. + */ + public MapLibreConfigurationException(@NonNull String message) { + super(message); + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/TooManyIconsException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/TooManyIconsException.java similarity index 83% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/TooManyIconsException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/TooManyIconsException.java index bffc10dc0..27c234812 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/exceptions/TooManyIconsException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/TooManyIconsException.java @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.exceptions; +package org.maplibre.android.exceptions; -import com.mapbox.mapboxsdk.annotations.IconFactory; +import org.maplibre.android.annotations.IconFactory; /** *

diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/package-info.java new file mode 100644 index 000000000..b8de6dfa7 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/exceptions/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Exception API classes. + */ +package org.maplibre.android.exceptions; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLng.kt similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLng.kt index ae1bf1ea2..e92743675 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLng.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.geometry +package org.maplibre.android.geometry import android.location.Location import android.os.Parcel @@ -6,7 +6,7 @@ import android.os.Parcelable import androidx.annotation.FloatRange import androidx.annotation.Keep import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.constants.GeometryConstants +import org.maplibre.android.constants.GeometryConstants import com.mapbox.turf.TurfConstants import com.mapbox.turf.TurfMeasurement import kotlin.math.abs @@ -21,7 +21,7 @@ import kotlin.math.abs * * * - * Mapbox GL displays maps in the Mercator Projection and projects geographical + * MapLibre GL displays maps in the Mercator Projection and projects geographical * data automatically, so all data enters in the WGS84 datum. * */ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngBounds.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngBounds.kt index 21a4c9c17..f64c08e1c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngBounds.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.geometry +package org.maplibre.android.geometry import android.os.Parcel import android.os.Parcelable import androidx.annotation.FloatRange import androidx.annotation.Keep -import com.mapbox.mapboxsdk.constants.GeometryConstants -import com.mapbox.mapboxsdk.exceptions.InvalidLatLngBoundsException -import com.mapbox.mapboxsdk.utils.isInfinite -import com.mapbox.mapboxsdk.utils.isNaN +import org.maplibre.android.constants.GeometryConstants +import org.maplibre.android.exceptions.InvalidLatLngBoundsException +import org.maplibre.android.utils.isInfinite +import org.maplibre.android.utils.isNaN /** * A geographical area representing a latitude/longitude aligned rectangle. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngQuad.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngQuad.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngQuad.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngQuad.kt index 75dbcc908..7080f3a83 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngQuad.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngQuad.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.geometry +package org.maplibre.android.geometry import android.os.Parcel import android.os.Parcelable diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngSpan.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngSpan.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngSpan.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngSpan.kt index 0bd0cabae..f062e7a77 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngSpan.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/LatLngSpan.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.geometry +package org.maplibre.android.geometry import android.os.Parcel import android.os.Parcelable diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/PackageInfo.kt new file mode 100644 index 000000000..8bdb701e0 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/PackageInfo.kt @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Geometry API classes. + */ +package org.maplibre.android.geometry diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ProjectedMeters.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/ProjectedMeters.kt similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ProjectedMeters.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/ProjectedMeters.kt index 8481e082c..d6f84de0d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/ProjectedMeters.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/ProjectedMeters.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.geometry +package org.maplibre.android.geometry import android.os.Parcel import android.os.Parcelable @@ -8,7 +8,7 @@ import androidx.annotation.Keep * ProjectedMeters is a projection of longitude, latitude points in Mercator meters. * * - * these have been projected into Mapbox GL's Mercator projection. Instead of decimal + * these have been projected into MapLibre GL's Mercator projection. Instead of decimal * degrees, it uses Mercator meters (which are notably not equivalent to SI meters) * except at the equator. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/VisibleRegion.kt similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/VisibleRegion.kt index df7b3ad18..8626173d3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/VisibleRegion.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/geometry/VisibleRegion.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.geometry +package org.maplibre.android.geometry import android.os.Build import android.os.Parcel diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpIdentifier.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpIdentifier.java similarity index 85% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpIdentifier.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpIdentifier.java index 4fedf8953..d9a2f11f8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpIdentifier.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpIdentifier.java @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; import android.content.Context; import android.content.pm.PackageInfo; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.Mapbox; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.MapLibre; public class HttpIdentifier { @@ -19,7 +19,7 @@ public class HttpIdentifier { * @return the application identifier */ public static String getIdentifier() { - return getIdentifier(Mapbox.getApplicationContext()); + return getIdentifier(MapLibre.getApplicationContext()); } /** diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpLogger.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpLogger.java similarity index 79% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpLogger.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpLogger.java index 9cf4b0601..0362349a8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpLogger.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpLogger.java @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; import android.util.Log; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.log.Logger; -import static com.mapbox.mapboxsdk.http.HttpRequest.CONNECTION_ERROR; -import static com.mapbox.mapboxsdk.http.HttpRequest.TEMPORARY_ERROR; +import static org.maplibre.android.http.HttpRequest.CONNECTION_ERROR; +import static org.maplibre.android.http.HttpRequest.TEMPORARY_ERROR; public class HttpLogger { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpRequest.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpRequest.java index 1fd4f43cd..ffe8e21a8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequest.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpRequest.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; /** * Interface definition for performing http requests. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequestUrl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpRequestUrl.java similarity index 85% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequestUrl.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpRequestUrl.java index 5d04ecb99..28bb459f9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpRequestUrl.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpRequestUrl.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; import androidx.annotation.NonNull; @@ -9,7 +9,7 @@ public class HttpRequestUrl { /** * Adapts a resource request url based on the host, query size, and offline requirement. - * Mapbox resources downloaded for offline use are subject to separate Vector Tile and + * MapLibre resources downloaded for offline use are subject to separate Vector Tile and * Raster Tile API pricing and are not included in the Maps SDK’s β€œunlimited” requests. * See our pricing page for more information. * @@ -35,10 +35,10 @@ public class HttpRequestUrl { } /** - * Validates if the host used as endpoint is a valid Mapbox endpoint. + * Validates if the host used as endpoint is a valid MapLibre endpoint. * * @param host the host used as endpoint - * @return true if a valid Mapbox endpoint + * @return true if a valid MapLibre endpoint */ private static boolean isValidMapboxEndpoint(String host) { return host.equals("mapbox.com") diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpResponder.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpResponder.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpResponder.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpResponder.java index a050e07c5..7a7d31e7f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HttpResponder.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/HttpResponder.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; /** * Interface definition for a callback to be invoked when either a response was returned for a requested resource or diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/LocalRequestTask.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/LocalRequestTask.java similarity index 88% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/LocalRequestTask.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/LocalRequestTask.java index 6f28e14ae..a3116c651 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/LocalRequestTask.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/LocalRequestTask.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; import android.content.res.AssetManager; import android.os.AsyncTask; @@ -6,9 +6,9 @@ import android.os.AsyncTask; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.Mapbox; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.MapLibre; +import org.maplibre.android.log.Logger; import java.io.IOException; import java.io.InputStream; @@ -26,7 +26,7 @@ class LocalRequestTask extends AsyncTask { @Nullable @Override protected byte[] doInBackground(String... strings) { - return loadFile(Mapbox.getApplicationContext().getAssets(), + return loadFile(MapLibre.getApplicationContext().getAssets(), "integration/" + strings[0] .substring(8) .replaceAll("%20", " ") diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/NativeHttpRequest.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/NativeHttpRequest.java similarity index 93% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/NativeHttpRequest.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/NativeHttpRequest.java index 6d41b07ad..e41429cd3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/NativeHttpRequest.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/NativeHttpRequest.java @@ -1,16 +1,16 @@ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; import androidx.annotation.Keep; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.Mapbox; +import org.maplibre.android.MapLibre; import java.util.concurrent.locks.ReentrantLock; @Keep public class NativeHttpRequest implements HttpResponder { - private final HttpRequest httpRequest = Mapbox.getModuleProvider().createHttpRequest(); + private final HttpRequest httpRequest = MapLibre.getModuleProvider().createHttpRequest(); // Reentrancy is not needed, but "Lock" is an abstract class. private final ReentrantLock lock = new ReentrantLock(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/package-info.java similarity index 61% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/package-info.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/package-info.java index 09eeda2b7..65f2f0803 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/package-info.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/http/package-info.java @@ -1,4 +1,4 @@ /** * Do not use this package. Internal use only. */ -package com.mapbox.mapboxsdk.http; +package org.maplibre.android.http; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/AnimatorListenerHolder.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/AnimatorListenerHolder.java similarity index 67% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/AnimatorListenerHolder.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/AnimatorListenerHolder.java index 5dcf30919..1bba81539 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/AnimatorListenerHolder.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/AnimatorListenerHolder.java @@ -1,21 +1,22 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; class AnimatorListenerHolder { - @MapboxAnimator.Type + @MapLibreAnimator.Type private final int animatorType; - private final MapboxAnimator.AnimationsValueChangeListener listener; + private final MapLibreAnimator.AnimationsValueChangeListener listener; - AnimatorListenerHolder(@MapboxAnimator.Type int animatorType, MapboxAnimator.AnimationsValueChangeListener listener) { + AnimatorListenerHolder(@MapLibreAnimator.Type int animatorType, + MapLibreAnimator.AnimationsValueChangeListener listener) { this.animatorType = animatorType; this.listener = listener; } - @MapboxAnimator.Type + @MapLibreAnimator.Type public int getAnimatorType() { return animatorType; } - public MapboxAnimator.AnimationsValueChangeListener getListener() { + public MapLibreAnimator.AnimationsValueChangeListener getListener() { return listener; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/CompassEngine.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/CompassEngine.java similarity index 91% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/CompassEngine.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/CompassEngine.java index 603171505..e92f17b62 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/CompassEngine.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/CompassEngine.java @@ -1,9 +1,9 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.location.modes.CameraMode; -import com.mapbox.mapboxsdk.location.modes.RenderMode; +import org.maplibre.android.location.modes.CameraMode; +import org.maplibre.android.location.modes.RenderMode; /** * Interface defining the source of compass heading data that is diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/CompassListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/CompassListener.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/CompassListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/CompassListener.java index c44218a1d..b2cba1fcf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/CompassListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/CompassListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; /** * Callbacks related to the compass diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/IndicatorLocationLayerRenderer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/IndicatorLocationLayerRenderer.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/IndicatorLocationLayerRenderer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/IndicatorLocationLayerRenderer.java index 53f10cdc4..e9f5d4aa0 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/IndicatorLocationLayerRenderer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/IndicatorLocationLayerRenderer.java @@ -1,27 +1,28 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.graphics.Bitmap; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.location.modes.RenderMode; -import com.mapbox.mapboxsdk.maps.Style; -import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.utils.BitmapUtils; -import com.mapbox.mapboxsdk.utils.ColorUtils; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.location.modes.RenderMode; +import org.maplibre.android.maps.Style; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.utils.BitmapUtils; +import org.maplibre.android.utils.ColorUtils; + +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BEARING_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BEARING_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.SHADOW_ICON; +import static org.maplibre.android.style.expressions.Expression.rgba; +import static org.maplibre.android.style.layers.Property.NONE; +import static org.maplibre.android.style.layers.Property.VISIBLE; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_STALE_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_STALE_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_STALE_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.SHADOW_ICON; -import static com.mapbox.mapboxsdk.style.expressions.Expression.rgba; -import static com.mapbox.mapboxsdk.style.layers.Property.NONE; -import static com.mapbox.mapboxsdk.style.layers.Property.VISIBLE; class IndicatorLocationLayerRenderer implements LocationLayerRenderer { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LatLngEvaluator.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LatLngEvaluator.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LatLngEvaluator.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LatLngEvaluator.java index c4a6efbf8..7642c0ccd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LatLngEvaluator.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LatLngEvaluator.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.animation.TypeEvaluator; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.geometry.LatLng; +import org.maplibre.android.geometry.LatLng; class LatLngEvaluator implements TypeEvaluator { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerBitmapProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerBitmapProvider.java similarity index 76% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerBitmapProvider.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerBitmapProvider.java index da36a039f..a0e8d4364 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LayerBitmapProvider.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerBitmapProvider.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.content.Context; import android.graphics.Bitmap; @@ -8,10 +8,8 @@ import androidx.annotation.ColorInt; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.utils.BitmapUtils; - -import static com.mapbox.mapboxsdk.location.Utils.generateShadow; +import org.maplibre.android.R; +import org.maplibre.android.utils.BitmapUtils; class LayerBitmapProvider { @@ -28,6 +26,6 @@ class LayerBitmapProvider { Bitmap generateShadowBitmap(@NonNull LocationComponentOptions options) { Drawable shadowDrawable = BitmapUtils.getDrawableFromRes(context, R.drawable.maplibre_user_icon_shadow); - return generateShadow(shadowDrawable, options.elevation()); + return Utils.generateShadow(shadowDrawable, options.elevation()); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerFeatureProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerFeatureProvider.java new file mode 100644 index 000000000..a28fe1454 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerFeatureProvider.java @@ -0,0 +1,22 @@ +package org.maplibre.android.location; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.mapbox.geojson.Feature; +import com.mapbox.geojson.Point; + +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(LocationComponentConstants.PROPERTY_GPS_BEARING, 0f); + locationFeature.addNumberProperty(LocationComponentConstants.PROPERTY_COMPASS_BEARING, 0f); + locationFeature.addBooleanProperty(LocationComponentConstants.PROPERTY_LOCATION_STALE, isStale); + return locationFeature; + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerSourceProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerSourceProvider.java new file mode 100644 index 000000000..95fe70b55 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LayerSourceProvider.java @@ -0,0 +1,128 @@ +package org.maplibre.android.location; + +import androidx.annotation.NonNull; + +import com.mapbox.geojson.Feature; + +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.CircleLayer; +import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.style.layers.Property; +import org.maplibre.android.style.layers.PropertyFactory; +import org.maplibre.android.style.layers.SymbolLayer; +import org.maplibre.android.style.layers.TransitionOptions; +import org.maplibre.android.style.sources.GeoJsonOptions; +import org.maplibre.android.style.sources.GeoJsonSource; + +import java.util.HashSet; +import java.util.Set; + +class LayerSourceProvider { + + private static final String EMPTY_STRING = ""; + + @NonNull + GeoJsonSource generateSource(Feature locationFeature) { + return new GeoJsonSource( + LocationComponentConstants.LOCATION_SOURCE, + locationFeature, + new GeoJsonOptions().withMaxZoom(16) + ); + } + + @NonNull + Layer generateLayer(@NonNull String layerId) { + SymbolLayer layer = new SymbolLayer(layerId, LocationComponentConstants.LOCATION_SOURCE); + layer.setProperties( + PropertyFactory.iconAllowOverlap(true), + PropertyFactory.iconIgnorePlacement(true), + PropertyFactory.iconRotationAlignment(Property.ICON_ROTATION_ALIGNMENT_MAP), + PropertyFactory.iconRotate( + Expression.match(Expression.literal(layerId), Expression.literal(0f), + Expression.stop(LocationComponentConstants.FOREGROUND_LAYER, + Expression.get(LocationComponentConstants.PROPERTY_GPS_BEARING)), + Expression.stop(LocationComponentConstants.BACKGROUND_LAYER, + Expression.get(LocationComponentConstants.PROPERTY_GPS_BEARING)), + Expression.stop(LocationComponentConstants.SHADOW_LAYER, + Expression.get(LocationComponentConstants.PROPERTY_GPS_BEARING)), + Expression.stop(LocationComponentConstants.BEARING_LAYER, + Expression.get(LocationComponentConstants.PROPERTY_COMPASS_BEARING)) + ) + ), + PropertyFactory.iconImage( + Expression.match(Expression.literal(layerId), Expression.literal(EMPTY_STRING), + Expression.stop(LocationComponentConstants.FOREGROUND_LAYER, Expression.switchCase( + Expression.get(LocationComponentConstants.PROPERTY_LOCATION_STALE), + Expression.get(LocationComponentConstants.PROPERTY_FOREGROUND_STALE_ICON), + Expression.get(LocationComponentConstants.PROPERTY_FOREGROUND_ICON))), + Expression.stop(LocationComponentConstants.BACKGROUND_LAYER, Expression.switchCase( + Expression.get(LocationComponentConstants.PROPERTY_LOCATION_STALE), + Expression.get(LocationComponentConstants.PROPERTY_BACKGROUND_STALE_ICON), + Expression.get(LocationComponentConstants.PROPERTY_BACKGROUND_ICON))), + Expression.stop(LocationComponentConstants.SHADOW_LAYER, + Expression.literal(LocationComponentConstants.SHADOW_ICON)), + Expression.stop(LocationComponentConstants.BEARING_LAYER, + Expression.get(LocationComponentConstants.PROPERTY_BEARING_ICON)) + ) + ), + PropertyFactory.iconOffset( + Expression.match(Expression.literal(layerId), Expression.literal(new Float[] {0f, 0f}), + Expression.stop(Expression.literal(LocationComponentConstants.FOREGROUND_LAYER), + Expression.get(LocationComponentConstants.PROPERTY_FOREGROUND_ICON_OFFSET)), + Expression.stop(Expression.literal(LocationComponentConstants.SHADOW_LAYER), + Expression.get(LocationComponentConstants.PROPERTY_SHADOW_ICON_OFFSET)) + ) + ) + ); + return layer; + } + + @NonNull + Layer generateAccuracyLayer() { + return new CircleLayer(LocationComponentConstants.ACCURACY_LAYER, LocationComponentConstants.LOCATION_SOURCE) + .withProperties( + PropertyFactory.circleRadius(Expression.get(LocationComponentConstants.PROPERTY_ACCURACY_RADIUS)), + PropertyFactory.circleColor(Expression.get(LocationComponentConstants.PROPERTY_ACCURACY_COLOR)), + PropertyFactory.circleOpacity(Expression.get(LocationComponentConstants.PROPERTY_ACCURACY_ALPHA)), + PropertyFactory.circleStrokeColor(Expression.get(LocationComponentConstants.PROPERTY_ACCURACY_COLOR)), + PropertyFactory.circlePitchAlignment(Property.CIRCLE_PITCH_ALIGNMENT_MAP) + ); + } + + Set 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(LocationComponentConstants.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(LocationComponentConstants.PULSING_CIRCLE_LAYER, LocationComponentConstants.LOCATION_SOURCE) + .withProperties( + PropertyFactory.circlePitchAlignment(Property.CIRCLE_PITCH_ALIGNMENT_MAP) + ); + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationAnimatorCoordinator.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationAnimatorCoordinator.java similarity index 77% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationAnimatorCoordinator.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationAnimatorCoordinator.java index 2672d64f4..d53782c61 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationAnimatorCoordinator.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationAnimatorCoordinator.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.animation.Animator; import android.location.Location; @@ -12,40 +12,41 @@ import androidx.annotation.Nullable; import androidx.annotation.Size; import androidx.annotation.VisibleForTesting; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.maps.Projection; +import org.maplibre.android.log.Logger; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.maps.Projection; import java.util.ArrayList; import java.util.List; import java.util.Set; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.ACCURACY_RADIUS_ANIMATION_DURATION; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.COMPASS_UPDATE_RATE_MS; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.MAX_ANIMATION_DURATION_MS; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.TRANSITION_ANIMATION_DURATION_MS; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_CAMERA_COMPASS_BEARING; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_CAMERA_GPS_BEARING; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_CAMERA_LATLNG; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_LAYER_ACCURACY; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_LAYER_COMPASS_BEARING; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_LAYER_GPS_BEARING; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_LAYER_LATLNG; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_PULSING_CIRCLE; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_TILT; -import static com.mapbox.mapboxsdk.location.MapboxAnimator.ANIMATOR_ZOOM; -import static com.mapbox.mapboxsdk.location.Utils.immediateAnimation; -import static com.mapbox.mapboxsdk.location.Utils.normalize; -import static com.mapbox.mapboxsdk.location.Utils.shortestRotation; +import static org.maplibre.android.location.LocationComponentConstants.ACCURACY_RADIUS_ANIMATION_DURATION; +import static org.maplibre.android.location.LocationComponentConstants.COMPASS_UPDATE_RATE_MS; +import static org.maplibre.android.location.LocationComponentConstants.MAX_ANIMATION_DURATION_MS; +import static org.maplibre.android.location.LocationComponentConstants.TRANSITION_ANIMATION_DURATION_MS; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_CAMERA_COMPASS_BEARING; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_CAMERA_GPS_BEARING; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_CAMERA_LATLNG; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_LAYER_ACCURACY; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_LAYER_COMPASS_BEARING; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_LAYER_GPS_BEARING; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_LAYER_LATLNG; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_PULSING_CIRCLE; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_TILT; +import static org.maplibre.android.location.MapLibreAnimator.ANIMATOR_ZOOM; +import static org.maplibre.android.location.Utils.immediateAnimation; +import static org.maplibre.android.location.Utils.normalize; +import static org.maplibre.android.location.Utils.shortestRotation; + +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.geometry.LatLng; final class LocationAnimatorCoordinator { private static final String TAG = "Mbgl-LocationAnimatorCoordinator"; @VisibleForTesting - final SparseArray animatorArray = new SparseArray<>(); + final SparseArray animatorArray = new SparseArray<>(); private final Projection projection; private Location previousLocation; @@ -53,8 +54,8 @@ final class LocationAnimatorCoordinator { private float previousCompassBearing = -1; private long locationUpdateTimestamp = -1; private float durationMultiplier; - private final MapboxAnimatorProvider animatorProvider; - private final MapboxAnimatorSetProvider animatorSetProvider; + private final MapLibreAnimatorProvider animatorProvider; + private final MapLibreAnimatorSetProvider animatorSetProvider; private boolean compassAnimationEnabled; private boolean accuracyAnimationEnabled; @@ -62,10 +63,10 @@ final class LocationAnimatorCoordinator { int maxAnimationFps = Integer.MAX_VALUE; @VisibleForTesting - final SparseArray listeners = new SparseArray<>(); + final SparseArray listeners = new SparseArray<>(); - LocationAnimatorCoordinator(@NonNull Projection projection, @NonNull MapboxAnimatorSetProvider animatorSetProvider, - @NonNull MapboxAnimatorProvider animatorProvider) { + LocationAnimatorCoordinator(@NonNull Projection projection, @NonNull MapLibreAnimatorSetProvider animatorSetProvider, + @NonNull MapLibreAnimatorProvider animatorProvider) { this.projection = projection; this.animatorProvider = animatorProvider; this.animatorSetProvider = animatorSetProvider; @@ -78,9 +79,9 @@ final class LocationAnimatorCoordinator { } for (int i = 0; i < animatorArray.size(); i++) { - @MapboxAnimator.Type int animatorType = animatorArray.keyAt(i); + @MapLibreAnimator.Type int animatorType = animatorArray.keyAt(i); if (listeners.get(animatorType) == null) { - MapboxAnimator animator = animatorArray.get(animatorType); + MapLibreAnimator animator = animatorArray.get(animatorType); if (animator != null) { animator.makeInvalid(); } @@ -189,7 +190,7 @@ final class LocationAnimatorCoordinator { } /** - * Initializes the {@link PulsingLocationCircleAnimator}, which is a type of {@link MapboxAnimator}. + * Initializes the {@link PulsingLocationCircleAnimator}, which is a type of {@link MapLibreAnimator}. * This method also adds the animator to this class' animator array. * * @param options the {@link LocationComponentOptions} passed to this class upstream from the @@ -197,7 +198,7 @@ final class LocationAnimatorCoordinator { */ void startLocationComponentCirclePulsing(LocationComponentOptions options) { cancelAnimator(ANIMATOR_PULSING_CIRCLE); - MapboxAnimator.AnimationsValueChangeListener listener = listeners.get(ANIMATOR_PULSING_CIRCLE); + MapLibreAnimator.AnimationsValueChangeListener listener = listeners.get(ANIMATOR_PULSING_CIRCLE); if (listener != null) { PulsingLocationCircleAnimator pulsingLocationCircleAnimator = animatorProvider.pulsingCircleAnimator( listener, @@ -211,20 +212,20 @@ final class LocationAnimatorCoordinator { } void feedNewZoomLevel(double targetZoomLevel, @NonNull CameraPosition currentCameraPosition, long animationDuration, - @Nullable MapboxMap.CancelableCallback callback) { + @Nullable MapLibreMap.CancelableCallback callback) { updateZoomAnimator((float) targetZoomLevel, (float) currentCameraPosition.zoom, callback); playAnimators(animationDuration, ANIMATOR_ZOOM); } void feedNewTilt(double targetTilt, @NonNull CameraPosition currentCameraPosition, long animationDuration, - @Nullable MapboxMap.CancelableCallback callback) { + @Nullable MapLibreMap.CancelableCallback callback) { updateTiltAnimator((float) targetTilt, (float) currentCameraPosition.tilt, callback); playAnimators(animationDuration, ANIMATOR_TILT); } private LatLng getPreviousLayerLatLng() { LatLng previousLatLng; - MapboxAnimator latLngAnimator = animatorArray.get(ANIMATOR_LAYER_LATLNG); + MapLibreAnimator latLngAnimator = animatorArray.get(ANIMATOR_LAYER_LATLNG); if (latLngAnimator != null) { previousLatLng = (LatLng) latLngAnimator.getAnimatedValue(); } else { @@ -234,7 +235,7 @@ final class LocationAnimatorCoordinator { } private float getPreviousLayerGpsBearing() { - MapboxFloatAnimator animator = (MapboxFloatAnimator) animatorArray.get(ANIMATOR_LAYER_GPS_BEARING); + MapLibreFloatAnimator animator = (MapLibreFloatAnimator) animatorArray.get(ANIMATOR_LAYER_GPS_BEARING); float previousBearing; if (animator != null) { previousBearing = (float) animator.getAnimatedValue(); @@ -245,7 +246,7 @@ final class LocationAnimatorCoordinator { } private float getPreviousLayerCompassBearing() { - MapboxFloatAnimator animator = (MapboxFloatAnimator) animatorArray.get(ANIMATOR_LAYER_COMPASS_BEARING); + MapLibreFloatAnimator animator = (MapLibreFloatAnimator) animatorArray.get(ANIMATOR_LAYER_COMPASS_BEARING); float previousBearing; if (animator != null) { @@ -257,7 +258,7 @@ final class LocationAnimatorCoordinator { } private float getPreviousAccuracyRadius() { - MapboxAnimator animator = animatorArray.get(ANIMATOR_LAYER_ACCURACY); + MapLibreAnimator animator = animatorArray.get(ANIMATOR_LAYER_ACCURACY); float previousRadius; if (animator != null) { previousRadius = (float) animator.getAnimatedValue(); @@ -312,44 +313,44 @@ final class LocationAnimatorCoordinator { } private void updateZoomAnimator(float targetZoomLevel, float previousZoomLevel, - @Nullable MapboxMap.CancelableCallback cancelableCallback) { + @Nullable MapLibreMap.CancelableCallback cancelableCallback) { createNewCameraAdapterAnimator(ANIMATOR_ZOOM, new Float[] {previousZoomLevel, targetZoomLevel}, cancelableCallback); } private void updateTiltAnimator(float targetTilt, float previousTiltLevel, - @Nullable MapboxMap.CancelableCallback cancelableCallback) { + @Nullable MapLibreMap.CancelableCallback cancelableCallback) { createNewCameraAdapterAnimator(ANIMATOR_TILT, new Float[] {previousTiltLevel, targetTilt}, cancelableCallback); } - private void createNewLatLngAnimator(@MapboxAnimator.Type int animatorType, LatLng previous, LatLng target) { + private void createNewLatLngAnimator(@MapLibreAnimator.Type int animatorType, LatLng previous, LatLng target) { createNewLatLngAnimator(animatorType, new LatLng[] {previous, target}); } - private void createNewLatLngAnimator(@MapboxAnimator.Type int animatorType, LatLng[] values) { + private void createNewLatLngAnimator(@MapLibreAnimator.Type int animatorType, LatLng[] values) { cancelAnimator(animatorType); - MapboxAnimator.AnimationsValueChangeListener listener = listeners.get(animatorType); + MapLibreAnimator.AnimationsValueChangeListener listener = listeners.get(animatorType); if (listener != null) { animatorArray.put(animatorType, animatorProvider.latLngAnimator(values, listener, maxAnimationFps)); } } - private void createNewFloatAnimator(@MapboxAnimator.Type int animatorType, float previous, float target) { + private void createNewFloatAnimator(@MapLibreAnimator.Type int animatorType, float previous, float target) { createNewFloatAnimator(animatorType, new Float[] {previous, target}); } - private void createNewFloatAnimator(@MapboxAnimator.Type int animatorType, @NonNull @Size(min = 2) Float[] values) { + private void createNewFloatAnimator(@MapLibreAnimator.Type int animatorType, @NonNull @Size(min = 2) Float[] values) { cancelAnimator(animatorType); - MapboxAnimator.AnimationsValueChangeListener listener = listeners.get(animatorType); + MapLibreAnimator.AnimationsValueChangeListener listener = listeners.get(animatorType); if (listener != null) { animatorArray.put(animatorType, animatorProvider.floatAnimator(values, listener, maxAnimationFps)); } } - private void createNewCameraAdapterAnimator(@MapboxAnimator.Type int animatorType, + private void createNewCameraAdapterAnimator(@MapLibreAnimator.Type int animatorType, @NonNull @Size(min = 2) Float[] values, - @Nullable MapboxMap.CancelableCallback cancelableCallback) { + @Nullable MapLibreMap.CancelableCallback cancelableCallback) { cancelAnimator(animatorType); - MapboxAnimator.AnimationsValueChangeListener listener = listeners.get(animatorType); + MapLibreAnimator.AnimationsValueChangeListener listener = listeners.get(animatorType); if (listener != null) { animatorArray.put(animatorType, animatorProvider.cameraAnimator(values, listener, cancelableCallback)); } @@ -362,9 +363,9 @@ final class LocationAnimatorCoordinator { return targetCameraBearing; } - private void playAnimators(long duration, @MapboxAnimator.Type int... animatorTypes) { + private void playAnimators(long duration, @MapLibreAnimator.Type int... animatorTypes) { List animators = new ArrayList<>(); - for (@MapboxAnimator.Type int animatorType : animatorTypes) { + for (@MapLibreAnimator.Type int animatorType : animatorTypes) { Animator animator = animatorArray.get(animatorType); if (animator != null) { animators.add(animator); @@ -376,7 +377,7 @@ final class LocationAnimatorCoordinator { /** * Starts the {@link PulsingLocationCircleAnimator} in the animator array. This method is separate * from {@link #playAnimators(long, int...)} because the MapboxAnimatorSetProvider has many more - * customizable animation parameters than the other {@link MapboxAnimator}s. + * customizable animation parameters than the other {@link MapLibreAnimator}s. */ private void playPulsingAnimator() { Animator animator = animatorArray.get(ANIMATOR_PULSING_CIRCLE); @@ -400,7 +401,7 @@ final class LocationAnimatorCoordinator { } private boolean resetCameraLatLngAnimation(@NonNull CameraPosition currentCameraPosition) { - MapboxLatLngAnimator animator = (MapboxLatLngAnimator) animatorArray.get(ANIMATOR_CAMERA_LATLNG); + MapLibreLatLngAnimator animator = (MapLibreLatLngAnimator) animatorArray.get(ANIMATOR_CAMERA_LATLNG); if (animator == null) { return false; } @@ -413,7 +414,7 @@ final class LocationAnimatorCoordinator { } private void resetCameraGpsBearingAnimation(@NonNull CameraPosition currentCameraPosition, boolean isGpsNorth) { - MapboxFloatAnimator animator = (MapboxFloatAnimator) animatorArray.get(ANIMATOR_CAMERA_GPS_BEARING); + MapLibreFloatAnimator animator = (MapLibreFloatAnimator) animatorArray.get(ANIMATOR_CAMERA_GPS_BEARING); if (animator == null) { return; } @@ -426,8 +427,8 @@ final class LocationAnimatorCoordinator { } private void resetCameraCompassAnimation(@NonNull CameraPosition currentCameraPosition) { - MapboxFloatAnimator animator = - (MapboxFloatAnimator) animatorArray.get(ANIMATOR_CAMERA_COMPASS_BEARING); + MapLibreFloatAnimator animator = + (MapLibreFloatAnimator) animatorArray.get(ANIMATOR_CAMERA_COMPASS_BEARING); if (animator == null) { return; } @@ -439,12 +440,12 @@ final class LocationAnimatorCoordinator { } void resetAllLayerAnimations() { - MapboxLatLngAnimator latLngAnimator = (MapboxLatLngAnimator) animatorArray.get(ANIMATOR_LAYER_LATLNG); - MapboxFloatAnimator gpsBearingAnimator = (MapboxFloatAnimator) animatorArray.get(ANIMATOR_LAYER_GPS_BEARING); - MapboxFloatAnimator compassBearingAnimator = - (MapboxFloatAnimator) animatorArray.get(ANIMATOR_LAYER_COMPASS_BEARING); - MapboxFloatAnimator accuracyAnimator = - (MapboxFloatAnimator) animatorArray.get(ANIMATOR_LAYER_ACCURACY); + MapLibreLatLngAnimator latLngAnimator = (MapLibreLatLngAnimator) animatorArray.get(ANIMATOR_LAYER_LATLNG); + MapLibreFloatAnimator gpsBearingAnimator = (MapLibreFloatAnimator) animatorArray.get(ANIMATOR_LAYER_GPS_BEARING); + MapLibreFloatAnimator compassBearingAnimator = + (MapLibreFloatAnimator) animatorArray.get(ANIMATOR_LAYER_COMPASS_BEARING); + MapLibreFloatAnimator accuracyAnimator = + (MapLibreFloatAnimator) animatorArray.get(ANIMATOR_LAYER_ACCURACY); if (latLngAnimator != null && gpsBearingAnimator != null) { LatLng currentLatLng = (LatLng) latLngAnimator.getAnimatedValue(); @@ -496,13 +497,13 @@ final class LocationAnimatorCoordinator { void cancelAllAnimations() { for (int i = 0; i < animatorArray.size(); i++) { - @MapboxAnimator.Type int animatorType = animatorArray.keyAt(i); + @MapLibreAnimator.Type int animatorType = animatorArray.keyAt(i); cancelAnimator(animatorType); } } - private void cancelAnimator(@MapboxAnimator.Type int animatorType) { - MapboxAnimator animator = animatorArray.get(animatorType); + private void cancelAnimator(@MapLibreAnimator.Type int animatorType) { + MapLibreAnimator animator = animatorArray.get(animatorType); if (animator != null) { animator.cancel(); animator.removeAllUpdateListeners(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationCameraController.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationCameraController.java similarity index 77% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationCameraController.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationCameraController.java index 2a167b7e7..ac4868f32 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationCameraController.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationCameraController.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.content.Context; import android.graphics.PointF; @@ -13,25 +13,26 @@ import androidx.annotation.VisibleForTesting; import com.mapbox.android.gestures.AndroidGesturesManager; import com.mapbox.android.gestures.MoveGestureDetector; import com.mapbox.android.gestures.RotateGestureDetector; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.camera.CameraUpdate; -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.location.modes.CameraMode; -import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.maps.Transform; +import org.maplibre.android.location.modes.CameraMode; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.maps.Transform; import java.util.HashSet; import java.util.Set; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.TRANSITION_ANIMATION_DURATION_MS; +import static org.maplibre.android.location.LocationComponentConstants.TRANSITION_ANIMATION_DURATION_MS; + +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.camera.CameraUpdate; +import org.maplibre.android.camera.CameraUpdateFactory; +import org.maplibre.android.geometry.LatLng; final class LocationCameraController { @CameraMode.Mode private int cameraMode; - private final MapboxMap mapboxMap; + private final MapLibreMap maplibreMap; private final Transform transform; private final OnCameraTrackingChangedListener internalCameraTrackingChangedListener; private LocationComponentOptions options; @@ -48,36 +49,36 @@ final class LocationCameraController { LocationCameraController( Context context, - MapboxMap mapboxMap, + MapLibreMap maplibreMap, Transform transform, OnCameraTrackingChangedListener internalCameraTrackingChangedListener, @NonNull LocationComponentOptions options, OnCameraMoveInvalidateListener onCameraMoveInvalidateListener) { - this.mapboxMap = mapboxMap; + this.maplibreMap = maplibreMap; this.transform = transform; - initialGesturesManager = mapboxMap.getGesturesManager(); + initialGesturesManager = maplibreMap.getGesturesManager(); internalGesturesManager = new LocationGesturesManager(context); moveGestureDetector = internalGesturesManager.getMoveGestureDetector(); - mapboxMap.addOnRotateListener(onRotateListener); - mapboxMap.addOnFlingListener(onFlingListener); - mapboxMap.addOnMoveListener(onMoveListener); - mapboxMap.addOnCameraMoveListener(onCameraMoveListener); + maplibreMap.addOnRotateListener(onRotateListener); + maplibreMap.addOnFlingListener(onFlingListener); + maplibreMap.addOnMoveListener(onMoveListener); + maplibreMap.addOnCameraMoveListener(onCameraMoveListener); this.internalCameraTrackingChangedListener = internalCameraTrackingChangedListener; this.onCameraMoveInvalidateListener = onCameraMoveInvalidateListener; initializeOptions(options); } // Package private for testing purposes - LocationCameraController(MapboxMap mapboxMap, + LocationCameraController(MapLibreMap maplibreMap, Transform transform, MoveGestureDetector moveGestureDetector, OnCameraTrackingChangedListener internalCameraTrackingChangedListener, OnCameraMoveInvalidateListener onCameraMoveInvalidateListener, AndroidGesturesManager initialGesturesManager, AndroidGesturesManager internalGesturesManager) { - this.mapboxMap = mapboxMap; - mapboxMap.addOnCameraMoveListener(onCameraMoveListener); + this.maplibreMap = maplibreMap; + maplibreMap.addOnCameraMoveListener(onCameraMoveListener); this.transform = transform; this.moveGestureDetector = moveGestureDetector; this.internalCameraTrackingChangedListener = internalCameraTrackingChangedListener; @@ -89,12 +90,12 @@ final class LocationCameraController { void initializeOptions(LocationComponentOptions options) { this.options = options; if (options.trackingGesturesManagement()) { - if (mapboxMap.getGesturesManager() != internalGesturesManager) { - mapboxMap.setGesturesManager(internalGesturesManager, true, true); + if (maplibreMap.getGesturesManager() != internalGesturesManager) { + maplibreMap.setGesturesManager(internalGesturesManager, true, true); } adjustGesturesThresholds(); - } else if (mapboxMap.getGesturesManager() != initialGesturesManager) { - mapboxMap.setGesturesManager(initialGesturesManager, true, true); + } else if (maplibreMap.getGesturesManager() != initialGesturesManager) { + maplibreMap.setGesturesManager(initialGesturesManager, true, true); } } @@ -117,7 +118,7 @@ final class LocationCameraController { this.cameraMode = cameraMode; if (cameraMode != CameraMode.NONE) { - mapboxMap.cancelTransitions(); + maplibreMap.cancelTransitions(); } adjustGesturesThresholds(); @@ -154,7 +155,7 @@ final class LocationCameraController { } CameraUpdate update = CameraUpdateFactory.newCameraPosition(builder.build()); - MapboxMap.CancelableCallback callback = new MapboxMap.CancelableCallback() { + MapLibreMap.CancelableCallback callback = new MapLibreMap.CancelableCallback() { @Override public void onCancel() { isTransitioning = false; @@ -172,15 +173,15 @@ final class LocationCameraController { } }; - CameraPosition currentPosition = mapboxMap.getCameraPosition(); - if (Utils.immediateAnimation(mapboxMap.getProjection(), currentPosition.target, target)) { + CameraPosition currentPosition = maplibreMap.getCameraPosition(); + if (Utils.immediateAnimation(maplibreMap.getProjection(), currentPosition.target, target)) { transform.moveCamera( - mapboxMap, + maplibreMap, update, callback); } else { transform.animateCamera( - mapboxMap, + maplibreMap, update, (int) transitionDuration, callback); @@ -201,7 +202,7 @@ final class LocationCameraController { return; } - transform.moveCamera(mapboxMap, CameraUpdateFactory.bearingTo(bearing), null); + transform.moveCamera(maplibreMap, CameraUpdateFactory.bearingTo(bearing), null); onCameraMoveInvalidateListener.onInvalidateCameraMove(); } @@ -210,7 +211,7 @@ final class LocationCameraController { return; } lastLocation = latLng; - transform.moveCamera(mapboxMap, CameraUpdateFactory.newLatLng(latLng), null); + transform.moveCamera(maplibreMap, CameraUpdateFactory.newLatLng(latLng), null); onCameraMoveInvalidateListener.onInvalidateCameraMove(); } @@ -219,7 +220,7 @@ final class LocationCameraController { return; } - transform.moveCamera(mapboxMap, CameraUpdateFactory.zoomTo(zoom), null); + transform.moveCamera(maplibreMap, CameraUpdateFactory.zoomTo(zoom), null); onCameraMoveInvalidateListener.onInvalidateCameraMove(); } @@ -228,24 +229,24 @@ final class LocationCameraController { return; } - transform.moveCamera(mapboxMap, CameraUpdateFactory.tiltTo(tilt), null); + transform.moveCamera(maplibreMap, CameraUpdateFactory.tiltTo(tilt), null); onCameraMoveInvalidateListener.onInvalidateCameraMove(); } - private final MapboxAnimator.AnimationsValueChangeListener latLngValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener latLngValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(LatLng value) { setLatLng(value); } }; - private final MapboxAnimator.AnimationsValueChangeListener gpsBearingValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener gpsBearingValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float value) { boolean trackingNorth = cameraMode == CameraMode.TRACKING_GPS_NORTH - && mapboxMap.getCameraPosition().bearing == 0; + && maplibreMap.getCameraPosition().bearing == 0; if (!trackingNorth) { setBearing(value); @@ -253,8 +254,8 @@ final class LocationCameraController { } }; - private final MapboxAnimator.AnimationsValueChangeListener compassBearingValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener compassBearingValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float value) { if (cameraMode == CameraMode.TRACKING_COMPASS @@ -264,16 +265,16 @@ final class LocationCameraController { } }; - private final MapboxAnimator.AnimationsValueChangeListener zoomValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener zoomValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float value) { setZoom(value); } }; - private final MapboxAnimator.AnimationsValueChangeListener tiltValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener tiltValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float value) { setTilt(value); @@ -283,21 +284,21 @@ final class LocationCameraController { Set getAnimationListeners() { Set holders = new HashSet<>(); if (isLocationTracking()) { - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_CAMERA_LATLNG, latLngValueListener)); + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_CAMERA_LATLNG, latLngValueListener)); } if (isLocationBearingTracking()) { - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_CAMERA_GPS_BEARING, gpsBearingValueListener)); + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_CAMERA_GPS_BEARING, gpsBearingValueListener)); } if (isConsumingCompass()) { holders.add(new AnimatorListenerHolder( - MapboxAnimator.ANIMATOR_CAMERA_COMPASS_BEARING, + MapLibreAnimator.ANIMATOR_CAMERA_COMPASS_BEARING, compassBearingValueListener)); } - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_ZOOM, zoomValueListener)); - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_TILT, tiltValueListener)); + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_ZOOM, zoomValueListener)); + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_TILT, tiltValueListener)); return holders; } @@ -349,25 +350,25 @@ final class LocationCameraController { private void notifyCameraTrackingChangeListener(boolean wasTracking) { internalCameraTrackingChangedListener.onCameraTrackingChanged(cameraMode); if (wasTracking && !isLocationTracking()) { - mapboxMap.getUiSettings().setFocalPoint(null); + maplibreMap.getUiSettings().setFocalPoint(null); internalCameraTrackingChangedListener.onCameraTrackingDismissed(); } } - private MapboxMap.OnCameraMoveListener onCameraMoveListener = new MapboxMap.OnCameraMoveListener() { + private MapLibreMap.OnCameraMoveListener onCameraMoveListener = new MapLibreMap.OnCameraMoveListener() { @Override public void onCameraMove() { if (isLocationTracking() && lastLocation != null && options.trackingGesturesManagement()) { - PointF focalPoint = mapboxMap.getProjection().toScreenLocation(lastLocation); - mapboxMap.getUiSettings().setFocalPoint(focalPoint); + PointF focalPoint = maplibreMap.getProjection().toScreenLocation(lastLocation); + maplibreMap.getUiSettings().setFocalPoint(focalPoint); } } }; @NonNull @VisibleForTesting - MapboxMap.OnMoveListener onMoveListener = new MapboxMap.OnMoveListener() { + MapLibreMap.OnMoveListener onMoveListener = new MapLibreMap.OnMoveListener() { private boolean interrupt; @Override @@ -433,7 +434,7 @@ final class LocationCameraController { }; @NonNull - private MapboxMap.OnRotateListener onRotateListener = new MapboxMap.OnRotateListener() { + private MapLibreMap.OnRotateListener onRotateListener = new MapLibreMap.OnRotateListener() { @Override public void onRotateBegin(@NonNull RotateGestureDetector detector) { if (isBearingTracking()) { @@ -453,7 +454,7 @@ final class LocationCameraController { }; @NonNull - private MapboxMap.OnFlingListener onFlingListener = new MapboxMap.OnFlingListener() { + private MapLibreMap.OnFlingListener onFlingListener = new MapLibreMap.OnFlingListener() { @Override public void onFling() { setCameraMode(CameraMode.NONE); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponent.java similarity index 89% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponent.java index 41a629de6..9812ddbdd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponent.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.annotation.SuppressLint; import android.content.Context; @@ -14,26 +14,28 @@ import androidx.annotation.RequiresPermission; import androidx.annotation.StyleRes; import androidx.annotation.VisibleForTesting; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.camera.CameraUpdate; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.location.engine.LocationEngine; -import com.mapbox.mapboxsdk.location.engine.LocationEngineCallback; -import com.mapbox.mapboxsdk.location.engine.LocationEngineDefault; -import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest; -import com.mapbox.mapboxsdk.location.engine.LocationEngineResult; -import com.mapbox.mapboxsdk.location.modes.CameraMode; -import com.mapbox.mapboxsdk.location.modes.RenderMode; -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.maps.MapView; -import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraIdleListener; -import com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraMoveListener; -import com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener; -import com.mapbox.mapboxsdk.maps.Style; -import com.mapbox.mapboxsdk.maps.Transform; +import org.maplibre.android.R; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.camera.CameraUpdate; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.location.engine.LocationEngine; +import org.maplibre.android.location.engine.LocationEngineCallback; +import org.maplibre.android.location.engine.LocationEngineDefault; +import org.maplibre.android.location.engine.LocationEngineRequest; +import org.maplibre.android.location.engine.LocationEngineResult; +import org.maplibre.android.location.modes.CameraMode; +import org.maplibre.android.location.modes.RenderMode; +import org.maplibre.android.location.engine.MapLibreFusedLocationEngineImpl; +import org.maplibre.android.location.permissions.PermissionsManager; +import org.maplibre.android.log.Logger; +import org.maplibre.android.maps.MapView; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.maps.MapLibreMap.OnCameraIdleListener; +import org.maplibre.android.maps.MapLibreMap.OnCameraMoveListener; +import org.maplibre.android.maps.MapLibreMap.OnMapClickListener; +import org.maplibre.android.maps.Style; +import org.maplibre.android.maps.Transform; +import org.maplibre.android.style.layers.SymbolLayer; import java.lang.ref.WeakReference; import java.util.HashSet; @@ -43,12 +45,13 @@ import java.util.concurrent.CopyOnWriteArrayList; import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.ACCESS_FINE_LOCATION; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.DEFAULT_FASTEST_INTERVAL_MILLIS; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.DEFAULT_INTERVAL_MILLIS; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.DEFAULT_TRACKING_TILT_ANIM_DURATION; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.DEFAULT_TRACKING_ZOOM_ANIM_DURATION; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.TRANSITION_ANIMATION_DURATION_MS; -import static com.mapbox.mapboxsdk.location.modes.RenderMode.GPS; +import static org.maplibre.android.location.LocationComponentConstants.DEFAULT_FASTEST_INTERVAL_MILLIS; +import static org.maplibre.android.location.LocationComponentConstants.DEFAULT_INTERVAL_MILLIS; +import static org.maplibre.android.location.LocationComponentConstants.DEFAULT_TRACKING_TILT_ANIM_DURATION; +import static org.maplibre.android.location.LocationComponentConstants.DEFAULT_TRACKING_ZOOM_ANIM_DURATION; +import static org.maplibre.android.location.LocationComponentConstants.TRANSITION_ANIMATION_DURATION_MS; +import static org.maplibre.android.location.modes.RenderMode.GPS; + /** * The Location Component provides location awareness to your mobile application. Enabling this @@ -65,7 +68,7 @@ import static com.mapbox.mapboxsdk.location.modes.RenderMode.GPS; * mode set with {@link LocationComponent#setCameraMode(int)}. *

* - * To get the component object use {@link MapboxMap#getLocationComponent()} and activate it with + * To get the component object use {@link MapLibreMap#getLocationComponent()} and activate it with * {@link #activateLocationComponent(LocationComponentActivationOptions)}. * Then, manage its visibility with {@link #setLocationComponentEnabled(boolean)}. * The component will not process location updates right after activation, but only after being enabled. @@ -77,7 +80,7 @@ import static com.mapbox.mapboxsdk.location.modes.RenderMode.GPS; * this component to work as expected. *

* This component offers a default, built-in {@link LocationEngine} called - * {@link com.mapbox.mapboxsdk.location.engine.MapboxFusedLocationEngineImpl}. + * {@link MapLibreFusedLocationEngineImpl}. * If you'd like to utilize the previously available Google Play Services for more precise location updates, * refer to the migration guide of 10.0.0 in the changelog. * After a custom engine is passed to the component, or the built-in is initialized, @@ -98,7 +101,7 @@ public final class LocationComponent { private static final String TAG = "Mbgl-LocationComponent"; @NonNull - private final MapboxMap mapboxMap; + private final MapLibreMap maplibreMap; @NonNull private final Transform transform; private Style style; @@ -138,26 +141,26 @@ public final class LocationComponent { private boolean isComponentInitialized; /** - * Indicates whether we're using the {@link com.mapbox.mapboxsdk.location.LocationIndicatorLayer} - * or the stack of {@link com.mapbox.mapboxsdk.style.layers.SymbolLayer}s. + * Indicates whether we're using the {@link LocationIndicatorLayer} + * or the stack of {@link SymbolLayer}s. */ private boolean useSpecializedLocationLayer; /** - * Indicates that the component is enabled and should be displaying location if Mapbox components are available and + * Indicates that the component is enabled and should be displaying location if MapLibre components are available and * the lifecycle is in a started state. */ private boolean isEnabled; /** * Indicated that component's lifecycle {@link #onStart()} method has been called. - * This allows Mapbox components enter started state and display data, and adds state safety for methods like + * This allows MapLibre components enter started state and display data, and adds state safety for methods like * {@link #setLocationComponentEnabled(boolean)} */ private boolean isComponentStarted; /** - * Indicates if Mapbox components are ready to be interacted with. This can differ from {@link #isComponentStarted} + * Indicates if MapLibre components are ready to be interacted with. This can differ from {@link #isComponentStarted} * if the MapLibre style is being reloaded. */ private boolean isLayerReady; @@ -186,12 +189,12 @@ public final class LocationComponent { /** * Internal use. *

- * To get the component object use {@link MapboxMap#getLocationComponent()}. + * To get the component object use {@link MapLibreMap#getLocationComponent()}. */ - public LocationComponent(@NonNull MapboxMap mapboxMap, + public LocationComponent(@NonNull MapLibreMap maplibreMap, @NonNull Transform transform, - @NonNull List developerAnimationListeners) { - this.mapboxMap = mapboxMap; + @NonNull List developerAnimationListeners) { + this.maplibreMap = maplibreMap; this.transform = transform; developerAnimationListeners.add(developerAnimationListener); } @@ -199,14 +202,14 @@ public final class LocationComponent { // used for creating a spy LocationComponent() { //noinspection ConstantConditions - mapboxMap = null; + maplibreMap = null; transform = null; } @VisibleForTesting - LocationComponent(@NonNull MapboxMap mapboxMap, + LocationComponent(@NonNull MapLibreMap maplibreMap, @NonNull Transform transform, - @NonNull List developerAnimationListeners, + @NonNull List developerAnimationListeners, @NonNull LocationEngineCallback currentListener, @NonNull LocationEngineCallback lastListener, @NonNull LocationLayerController locationLayerController, @@ -215,7 +218,7 @@ public final class LocationComponent { @NonNull StaleStateManager staleStateManager, @NonNull CompassEngine compassEngine, boolean useSpecializedLocationLayer) { - this.mapboxMap = mapboxMap; + this.maplibreMap = maplibreMap; this.transform = transform; developerAnimationListeners.add(developerAnimationListener); this.currentLocationEngineListener = currentListener; @@ -414,7 +417,7 @@ public final class LocationComponent { } private void reset(@CameraMode.Mode int cameraMode) { - locationAnimatorCoordinator.resetAllCameraAnimations(mapboxMap.getCameraPosition(), + locationAnimatorCoordinator.resetAllCameraAnimations(maplibreMap.getCameraPosition(), cameraMode == CameraMode.TRACKING_GPS_NORTH); } } @@ -492,7 +495,7 @@ public final class LocationComponent { public void applyStyle(@NonNull final LocationComponentOptions options) { checkActivationState(); LocationComponent.this.options = options; - if (mapboxMap.getStyle() != null) { + if (maplibreMap.getStyle() != null) { locationLayerController.applyStyle(options); locationCameraController.initializeOptions(options); staleStateManager.setEnabled(options.enableStaleState()); @@ -523,8 +526,8 @@ public final class LocationComponent { * Zooms to the desired zoom level. * This API can only be used in pair with camera modes other than {@link CameraMode#NONE}. * If you are not using any of {@link CameraMode} modes, - * use one of {@link MapboxMap#moveCamera(CameraUpdate)}, - * {@link MapboxMap#easeCamera(CameraUpdate)} or {@link MapboxMap#animateCamera(CameraUpdate)} instead. + * use one of {@link MapLibreMap#moveCamera(CameraUpdate)}, + * {@link MapLibreMap#easeCamera(CameraUpdate)} or {@link MapLibreMap#animateCamera(CameraUpdate)} instead. *

* If the camera is transitioning when the zoom change is requested, the call is going to be ignored. * Use {@link CameraTransitionListener} to chain the animations, or provide the zoom as a camera change argument. @@ -535,7 +538,7 @@ public final class LocationComponent { * @param callback The callback with finish/cancel information */ public void zoomWhileTracking(double zoomLevel, long animationDuration, - @Nullable MapboxMap.CancelableCallback callback) { + @Nullable MapLibreMap.CancelableCallback callback) { checkActivationState(); if (!isLayerReady) { notifyUnsuccessfulCameraOperation(callback, null); @@ -550,15 +553,17 @@ public final class LocationComponent { "LocationComponent#zoomWhileTracking method call is ignored because the camera mode is transitioning"); return; } - locationAnimatorCoordinator.feedNewZoomLevel(zoomLevel, mapboxMap.getCameraPosition(), animationDuration, callback); + locationAnimatorCoordinator.feedNewZoomLevel( + zoomLevel, maplibreMap.getCameraPosition(), animationDuration, callback + ); } /** * Zooms to the desired zoom level. * This API can only be used in pair with camera modes other than {@link CameraMode#NONE}. * If you are not using any of {@link CameraMode} modes, - * use one of {@link MapboxMap#moveCamera(CameraUpdate)}, - * {@link MapboxMap#easeCamera(CameraUpdate)} or {@link MapboxMap#animateCamera(CameraUpdate)} instead. + * use one of {@link MapLibreMap#moveCamera(CameraUpdate)}, + * {@link MapLibreMap#easeCamera(CameraUpdate)} or {@link MapLibreMap#animateCamera(CameraUpdate)} instead. *

* If the camera is transitioning when the zoom change is requested, the call is going to be ignored. * Use {@link CameraTransitionListener} to chain the animations, or provide the zoom as a camera change argument. @@ -576,8 +581,8 @@ public final class LocationComponent { * Zooms to the desired zoom level. * This API can only be used in pair with camera modes other than {@link CameraMode#NONE}. * If you are not using any of {@link CameraMode} modes, - * use one of {@link MapboxMap#moveCamera(CameraUpdate)}, - * {@link MapboxMap#easeCamera(CameraUpdate)} or {@link MapboxMap#animateCamera(CameraUpdate)} instead. + * use one of {@link MapLibreMap#moveCamera(CameraUpdate)}, + * {@link MapLibreMap#easeCamera(CameraUpdate)} or {@link MapLibreMap#animateCamera(CameraUpdate)} instead. *

* If the camera is transitioning when the zoom change is requested, the call is going to be ignored. * Use {@link CameraTransitionListener} to chain the animations, or provide the zoom as a camera change argument. @@ -591,7 +596,7 @@ public final class LocationComponent { } /** - * Cancels animation started by {@link #zoomWhileTracking(double, long, MapboxMap.CancelableCallback)}. + * Cancels animation started by {@link #zoomWhileTracking(double, long, MapLibreMap.CancelableCallback)}. */ public void cancelZoomWhileTrackingAnimation() { checkActivationState(); @@ -602,8 +607,8 @@ public final class LocationComponent { * Tilts the camera. * This API can only be used in pair with camera modes other than {@link CameraMode#NONE}. * If you are not using any of {@link CameraMode} modes, - * use one of {@link MapboxMap#moveCamera(CameraUpdate)}, - * {@link MapboxMap#easeCamera(CameraUpdate)} or {@link MapboxMap#animateCamera(CameraUpdate)} instead. + * use one of {@link MapLibreMap#moveCamera(CameraUpdate)}, + * {@link MapLibreMap#easeCamera(CameraUpdate)} or {@link MapLibreMap#animateCamera(CameraUpdate)} instead. *

* If the camera is transitioning when the tilt change is requested, the call is going to be ignored. * Use {@link CameraTransitionListener} to chain the animations, or provide the tilt as a camera change argument. @@ -614,7 +619,7 @@ public final class LocationComponent { * @param callback The callback with finish/cancel information */ public void tiltWhileTracking(double tilt, long animationDuration, - @Nullable MapboxMap.CancelableCallback callback) { + @Nullable MapLibreMap.CancelableCallback callback) { checkActivationState(); if (!isLayerReady) { notifyUnsuccessfulCameraOperation(callback, null); @@ -629,15 +634,15 @@ public final class LocationComponent { "LocationComponent#tiltWhileTracking method call is ignored because the camera mode is transitioning"); return; } - locationAnimatorCoordinator.feedNewTilt(tilt, mapboxMap.getCameraPosition(), animationDuration, callback); + locationAnimatorCoordinator.feedNewTilt(tilt, maplibreMap.getCameraPosition(), animationDuration, callback); } /** * Tilts the camera. * This API can only be used in pair with camera modes other than {@link CameraMode#NONE}. * If you are not using any of {@link CameraMode} modes, - * use one of {@link MapboxMap#moveCamera(CameraUpdate)}, - * {@link MapboxMap#easeCamera(CameraUpdate)} or {@link MapboxMap#animateCamera(CameraUpdate)} instead. + * use one of {@link MapLibreMap#moveCamera(CameraUpdate)}, + * {@link MapLibreMap#easeCamera(CameraUpdate)} or {@link MapLibreMap#animateCamera(CameraUpdate)} instead. *

* If the camera is transitioning when the tilt change is requested, the call is going to be ignored. * Use {@link CameraTransitionListener} to chain the animations, or provide the tilt as a camera change argument. @@ -655,8 +660,8 @@ public final class LocationComponent { * Tilts the camera. * This API can only be used in pair with camera modes other than {@link CameraMode#NONE}. * If you are not using any of {@link CameraMode} modes, - * use one of {@link MapboxMap#moveCamera(CameraUpdate)}, - * {@link MapboxMap#easeCamera(CameraUpdate)} or {@link MapboxMap#animateCamera(CameraUpdate)} instead. + * use one of {@link MapLibreMap#moveCamera(CameraUpdate)}, + * {@link MapLibreMap#easeCamera(CameraUpdate)} or {@link MapLibreMap#animateCamera(CameraUpdate)} instead. *

* If the camera is transitioning when the tilt change is requested, the call is going to be ignored. * Use {@link CameraTransitionListener} to chain the animations, or provide the tilt as a camera change argument. @@ -670,7 +675,7 @@ public final class LocationComponent { } /** - * Cancels animation started by {@link #tiltWhileTracking(double, long, MapboxMap.CancelableCallback)}. + * Cancels animation started by {@link #tiltWhileTracking(double, long, MapLibreMap.CancelableCallback)}. */ public void cancelTiltWhileTrackingAnimation() { checkActivationState(); @@ -718,7 +723,7 @@ public final class LocationComponent { * Set max FPS at which location animators can output updates. The throttling will only impact the location puck * and camera tracking smooth animations. *

- * Setting this will not impact any other animations schedule with {@link MapboxMap}, gesture animations or + * Setting this will not impact any other animations schedule with {@link MapLibreMap}, gesture animations or * {@link #zoomWhileTracking(double)}/{@link #tiltWhileTracking(double)}. *

* Use this setting to limit animation rate of the location puck on higher zoom levels to decrease the stress on @@ -863,7 +868,7 @@ public final class LocationComponent { *

* If there are registered location click listeners and the location is clicked, * only {@link OnLocationClickListener#onLocationComponentClick()} is going to be delivered, - * {@link com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener#onMapClick(LatLng)} is going to be consumed + * {@link MapLibreMap.OnMapClickListener#onMapClick(LatLng)} is going to be consumed * and not pushed to the listeners registered after the component's activation. * * @param listener The location click listener that is invoked when the @@ -887,7 +892,7 @@ public final class LocationComponent { *

* If there are registered location long click listeners and the location is long clicked, * only {@link OnLocationLongClickListener#onLocationComponentLongClick()} is going to be delivered, - * {@link com.mapbox.mapboxsdk.maps.MapboxMap.OnMapLongClickListener#onMapLongClick(LatLng)} is going to be consumed + * {@link MapLibreMap.OnMapLongClickListener#onMapLongClick(LatLng)} is going to be consumed * and not pushed to the listeners registered after the component's activation. * * @param listener The location click listener that is invoked when the @@ -997,7 +1002,7 @@ public final class LocationComponent { */ public void onFinishLoadingStyle() { if (isComponentInitialized) { - style = mapboxMap.getStyle(); + style = maplibreMap.getStyle(); locationLayerController.initializeComponents(style, options); locationCameraController.initializeOptions(options); onLocationLayerStart(); @@ -1014,14 +1019,14 @@ public final class LocationComponent { @SuppressLint("MissingPermission") private void onLocationLayerStart() { - if (!isComponentInitialized || !isComponentStarted || mapboxMap.getStyle() == null) { + if (!isComponentInitialized || !isComponentStarted || maplibreMap.getStyle() == null) { return; } if (!isLayerReady) { isLayerReady = true; - mapboxMap.addOnCameraMoveListener(onCameraMoveListener); - mapboxMap.addOnCameraIdleListener(onCameraIdleListener); + maplibreMap.addOnCameraMoveListener(onCameraMoveListener); + maplibreMap.addOnCameraIdleListener(onCameraIdleListener); if (options.enableStaleState()) { staleStateManager.onStart(); } @@ -1064,8 +1069,8 @@ public final class LocationComponent { if (locationEngine != null) { locationEngine.removeLocationUpdates(currentLocationEngineListener); } - mapboxMap.removeOnCameraMoveListener(onCameraMoveListener); - mapboxMap.removeOnCameraIdleListener(onCameraIdleListener); + maplibreMap.removeOnCameraMoveListener(onCameraMoveListener); + maplibreMap.removeOnCameraIdleListener(onCameraIdleListener); } private void initialize(@NonNull final Context context, @NonNull Style style, boolean useSpecializedLocationLayer, @@ -1083,21 +1088,21 @@ public final class LocationComponent { this.options = options; this.useSpecializedLocationLayer = useSpecializedLocationLayer; - mapboxMap.addOnMapClickListener(onMapClickListener); - mapboxMap.addOnMapLongClickListener(onMapLongClickListener); + maplibreMap.addOnMapClickListener(onMapClickListener); + maplibreMap.addOnMapLongClickListener(onMapLongClickListener); LayerSourceProvider sourceProvider = new LayerSourceProvider(); LayerFeatureProvider featureProvider = new LayerFeatureProvider(); LayerBitmapProvider bitmapProvider = new LayerBitmapProvider(context); - locationLayerController = new LocationLayerController(mapboxMap, style, sourceProvider, featureProvider, + locationLayerController = new LocationLayerController(maplibreMap, style, sourceProvider, featureProvider, bitmapProvider, options, renderModeChangedListener, useSpecializedLocationLayer); locationCameraController = new LocationCameraController( - context, mapboxMap, transform, cameraTrackingChangedListener, options, onCameraMoveInvalidateListener); + context, maplibreMap, transform, cameraTrackingChangedListener, options, onCameraMoveInvalidateListener); locationAnimatorCoordinator = new LocationAnimatorCoordinator( - mapboxMap.getProjection(), - MapboxAnimatorSetProvider.getInstance(), - MapboxAnimatorProvider.getInstance() + maplibreMap.getProjection(), + MapLibreAnimatorSetProvider.getInstance(), + MapLibreAnimatorProvider.getInstance() ); locationAnimatorCoordinator.setTrackingAnimationDurationMultiplier(options .trackingAnimationDurationMultiplier()); @@ -1163,7 +1168,7 @@ public final class LocationComponent { private void updateMapWithOptions(@NonNull LocationComponentOptions options) { int[] padding = options.padding(); if (padding != null) { - mapboxMap.setPadding( + maplibreMap.setPadding( padding[0], padding[1], padding[2], padding[3] ); } @@ -1199,7 +1204,7 @@ public final class LocationComponent { if (!fromLastLocation) { staleStateManager.updateLatestLocationTime(); } - CameraPosition currentCameraPosition = mapboxMap.getCameraPosition(); + CameraPosition currentCameraPosition = maplibreMap.getCameraPosition(); boolean isGpsNorth = getCameraMode() == CameraMode.TRACKING_GPS_NORTH; if (intermediatePoints != null) { locationAnimatorCoordinator.feedNewLocation( @@ -1234,7 +1239,7 @@ public final class LocationComponent { } private void updateCompassHeading(float heading) { - locationAnimatorCoordinator.feedNewCompassBearing(heading, mapboxMap.getCameraPosition()); + locationAnimatorCoordinator.feedNewCompassBearing(heading, maplibreMap.getCameraPosition()); } /** @@ -1260,7 +1265,7 @@ public final class LocationComponent { return; } - CameraPosition position = mapboxMap.getCameraPosition(); + CameraPosition position = maplibreMap.getCameraPosition(); if (lastCameraPosition == null || forceUpdate) { lastCameraPosition = position; locationLayerController.cameraBearingUpdated(position.bearing); @@ -1288,7 +1293,7 @@ public final class LocationComponent { } else if (useSpecializedLocationLayer) { radius = location.getAccuracy(); } else { - radius = Utils.calculateZoomLevelRadius(mapboxMap, location); + radius = Utils.calculateZoomLevelRadius(maplibreMap, location); } locationAnimatorCoordinator.feedNewAccuracyRadius(radius, noAnimation); } @@ -1298,7 +1303,7 @@ public final class LocationComponent { animationsValueChangeListeners.addAll(locationLayerController.getAnimationListeners()); animationsValueChangeListeners.addAll(locationCameraController.getAnimationListeners()); locationAnimatorCoordinator.updateAnimatorListenerHolders(animationsValueChangeListeners); - locationAnimatorCoordinator.resetAllCameraAnimations(mapboxMap.getCameraPosition(), + locationAnimatorCoordinator.resetAllCameraAnimations(maplibreMap.getCameraPosition(), locationCameraController.getCameraMode() == CameraMode.TRACKING_GPS_NORTH); locationAnimatorCoordinator.resetAllLayerAnimations(); } @@ -1334,7 +1339,7 @@ public final class LocationComponent { }; @NonNull - private MapboxMap.OnMapLongClickListener onMapLongClickListener = new MapboxMap.OnMapLongClickListener() { + private MapLibreMap.OnMapLongClickListener onMapLongClickListener = new MapLibreMap.OnMapLongClickListener() { @Override public boolean onMapLongClick(@NonNull LatLng point) { if (!onLocationLongClickListeners.isEmpty() && locationLayerController.onMapClick(point)) { @@ -1458,8 +1463,8 @@ public final class LocationComponent { }; @NonNull - private final MapboxMap.OnDeveloperAnimationListener developerAnimationListener = - new MapboxMap.OnDeveloperAnimationListener() { + private final MapLibreMap.OnDeveloperAnimationListener developerAnimationListener = + new MapLibreMap.OnDeveloperAnimationListener() { @Override public void onDeveloperAnimationStarted() { if (isComponentInitialized && isEnabled) { @@ -1474,7 +1479,7 @@ public final class LocationComponent { } } - private void notifyUnsuccessfulCameraOperation(@Nullable MapboxMap.CancelableCallback callback, + private void notifyUnsuccessfulCameraOperation(@Nullable MapLibreMap.CancelableCallback callback, @Nullable String msg) { if (msg != null) { Logger.e(TAG, msg); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentActivationOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentActivationOptions.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentActivationOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentActivationOptions.java index a77f1928c..48e7f7a22 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentActivationOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentActivationOptions.java @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.content.Context; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.location.engine.LocationEngine; -import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest; -import com.mapbox.mapboxsdk.maps.Style; +import org.maplibre.android.location.engine.LocationEngine; +import org.maplibre.android.location.engine.LocationEngineRequest; +import org.maplibre.android.maps.Style; /** * A class which holds the various options for activating the Maps SDK's {@link LocationComponent} to eventually diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentCompassEngine.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentCompassEngine.java index 49307d985..97ece9fc2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentCompassEngine.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentCompassEngine.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.hardware.Sensor; import android.hardware.SensorEvent; @@ -11,7 +11,7 @@ import android.view.WindowManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.log.Logger; import java.util.ArrayList; import java.util.List; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentConstants.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentConstants.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentConstants.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentConstants.java index 13dd283f8..032de3ca1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentConstants.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentConstants.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; /** * Contains all the constants being used for the {@link LocationComponent}. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentNotInitializedException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentNotInitializedException.java similarity index 88% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentNotInitializedException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentNotInitializedException.java index 82a73b973..3136d6392 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentNotInitializedException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentNotInitializedException.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; final class LocationComponentNotInitializedException extends RuntimeException { LocationComponentNotInitializedException() { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentOptions.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentOptions.java index 9e0a3d761..16867fd0b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentOptions.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.content.Context; import android.content.res.TypedArray; @@ -16,8 +16,10 @@ import androidx.annotation.Nullable; import androidx.annotation.StyleRes; import com.mapbox.android.gestures.AndroidGesturesManager; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.style.layers.Layer; + +import org.maplibre.android.R; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.style.layers.Layer; import java.util.Arrays; @@ -437,7 +439,7 @@ public class LocationComponentOptions implements Parcelable { /** * String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will use this image in place of the provided or default maplibre_foregroundDrawableStale. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -464,7 +466,7 @@ public class LocationComponentOptions implements Parcelable { /** * String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_foregroundDrawableStale. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -491,7 +493,7 @@ public class LocationComponentOptions implements Parcelable { /** * String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_gpsDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -518,7 +520,7 @@ public class LocationComponentOptions implements Parcelable { /** * String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_foregroundDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -545,7 +547,7 @@ public class LocationComponentOptions implements Parcelable { /** * String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_backgroundDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -572,7 +574,7 @@ public class LocationComponentOptions implements Parcelable { /** * String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_bearingDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -729,7 +731,7 @@ public class LocationComponentOptions implements Parcelable { *

* Note: If set to true, this can overwrite some of the gesture thresholds * and the custom {@link com.mapbox.android.gestures.AndroidGesturesManager} that was set with - * {@link com.mapbox.mapboxsdk.maps.MapboxMap#setGesturesManager(AndroidGesturesManager, boolean, boolean)}. + * {@link MapLibreMap#setGesturesManager(AndroidGesturesManager, boolean, boolean)}. * * @return true if gestures are adjusted when in one of the camera tracking modes, false otherwise * @see Builder#trackingInitialMoveThreshold(float) @@ -774,7 +776,7 @@ public class LocationComponentOptions implements Parcelable { /** * Gets the id of the layer that's referenced when placing the component on the map using - * {@link com.mapbox.mapboxsdk.maps.Style#addLayerAbove(Layer, String)}. + * {@link org.maplibre.android.maps.Style#addLayerAbove(Layer, String)}. *

* The component is going to placed directly above this layer. * @@ -786,7 +788,7 @@ public class LocationComponentOptions implements Parcelable { /** * Gets the id of the layer that's referenced when placing the component on the map using - * {@link com.mapbox.mapboxsdk.maps.Style#addLayerBelow(Layer, String)}. + * {@link org.maplibre.android.maps.Style#addLayerBelow(Layer, String)}. *

* The component is going to placed directly below this layer. * @@ -806,8 +808,8 @@ public class LocationComponentOptions implements Parcelable { } /** - * Enable or disable smooth animation of compass values for {@link com.mapbox.mapboxsdk.location.modes.CameraMode} - * and {@link com.mapbox.mapboxsdk.location.modes.RenderMode}. + * Enable or disable smooth animation of compass values for {@link org.maplibre.android.location.modes.CameraMode} + * and {@link org.maplibre.android.location.modes.RenderMode}. * * @return whether smooth compass animation is enabled */ @@ -1437,7 +1439,7 @@ public class LocationComponentOptions implements Parcelable { /** * Given a String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_backgroundDrawableStale. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -1468,7 +1470,7 @@ public class LocationComponentOptions implements Parcelable { /** * Given a String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_foregroundDrawableStale. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -1499,7 +1501,7 @@ public class LocationComponentOptions implements Parcelable { /** * Given a String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_gpsDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -1530,7 +1532,7 @@ public class LocationComponentOptions implements Parcelable { /** * Given a String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_foregroundDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -1561,7 +1563,7 @@ public class LocationComponentOptions implements Parcelable { /** * Given a String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_backgroundDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -1592,7 +1594,7 @@ public class LocationComponentOptions implements Parcelable { /** * Given a String image name, identical to one used in - * the first parameter of {@link com.mapbox.mapboxsdk.maps.Style.Builder#addImage(String, Bitmap)}, the + * the first parameter of {@link org.maplibre.android.maps.Style.Builder#addImage(String, Bitmap)}, the * component, will used this image in place of the provided or default maplibre_bearingDrawable. *

* A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded @@ -1729,8 +1731,10 @@ public class LocationComponentOptions implements Parcelable { *

* * @param padding The margins for the map in pixels (left, top, right, bottom). - * @deprecated Use {@link CameraPosition.Builder#padding(double, double, double, double)} - * or {@link CameraUpdateFactory#paddingTo(double, double, double, double)} instead. + * @deprecated Use + * {@link org.maplibre.android.camera.CameraPosition.Builder#padding(double, double, double, double)} or + * {@link org.maplibre.android.camera.CameraUpdateFactory#paddingTo(double, double, double, double)} + * instead. */ @NonNull @Deprecated @@ -1781,7 +1785,7 @@ public class LocationComponentOptions implements Parcelable { *

* Note: This can overwrite some of the gesture thresholds * and the custom {@link com.mapbox.android.gestures.AndroidGesturesManager} that was set with - * {@link com.mapbox.mapboxsdk.maps.MapboxMap#setGesturesManager(AndroidGesturesManager, boolean, boolean)}. + * {@link MapLibreMap#setGesturesManager(AndroidGesturesManager, boolean, boolean)}. * * @param trackingGesturesManagement true if gestures should be adjusted when in one of the camera tracking modes, * false otherwise @@ -1836,7 +1840,7 @@ public class LocationComponentOptions implements Parcelable { /** * Sets the id of the layer that's referenced when placing the component on the map using - * {@link com.mapbox.mapboxsdk.maps.Style#addLayerAbove(Layer, String)}. + * {@link org.maplibre.android.maps.Style#addLayerAbove(Layer, String)}. *

* The component is going to placed directly above this layer. * @@ -1850,7 +1854,7 @@ public class LocationComponentOptions implements Parcelable { /** * Sets the id of the layer that's referenced when placing the component on the map using - * {@link com.mapbox.mapboxsdk.maps.Style#addLayerBelow(Layer, String)}. + * {@link org.maplibre.android.maps.Style#addLayerBelow(Layer, String)}. *

* The component is going to placed directly below this layer. * @@ -1875,8 +1879,8 @@ public class LocationComponentOptions implements Parcelable { } /** - * Enable or disable smooth animation of compass values for {@link com.mapbox.mapboxsdk.location.modes.CameraMode} - * and {@link com.mapbox.mapboxsdk.location.modes.RenderMode}. + * Enable or disable smooth animation of compass values for {@link org.maplibre.android.location.modes.CameraMode} + * and {@link org.maplibre.android.location.modes.RenderMode}. * * @return whether smooth compass animation is enabled */ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentPositionManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentPositionManager.java similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentPositionManager.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentPositionManager.java index 652b636a9..f0a3185dd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponentPositionManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationComponentPositionManager.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.maps.Style; -import com.mapbox.mapboxsdk.style.layers.Layer; +import org.maplibre.android.maps.Style; +import org.maplibre.android.style.layers.Layer; class LocationComponentPositionManager { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationIndicatorLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationIndicatorLayer.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationIndicatorLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationIndicatorLayer.java index b36a538f4..4a85ee8f6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationIndicatorLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationIndicatorLayer.java @@ -1,17 +1,21 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import androidx.annotation.ColorInt; import androidx.annotation.Keep; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.style.layers.PropertyValue; -import com.mapbox.mapboxsdk.style.layers.TransitionOptions; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; -import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; +import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.style.layers.PropertyValue; /** * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationLayerController.java similarity index 75% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationLayerController.java index 7f52a3ed9..3430d93f6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerController.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationLayerController.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.graphics.Bitmap; import android.graphics.PointF; @@ -7,29 +7,30 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.mapbox.geojson.Feature; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.location.modes.RenderMode; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.maps.Style; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import org.maplibre.android.location.modes.RenderMode; +import org.maplibre.android.log.Logger; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.maps.Style; +import org.maplibre.android.style.expressions.Expression; import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_LAYER; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_STALE_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_LAYER; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_LAYER; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_STALE_ICON; -import static com.mapbox.mapboxsdk.style.expressions.Expression.interpolate; -import static com.mapbox.mapboxsdk.style.expressions.Expression.linear; -import static com.mapbox.mapboxsdk.style.expressions.Expression.stop; -import static com.mapbox.mapboxsdk.style.expressions.Expression.zoom; +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BEARING_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BEARING_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_STALE_ICON; +import static org.maplibre.android.style.expressions.Expression.interpolate; +import static org.maplibre.android.style.expressions.Expression.linear; +import static org.maplibre.android.style.expressions.Expression.stop; +import static org.maplibre.android.style.expressions.Expression.zoom; + +import org.maplibre.android.geometry.LatLng; final class LocationLayerController { @@ -38,7 +39,7 @@ final class LocationLayerController { @RenderMode.Mode private int renderMode; - private final MapboxMap mapboxMap; + private final MapLibreMap maplibreMap; private final LayerBitmapProvider bitmapProvider; private LocationComponentOptions options; private final OnRenderModeChangedListener internalRenderModeChangedListener; @@ -51,14 +52,14 @@ final class LocationLayerController { private LocationLayerRenderer locationLayerRenderer; - LocationLayerController(MapboxMap mapboxMap, Style style, + LocationLayerController(MapLibreMap maplibreMap, Style style, LayerSourceProvider layerSourceProvider, LayerFeatureProvider featureProvider, LayerBitmapProvider bitmapProvider, @NonNull LocationComponentOptions options, @NonNull OnRenderModeChangedListener internalRenderModeChangedListener, boolean useSpecializedLocationLayer) { - this.mapboxMap = mapboxMap; + this.maplibreMap = maplibreMap; this.bitmapProvider = bitmapProvider; this.internalRenderModeChangedListener = internalRenderModeChangedListener; this.useSpecializedLocationLayer = useSpecializedLocationLayer; @@ -202,8 +203,8 @@ final class LocationLayerController { private void styleScaling(@NonNull LocationComponentOptions options) { Expression scaleExpression = interpolate(linear(), zoom(), - stop(mapboxMap.getMinZoomLevel(), options.minZoomIconScale()), - stop(mapboxMap.getMaxZoomLevel(), options.maxZoomIconScale()) + stop(maplibreMap.getMinZoomLevel(), options.minZoomIconScale()), + stop(maplibreMap.getMaxZoomLevel(), options.maxZoomIconScale()) ); locationLayerRenderer.styleScaling(scaleExpression); @@ -248,8 +249,8 @@ final class LocationLayerController { // boolean onMapClick(@NonNull LatLng point) { - PointF screenLoc = mapboxMap.getProjection().toScreenLocation(point); - List features = mapboxMap.queryRenderedFeatures(screenLoc, + PointF screenLoc = maplibreMap.getProjection().toScreenLocation(point); + List features = maplibreMap.queryRenderedFeatures(screenLoc, BACKGROUND_LAYER, FOREGROUND_LAYER, BEARING_LAYER @@ -257,32 +258,32 @@ final class LocationLayerController { return !features.isEmpty(); } - private final MapboxAnimator.AnimationsValueChangeListener latLngValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener latLngValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(LatLng value) { locationLayerRenderer.setLatLng(value); } }; - private final MapboxAnimator.AnimationsValueChangeListener gpsBearingValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener gpsBearingValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float value) { locationLayerRenderer.setGpsBearing(value); } }; - private final MapboxAnimator.AnimationsValueChangeListener compassBearingValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener compassBearingValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float value) { locationLayerRenderer.setCompassBearing(value); } }; - private final MapboxAnimator.AnimationsValueChangeListener accuracyValueListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener accuracyValueListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float value) { locationLayerRenderer.setAccuracyRadius(value); @@ -292,8 +293,8 @@ final class LocationLayerController { /** * The listener that handles the updating of the pulsing circle's radius and opacity. */ - private final MapboxAnimator.AnimationsValueChangeListener pulsingCircleRadiusListener = - new MapboxAnimator.AnimationsValueChangeListener() { + private final MapLibreAnimator.AnimationsValueChangeListener pulsingCircleRadiusListener = + new MapLibreAnimator.AnimationsValueChangeListener() { @Override public void onNewAnimationValue(Float newPulseRadiusValue) { Float newPulseOpacityValue = null; @@ -306,21 +307,21 @@ final class LocationLayerController { Set getAnimationListeners() { Set holders = new HashSet<>(); - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_LAYER_LATLNG, latLngValueListener)); + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_LAYER_LATLNG, latLngValueListener)); if (renderMode == RenderMode.GPS) { - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_LAYER_GPS_BEARING, gpsBearingValueListener)); + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_LAYER_GPS_BEARING, gpsBearingValueListener)); } else if (renderMode == RenderMode.COMPASS) { holders.add( - new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_LAYER_COMPASS_BEARING, compassBearingValueListener)); + new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_LAYER_COMPASS_BEARING, compassBearingValueListener)); } if (renderMode == RenderMode.COMPASS || renderMode == RenderMode.NORMAL) { - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_LAYER_ACCURACY, accuracyValueListener)); + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_LAYER_ACCURACY, accuracyValueListener)); } if (options.pulseEnabled()) { - holders.add(new AnimatorListenerHolder(MapboxAnimator.ANIMATOR_PULSING_CIRCLE, + holders.add(new AnimatorListenerHolder(MapLibreAnimator.ANIMATOR_PULSING_CIRCLE, pulsingCircleRadiusListener)); } return holders; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerRenderer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationLayerRenderer.java similarity index 85% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerRenderer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationLayerRenderer.java index 13333372e..4e8868ac2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationLayerRenderer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationLayerRenderer.java @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.graphics.Bitmap; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.location.modes.RenderMode; -import com.mapbox.mapboxsdk.maps.Style; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import org.maplibre.android.location.modes.RenderMode; +import org.maplibre.android.maps.Style; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.geometry.LatLng; interface LocationLayerRenderer { void initializeComponents(Style style); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationPropertyFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationPropertyFactory.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationPropertyFactory.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationPropertyFactory.java index 5c804960f..653f2d224 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationPropertyFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationPropertyFactory.java @@ -1,16 +1,16 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import androidx.annotation.ColorInt; -import com.mapbox.mapboxsdk.style.expressions.Expression; -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; - -import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.types.Formatted; +import static org.maplibre.android.utils.ColorUtils.colorToRgbaString; +import org.maplibre.android.style.layers.LayoutPropertyValue; +import org.maplibre.android.style.layers.PaintPropertyValue; +import org.maplibre.android.style.layers.Property; +import org.maplibre.android.style.layers.PropertyValue; /** * Constructs paint/layout properties for Layers diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimator.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimator.java similarity index 86% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimator.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimator.java index 82853ef8c..f74a31208 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimator.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimator.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -17,7 +17,7 @@ import java.lang.annotation.RetentionPolicy; * * @param Data type that will be animated. */ -abstract class MapboxAnimator extends ValueAnimator implements ValueAnimator.AnimatorUpdateListener { +abstract class MapLibreAnimator extends ValueAnimator implements ValueAnimator.AnimatorUpdateListener { @Retention(RetentionPolicy.SOURCE) @IntDef( { ANIMATOR_LAYER_LATLNG, @@ -59,8 +59,8 @@ abstract class MapboxAnimator extends ValueAnimator implements ValueAnimator. */ private boolean invalid; - MapboxAnimator(@NonNull @Size(min = 2) K[] values, @NonNull AnimationsValueChangeListener updateListener, - int maxAnimationFps) { + MapLibreAnimator(@NonNull @Size(min = 2) K[] values, @NonNull AnimationsValueChangeListener updateListener, + int maxAnimationFps) { minUpdateInterval = 1E9 / maxAnimationFps; setObjectValues((Object[]) values); setEvaluator(provideEvaluator()); @@ -70,8 +70,8 @@ abstract class MapboxAnimator extends ValueAnimator implements ValueAnimator. addListener(new AnimatorListener()); } - public MapboxAnimator(AnimationsValueChangeListener updateListener, K target, K animatedValue, - double minUpdateInterval, long timeElapsed) { + public MapLibreAnimator(AnimationsValueChangeListener updateListener, K target, K animatedValue, + double minUpdateInterval, long timeElapsed) { this.updateListener = updateListener; this.target = target; this.animatedValue = animatedValue; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimatorProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimatorProvider.java similarity index 59% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimatorProvider.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimatorProvider.java index 16324f18a..9fd256a61 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimatorProvider.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimatorProvider.java @@ -1,42 +1,42 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.animation.ValueAnimator; import android.view.animation.Interpolator; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.geometry.LatLng; -final class MapboxAnimatorProvider { +final class MapLibreAnimatorProvider { - private static MapboxAnimatorProvider INSTANCE; + private static MapLibreAnimatorProvider INSTANCE; - private MapboxAnimatorProvider() { + private MapLibreAnimatorProvider() { // private constructor } - public static MapboxAnimatorProvider getInstance() { + public static MapLibreAnimatorProvider getInstance() { if (INSTANCE == null) { - INSTANCE = new MapboxAnimatorProvider(); + INSTANCE = new MapLibreAnimatorProvider(); } return INSTANCE; } - MapboxLatLngAnimator latLngAnimator(LatLng[] values, MapboxAnimator.AnimationsValueChangeListener updateListener, + MapLibreLatLngAnimator latLngAnimator(LatLng[] values, MapLibreAnimator.AnimationsValueChangeListener updateListener, + int maxAnimationFps) { + return new MapLibreLatLngAnimator(values, updateListener, maxAnimationFps); + } + + MapLibreFloatAnimator floatAnimator(Float[] values, MapLibreAnimator.AnimationsValueChangeListener updateListener, int maxAnimationFps) { - return new MapboxLatLngAnimator(values, updateListener, maxAnimationFps); + return new MapLibreFloatAnimator(values, updateListener, maxAnimationFps); } - MapboxFloatAnimator floatAnimator(Float[] values, MapboxAnimator.AnimationsValueChangeListener updateListener, - int maxAnimationFps) { - return new MapboxFloatAnimator(values, updateListener, maxAnimationFps); - } - - MapboxCameraAnimatorAdapter cameraAnimator(Float[] values, - MapboxAnimator.AnimationsValueChangeListener updateListener, - @Nullable MapboxMap.CancelableCallback cancelableCallback) { - return new MapboxCameraAnimatorAdapter(values, updateListener, cancelableCallback); + MapLibreCameraAnimatorAdapter cameraAnimator(Float[] values, + MapLibreAnimator.AnimationsValueChangeListener updateListener, + @Nullable MapLibreMap.CancelableCallback cancelableCallback) { + return new MapLibreCameraAnimatorAdapter(values, updateListener, cancelableCallback); } /** @@ -52,7 +52,7 @@ final class MapboxAnimatorProvider { * the pulsing animation (linear, accelerate, bounce, etc.) * @return a built {@link PulsingLocationCircleAnimator} object. */ - PulsingLocationCircleAnimator pulsingCircleAnimator(MapboxAnimator.AnimationsValueChangeListener updateListener, + PulsingLocationCircleAnimator pulsingCircleAnimator(MapLibreAnimator.AnimationsValueChangeListener updateListener, int maxAnimationFps, float pulseSingleDuration, float pulseMaxRadius, diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimatorSetProvider.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimatorSetProvider.java similarity index 70% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimatorSetProvider.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimatorSetProvider.java index 40bdf67be..31888b883 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxAnimatorSetProvider.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreAnimatorSetProvider.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.animation.Animator; import android.animation.AnimatorSet; @@ -8,16 +8,16 @@ import androidx.annotation.NonNull; import java.util.List; -class MapboxAnimatorSetProvider { - private static MapboxAnimatorSetProvider instance; +class MapLibreAnimatorSetProvider { + private static MapLibreAnimatorSetProvider instance; - private MapboxAnimatorSetProvider() { + private MapLibreAnimatorSetProvider() { // private constructor } - static MapboxAnimatorSetProvider getInstance() { + static MapLibreAnimatorSetProvider getInstance() { if (instance == null) { - instance = new MapboxAnimatorSetProvider(); + instance = new MapLibreAnimatorSetProvider(); } return instance; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxCameraAnimatorAdapter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreCameraAnimatorAdapter.java similarity index 52% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxCameraAnimatorAdapter.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreCameraAnimatorAdapter.java index a3b9fff42..c4647ae42 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxCameraAnimatorAdapter.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreCameraAnimatorAdapter.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -7,21 +7,21 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.Size; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.maps.MapLibreMap; -class MapboxCameraAnimatorAdapter extends MapboxFloatAnimator { +class MapLibreCameraAnimatorAdapter extends MapLibreFloatAnimator { @Nullable - private final MapboxMap.CancelableCallback cancelableCallback; + private final MapLibreMap.CancelableCallback cancelableCallback; - MapboxCameraAnimatorAdapter(@NonNull @Size(min = 2) Float[] values, - AnimationsValueChangeListener updateListener, - @Nullable MapboxMap.CancelableCallback cancelableCallback) { + MapLibreCameraAnimatorAdapter(@NonNull @Size(min = 2) Float[] values, + AnimationsValueChangeListener updateListener, + @Nullable MapLibreMap.CancelableCallback cancelableCallback) { super(values, updateListener, Integer.MAX_VALUE); this.cancelableCallback = cancelableCallback; - addListener(new MapboxAnimatorListener()); + addListener(new MapLibreAnimatorListener()); } - private final class MapboxAnimatorListener extends AnimatorListenerAdapter { + private final class MapLibreAnimatorListener extends AnimatorListenerAdapter { @Override public void onAnimationCancel(Animator animation) { if (cancelableCallback != null) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxFloatAnimator.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreFloatAnimator.java similarity index 53% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxFloatAnimator.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreFloatAnimator.java index cad5fc983..1907f8d76 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/MapboxFloatAnimator.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreFloatAnimator.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.animation.FloatEvaluator; import android.animation.TypeEvaluator; @@ -6,9 +6,9 @@ import android.animation.TypeEvaluator; import androidx.annotation.NonNull; import androidx.annotation.Size; -class MapboxFloatAnimator extends MapboxAnimator { - MapboxFloatAnimator(@NonNull @Size(min = 2) Float[] values, - @NonNull AnimationsValueChangeListener updateListener, int maxAnimationFps) { +class MapLibreFloatAnimator extends MapLibreAnimator { + MapLibreFloatAnimator(@NonNull @Size(min = 2) Float[] values, + @NonNull AnimationsValueChangeListener updateListener, int maxAnimationFps) { super(values, updateListener, maxAnimationFps); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreLatLngAnimator.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreLatLngAnimator.java new file mode 100644 index 000000000..9abdeafe5 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/MapLibreLatLngAnimator.java @@ -0,0 +1,21 @@ +package org.maplibre.android.location; + +import android.animation.TypeEvaluator; + +import androidx.annotation.NonNull; + +import org.maplibre.android.geometry.LatLng; + +class MapLibreLatLngAnimator extends MapLibreAnimator { + + MapLibreLatLngAnimator(@NonNull LatLng[] values, @NonNull AnimationsValueChangeListener updateListener, + int maxAnimationFps) { + super(values, updateListener, maxAnimationFps); + } + + @NonNull + @Override + TypeEvaluator provideEvaluator() { + return new LatLngEvaluator(); + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnCameraMoveInvalidateListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnCameraMoveInvalidateListener.java similarity index 67% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnCameraMoveInvalidateListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnCameraMoveInvalidateListener.java index 6594e543f..57ea614fd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnCameraMoveInvalidateListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnCameraMoveInvalidateListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; interface OnCameraMoveInvalidateListener { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnCameraTrackingChangedListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnCameraTrackingChangedListener.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnCameraTrackingChangedListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnCameraTrackingChangedListener.java index 1ea80d26a..e72997e93 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnCameraTrackingChangedListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnCameraTrackingChangedListener.java @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; -import com.mapbox.mapboxsdk.location.modes.CameraMode; +import org.maplibre.android.location.modes.CameraMode; /** * Listener that gets invoked when camera tracking state changes. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationCameraTransitionListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationCameraTransitionListener.java similarity index 88% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationCameraTransitionListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationCameraTransitionListener.java index 824432efc..7839a2b4d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationCameraTransitionListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationCameraTransitionListener.java @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; -import com.mapbox.mapboxsdk.location.modes.CameraMode; +import org.maplibre.android.location.modes.CameraMode; /** * Callback for {@link CameraMode } transition state. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationClickListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationClickListener.java similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationClickListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationClickListener.java index fdd2aeb81..0fbb9cddf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationClickListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationClickListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; /** * The Location Component exposes an API for listening to when the user clicks on the location diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationLongClickListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationLongClickListener.java similarity index 91% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationLongClickListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationLongClickListener.java index 0c34614f3..ac048538d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationLongClickListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationLongClickListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; /** * The Location Component exposes an API for listening to when the user long clicks on the location diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationStaleListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationStaleListener.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationStaleListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationStaleListener.java index 6bbe7f34b..e85bacb25 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnLocationStaleListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnLocationStaleListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; /** * Listener that can be added as a callback when the last location update diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnRenderModeChangedListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnRenderModeChangedListener.java similarity index 76% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnRenderModeChangedListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnRenderModeChangedListener.java index 12ac220c5..d16935c69 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/OnRenderModeChangedListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/OnRenderModeChangedListener.java @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; -import com.mapbox.mapboxsdk.location.modes.RenderMode; +import org.maplibre.android.location.modes.RenderMode; /** * Listener that gets invoked when layer render mode changes. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/PulsingLocationCircleAnimator.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/PulsingLocationCircleAnimator.java similarity index 86% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/PulsingLocationCircleAnimator.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/PulsingLocationCircleAnimator.java index 1f09f6c4d..9ac800e69 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/PulsingLocationCircleAnimator.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/PulsingLocationCircleAnimator.java @@ -1,9 +1,9 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; /** * Manages the logic of the interpolated animation which is applied to the LocationComponent's pulsing circle */ -public class PulsingLocationCircleAnimator extends MapboxFloatAnimator { +public class PulsingLocationCircleAnimator extends MapLibreFloatAnimator { /** * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/StaleStateManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/StaleStateManager.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/StaleStateManager.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/StaleStateManager.java index f957a715c..07d911c08 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/StaleStateManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/StaleStateManager.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.os.Handler; import android.os.Message; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/SymbolLocationLayerRenderer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/SymbolLocationLayerRenderer.java similarity index 79% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/SymbolLocationLayerRenderer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/SymbolLocationLayerRenderer.java index bd6151617..1c6cfe161 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/SymbolLocationLayerRenderer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/SymbolLocationLayerRenderer.java @@ -1,4 +1,43 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; + +import static org.maplibre.android.location.LocationComponentConstants.ACCURACY_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.BACKGROUND_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BEARING_ICON; +import static org.maplibre.android.location.LocationComponentConstants.BEARING_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.FOREGROUND_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.LOCATION_SOURCE; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_ACCURACY_ALPHA; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_ACCURACY_COLOR; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_ACCURACY_RADIUS; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_BACKGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_BACKGROUND_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_BEARING_ICON; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_COMPASS_BEARING; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_FOREGROUND_ICON; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_FOREGROUND_ICON_OFFSET; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_FOREGROUND_STALE_ICON; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_GPS_BEARING; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_LOCATION_STALE; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_PULSING_OPACITY; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_PULSING_RADIUS; +import static org.maplibre.android.location.LocationComponentConstants.PROPERTY_SHADOW_ICON_OFFSET; +import static org.maplibre.android.location.LocationComponentConstants.PULSING_CIRCLE_LAYER; +import static org.maplibre.android.location.LocationComponentConstants.SHADOW_ICON; +import static org.maplibre.android.location.LocationComponentConstants.SHADOW_LAYER; +import static org.maplibre.android.style.expressions.Expression.get; +import static org.maplibre.android.style.layers.Property.NONE; +import static org.maplibre.android.style.layers.Property.VISIBLE; +import static org.maplibre.android.style.layers.PropertyFactory.circleColor; +import static org.maplibre.android.style.layers.PropertyFactory.circleOpacity; +import static org.maplibre.android.style.layers.PropertyFactory.circleRadius; +import static org.maplibre.android.style.layers.PropertyFactory.circleStrokeColor; +import static org.maplibre.android.style.layers.PropertyFactory.iconSize; +import static org.maplibre.android.style.layers.PropertyFactory.visibility; +import static org.maplibre.android.utils.ColorUtils.colorToRgbaString; import android.graphics.Bitmap; @@ -9,55 +48,17 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.mapbox.geojson.Feature; import com.mapbox.geojson.Point; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.location.modes.RenderMode; -import com.mapbox.mapboxsdk.maps.Style; -import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.style.layers.SymbolLayer; -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource; + +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.location.modes.RenderMode; +import org.maplibre.android.maps.Style; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.style.layers.SymbolLayer; +import org.maplibre.android.style.sources.GeoJsonSource; import java.util.Set; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.ACCURACY_LAYER; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_LAYER; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BACKGROUND_STALE_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.BEARING_LAYER; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_ICON; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_LAYER; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.FOREGROUND_STALE_ICON; -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_PULSING_OPACITY; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.PROPERTY_PULSING_RADIUS; -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.layers.Property.NONE; -import static com.mapbox.mapboxsdk.style.layers.Property.VISIBLE; -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.circleRadius; -import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.circleStrokeColor; -import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconSize; -import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.visibility; -import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaString; - final class SymbolLocationLayerRenderer implements LocationLayerRenderer { private Style style; private final LayerSourceProvider layerSourceProvider; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/Utils.java similarity index 88% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/Utils.java index d0b7fadb0..f9da16be3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/Utils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location; +package org.maplibre.android.location; import android.graphics.Bitmap; import android.graphics.Canvas; @@ -11,12 +11,12 @@ import android.os.Build; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.maps.Projection; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.log.Logger; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.maps.Projection; -import static com.mapbox.mapboxsdk.location.LocationComponentConstants.INSTANT_LOCATION_TRANSITION_THRESHOLD; +import static org.maplibre.android.location.LocationComponentConstants.INSTANT_LOCATION_TRANSITION_THRESHOLD; public final class Utils { @@ -95,11 +95,11 @@ public final class Utils { } } - static float calculateZoomLevelRadius(@NonNull MapboxMap mapboxMap, @Nullable Location location) { + static float calculateZoomLevelRadius(@NonNull MapLibreMap maplibreMap, @Nullable Location location) { if (location == null) { return 0; } - double metersPerPixel = mapboxMap.getProjection().getMetersPerPixelAtLatitude(location.getLatitude()); + double metersPerPixel = maplibreMap.getProjection().getMetersPerPixelAtLatitude(location.getLatitude()); return (float) (location.getAccuracy() * (1 / metersPerPixel)); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/AndroidLocationEngineImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/AndroidLocationEngineImpl.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/AndroidLocationEngineImpl.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/AndroidLocationEngineImpl.java index fed2712d0..dca738c6f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/AndroidLocationEngineImpl.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/AndroidLocationEngineImpl.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import android.annotation.SuppressLint; import android.app.PendingIntent; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngine.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngine.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngine.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngine.java index cec293145..93706341e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngine.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngine.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import android.app.PendingIntent; import android.os.Looper; @@ -12,7 +12,7 @@ import static android.Manifest.permission.ACCESS_FINE_LOCATION; /** * Generic location engine interface wrapper for the location providers. - * Default providers bundled with Mapbox location library: + * Default providers bundled with MapLibre location library: * Android location provider and Google Play Services fused location provider * * @since 1.0.0 diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineCallback.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineCallback.java similarity index 91% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineCallback.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineCallback.java index b2562bae3..ec38d83df 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineCallback.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineCallback.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import androidx.annotation.NonNull; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineDefault.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineDefault.kt similarity index 51% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineDefault.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineDefault.kt index a9be77ec1..4c166f6c6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineDefault.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineDefault.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine +package org.maplibre.android.location.engine import android.content.Context @@ -7,6 +7,10 @@ object LocationEngineDefault { * Returns the default `LocationEngine`. */ fun getDefaultLocationEngine(context: Context): LocationEngine { - return LocationEngineProxy(MapboxFusedLocationEngineImpl(context.applicationContext)) + return LocationEngineProxy( + MapLibreFusedLocationEngineImpl( + context.applicationContext + ) + ) } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineImpl.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineImpl.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineImpl.java index 1157ef7b2..faec74a5c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineImpl.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineImpl.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import android.app.PendingIntent; import android.os.Looper; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineProxy.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineProxy.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineProxy.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineProxy.java index e4eac6180..4943e9589 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineProxy.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineProxy.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import android.app.PendingIntent; import android.os.Looper; @@ -10,7 +10,7 @@ import androidx.annotation.VisibleForTesting; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import static com.mapbox.mapboxsdk.location.engine.Utils.checkNotNull; +import static org.maplibre.android.location.engine.Utils.checkNotNull; public class LocationEngineProxy implements LocationEngine { private final LocationEngineImpl locationEngineImpl; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineRequest.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineRequest.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineRequest.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineRequest.java index 09631fa03..c7f8d8359 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineRequest.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineRequest.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; /** * Data model that contains parameters for location diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineResult.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineResult.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineResult.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineResult.java index e77bc1fca..45aecf6a7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/LocationEngineResult.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/LocationEngineResult.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import android.content.Intent; import android.location.Location; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/MapboxFusedLocationEngineImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/MapLibreFusedLocationEngineImpl.java similarity index 85% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/MapboxFusedLocationEngineImpl.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/MapLibreFusedLocationEngineImpl.java index 1f89fe357..cd5bd32d5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/MapboxFusedLocationEngineImpl.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/MapLibreFusedLocationEngineImpl.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import android.annotation.SuppressLint; import android.app.PendingIntent; @@ -13,24 +13,24 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import timber.log.Timber; -import static com.mapbox.mapboxsdk.location.engine.Utils.isBetterLocation; +import static org.maplibre.android.location.engine.Utils.isBetterLocation; /** - * Mapbox replacement for Google Play Services Fused Location Client + * MapLibre replacement for Google Play Services Fused Location Client *

* Note: fusion will not work in background mode. */ -public class MapboxFusedLocationEngineImpl extends AndroidLocationEngineImpl { - private static final String TAG = "MapboxLocationEngine"; +public class MapLibreFusedLocationEngineImpl extends AndroidLocationEngineImpl { + private static final String TAG = "MapLibreLocationEngine"; - public MapboxFusedLocationEngineImpl(@NonNull Context context) { + public MapLibreFusedLocationEngineImpl(@NonNull Context context) { super(context); } @NonNull @Override public LocationListener createListener(LocationEngineCallback callback) { - return new MapboxLocationEngineCallbackTransport(callback); + return new MapLibreLocationEngineCallbackTransport(callback); } @Override @@ -100,11 +100,11 @@ public class MapboxFusedLocationEngineImpl extends AndroidLocationEngineImpl { && currentProvider.equals(LocationManager.GPS_PROVIDER); } - private static final class MapboxLocationEngineCallbackTransport implements LocationListener { + private static final class MapLibreLocationEngineCallbackTransport implements LocationListener { private final LocationEngineCallback callback; private Location currentBestLocation; - MapboxLocationEngineCallbackTransport(LocationEngineCallback callback) { + MapLibreLocationEngineCallbackTransport(LocationEngineCallback callback) { this.callback = callback; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/Utils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/Utils.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/Utils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/Utils.java index 7160d4543..6d7a8515d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/engine/Utils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/engine/Utils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.engine; +package org.maplibre.android.location.engine; import android.location.Location; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/CameraMode.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/CameraMode.java similarity index 93% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/CameraMode.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/CameraMode.java index f86fb7605..96e51ec15 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/CameraMode.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/CameraMode.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.location.modes; +package org.maplibre.android.location.modes; import android.location.Location; import androidx.annotation.IntDef; -import com.mapbox.mapboxsdk.location.LocationComponent; +import org.maplibre.android.location.LocationComponent; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/RenderMode.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/RenderMode.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/RenderMode.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/RenderMode.java index fbb17d224..e9a6041d4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/modes/RenderMode.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/RenderMode.java @@ -1,9 +1,9 @@ -package com.mapbox.mapboxsdk.location.modes; +package org.maplibre.android.location.modes; import androidx.annotation.IntDef; -import com.mapbox.mapboxsdk.location.CompassEngine; -import com.mapbox.mapboxsdk.location.LocationComponent; +import org.maplibre.android.location.CompassEngine; +import org.maplibre.android.location.LocationComponent; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/package-info.java new file mode 100644 index 000000000..0a28bf620 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/modes/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Location layer component camera and render modes. + */ +package org.maplibre.android.location.modes; \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/package-info.java new file mode 100644 index 000000000..39f751a05 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Location layer component. + */ +package org.maplibre.android.location; \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/permissions/PermissionsListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/permissions/PermissionsListener.java similarity index 81% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/permissions/PermissionsListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/permissions/PermissionsListener.java index c525bd7da..24854ab87 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/permissions/PermissionsListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/permissions/PermissionsListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.permissions; +package org.maplibre.android.location.permissions; import java.util.List; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/permissions/PermissionsManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/permissions/PermissionsManager.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/permissions/PermissionsManager.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/permissions/PermissionsManager.java index 2c8f19751..11f99f845 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/permissions/PermissionsManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/permissions/PermissionsManager.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.location.permissions; +package org.maplibre.android.location.permissions; import android.Manifest; import android.app.Activity; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/Logger.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/Logger.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/Logger.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/Logger.java index 12d2989dc..4e6a8db50 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/Logger.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/Logger.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.log; +package org.maplibre.android.log; import android.util.Log; @@ -10,7 +10,7 @@ import java.lang.annotation.RetentionPolicy; /** - * Logger for the Mapbox Maps SDK for Android + * Logger for the MapLibre Maps SDK for Android *

* Default implementation relies on {@link Log}. * Alternative implementations can be set with {@link #setLoggerDefinition(LoggerDefinition)}. @@ -81,7 +81,7 @@ public final class Logger { * Set the verbosity of the Logger. *

* This configuration can be used to have more granular control over which logs are emitted by the - * Mapbox Maps SDK for Android. + * MapLibre Maps SDK for Android. *

* * @param logLevel the verbosity level @@ -313,7 +313,7 @@ public final class Logger { public static final int NONE = 99; /** - * Log level indicates which logs are allowed to be emitted by the Mapbox Maps SDK for Android. + * Log level indicates which logs are allowed to be emitted by the MapLibre Maps SDK for Android. */ @IntDef( {VERBOSE, DEBUG, INFO, WARN, ERROR, NONE}) @Retention(RetentionPolicy.SOURCE) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/LoggerDefinition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/LoggerDefinition.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/LoggerDefinition.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/LoggerDefinition.java index 60b6eb000..b9adca36a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/log/LoggerDefinition.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/LoggerDefinition.java @@ -1,7 +1,7 @@ -package com.mapbox.mapboxsdk.log; +package org.maplibre.android.log; /** - * Definition of a logger for the Mapbox Maps SDK for Android. + * Definition of a logger for the MapLibre Maps SDK for Android. */ public interface LoggerDefinition { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/package-info.java new file mode 100644 index 000000000..f5e93483b --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/log/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Log API classes. + */ +package org.maplibre.android.log; \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AnnotationContainer.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AnnotationContainer.java index d27bcdf2e..606c561fd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationContainer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AnnotationContainer.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.NonNull; import androidx.collection.LongSparseArray; -import com.mapbox.mapboxsdk.annotations.Annotation; +import org.maplibre.android.annotations.Annotation; import java.util.ArrayList; import java.util.List; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AnnotationManager.java similarity index 83% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AnnotationManager.java index c1983f310..3f8bbcbc3 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AnnotationManager.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.Bitmap; import android.graphics.PointF; @@ -10,23 +10,23 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.collection.LongSparseArray; -import com.mapbox.mapboxsdk.Mapbox; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.annotations.Annotation; -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions; -import com.mapbox.mapboxsdk.annotations.Marker; -import com.mapbox.mapboxsdk.annotations.Polygon; -import com.mapbox.mapboxsdk.annotations.PolygonOptions; -import com.mapbox.mapboxsdk.annotations.Polyline; -import com.mapbox.mapboxsdk.annotations.PolylineOptions; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.MapLibre; +import org.maplibre.android.R; +import org.maplibre.android.annotations.Annotation; +import org.maplibre.android.annotations.BaseMarkerOptions; +import org.maplibre.android.annotations.Marker; +import org.maplibre.android.annotations.Polygon; +import org.maplibre.android.annotations.PolygonOptions; +import org.maplibre.android.annotations.Polyline; +import org.maplibre.android.annotations.PolylineOptions; +import org.maplibre.android.log.Logger; import java.util.ArrayList; import java.util.List; /** * Responsible for managing and tracking state of Annotations linked to Map. All events related to - * annotations that occur on {@link MapboxMap} are forwarded to this class. + * annotations that occur on {@link MapLibreMap} are forwarded to this class. *

* Responsible for referencing {@link InfoWindowManager}. *

@@ -48,13 +48,13 @@ class AnnotationManager { private final LongSparseArray annotationsArray; private final List selectedMarkers = new ArrayList<>(); - private MapboxMap mapboxMap; + private MapLibreMap maplibreMap; @Nullable - private MapboxMap.OnMarkerClickListener onMarkerClickListener; + private MapLibreMap.OnMarkerClickListener onMarkerClickListener; @Nullable - private MapboxMap.OnPolygonClickListener onPolygonClickListener; + private MapLibreMap.OnPolygonClickListener onPolygonClickListener; @Nullable - private MapboxMap.OnPolylineClickListener onPolylineClickListener; + private MapLibreMap.OnPolylineClickListener onPolylineClickListener; private Annotations annotations; private ShapeAnnotations shapeAnnotations; @@ -78,8 +78,8 @@ class AnnotationManager { // TODO refactor MapboxMap out for Projection and Transform // Requires removing MapboxMap from Annotations by using Peer model from #6912 @NonNull - AnnotationManager bind(MapboxMap mapboxMap) { - this.mapboxMap = mapboxMap; + AnnotationManager bind(MapLibreMap maplibreMap) { + this.maplibreMap = maplibreMap; return this; } @@ -151,20 +151,21 @@ class AnnotationManager { // Markers // - Marker addMarker(@NonNull BaseMarkerOptions markerOptions, @NonNull MapboxMap mapboxMap) { - return markers.addBy(markerOptions, mapboxMap); + Marker addMarker(@NonNull BaseMarkerOptions markerOptions, @NonNull MapLibreMap maplibreMap) { + return markers.addBy(markerOptions, maplibreMap); } - List addMarkers(@NonNull List markerOptionsList, @NonNull MapboxMap mapboxMap) { - return markers.addBy(markerOptionsList, mapboxMap); + List addMarkers(@NonNull List markerOptionsList, + @NonNull MapLibreMap maplibreMap) { + return markers.addBy(markerOptionsList, maplibreMap); } - void updateMarker(@NonNull Marker updatedMarker, @NonNull MapboxMap mapboxMap) { + void updateMarker(@NonNull Marker updatedMarker, @NonNull MapLibreMap maplibreMap) { if (!isAddedToMap(updatedMarker)) { logNonAdded(updatedMarker); return; } - markers.update(updatedMarker, mapboxMap); + markers.update(updatedMarker, maplibreMap); } List getMarkers() { @@ -184,12 +185,12 @@ class AnnotationManager { // Polygons // - Polygon addPolygon(@NonNull PolygonOptions polygonOptions, @NonNull MapboxMap mapboxMap) { - return polygons.addBy(polygonOptions, mapboxMap); + Polygon addPolygon(@NonNull PolygonOptions polygonOptions, @NonNull MapLibreMap maplibreMap) { + return polygons.addBy(polygonOptions, maplibreMap); } - List addPolygons(@NonNull List polygonOptionsList, @NonNull MapboxMap mapboxMap) { - return polygons.addBy(polygonOptionsList, mapboxMap); + List addPolygons(@NonNull List polygonOptionsList, @NonNull MapLibreMap maplibreMap) { + return polygons.addBy(polygonOptionsList, maplibreMap); } void updatePolygon(@NonNull Polygon polygon) { @@ -208,12 +209,12 @@ class AnnotationManager { // Polylines // - Polyline addPolyline(@NonNull PolylineOptions polylineOptions, @NonNull MapboxMap mapboxMap) { - return polylines.addBy(polylineOptions, mapboxMap); + Polyline addPolyline(@NonNull PolylineOptions polylineOptions, @NonNull MapLibreMap maplibreMap) { + return polylines.addBy(polylineOptions, maplibreMap); } - List addPolylines(@NonNull List polylineOptionsList, @NonNull MapboxMap mapboxMap) { - return polylines.addBy(polylineOptionsList, mapboxMap); + List addPolylines(@NonNull List polylineOptionsList, @NonNull MapLibreMap maplibreMap) { + return polylines.addBy(polylineOptionsList, maplibreMap); } void updatePolyline(@NonNull Polyline polyline) { @@ -229,15 +230,15 @@ class AnnotationManager { } // TODO Refactor from here still in progress - void setOnMarkerClickListener(@Nullable MapboxMap.OnMarkerClickListener listener) { + void setOnMarkerClickListener(@Nullable MapLibreMap.OnMarkerClickListener listener) { onMarkerClickListener = listener; } - void setOnPolygonClickListener(@Nullable MapboxMap.OnPolygonClickListener listener) { + void setOnPolygonClickListener(@Nullable MapLibreMap.OnPolygonClickListener listener) { onPolygonClickListener = listener; } - void setOnPolylineClickListener(@Nullable MapboxMap.OnPolylineClickListener listener) { + void setOnPolylineClickListener(@Nullable MapLibreMap.OnPolylineClickListener listener) { onPolylineClickListener = listener; } @@ -252,7 +253,7 @@ class AnnotationManager { } if (infoWindowManager.isInfoWindowValidForMarker(marker) || infoWindowManager.getInfoWindowAdapter() != null) { - infoWindowManager.add(marker.showInfoWindow(mapboxMap, mapView)); + infoWindowManager.add(marker.showInfoWindow(maplibreMap, mapView)); } // only add to selected markers if user didn't handle the click event themselves #3176 @@ -297,7 +298,7 @@ class AnnotationManager { return infoWindowManager; } - void adjustTopOffsetPixels(@NonNull MapboxMap mapboxMap) { + void adjustTopOffsetPixels(@NonNull MapLibreMap maplibreMap) { int count = annotationsArray.size(); for (int i = 0; i < count; i++) { Annotation annotation = annotationsArray.get(i); @@ -311,7 +312,7 @@ class AnnotationManager { for (Marker marker : selectedMarkers) { if (marker.isInfoWindowShown()) { marker.hideInfoWindow(); - marker.showInfoWindow(mapboxMap, mapView); + marker.showInfoWindow(maplibreMap, mapView); } } } @@ -332,7 +333,7 @@ class AnnotationManager { boolean onTap(@NonNull PointF tapPoint) { MarkerHit markerHit = getMarkerHitFromTouchArea(tapPoint); - long markerId = new MarkerHitResolver(mapboxMap).execute(markerHit); + long markerId = new MarkerHitResolver(maplibreMap).execute(markerHit); if (markerId != NO_ANNOTATION_ID) { if (isClickHandledForMarker(markerId)) { return true; @@ -345,7 +346,7 @@ class AnnotationManager { } private ShapeAnnotationHit getShapeAnnotationHitFromTap(PointF tapPoint) { - float touchTargetSide = Mapbox.getApplicationContext().getResources().getDimension(R.dimen.maplibre_eight_dp); + float touchTargetSide = MapLibre.getApplicationContext().getResources().getDimension(R.dimen.maplibre_eight_dp); RectF tapRect = new RectF( tapPoint.x - touchTargetSide, tapPoint.y - touchTargetSide, @@ -440,9 +441,9 @@ class AnnotationManager { private long closestMarkerId = NO_ANNOTATION_ID; - MarkerHitResolver(@NonNull MapboxMap mapboxMap) { - this.projection = mapboxMap.getProjection(); - this.minimalTouchSize = (int) (32 * Mapbox.getApplicationContext().getResources().getDisplayMetrics().density); + MarkerHitResolver(@NonNull MapLibreMap maplibreMap) { + this.projection = maplibreMap.getProjection(); + this.minimalTouchSize = (int) (32 * MapLibre.getApplicationContext().getResources().getDisplayMetrics().density); } public long execute(@NonNull MarkerHit markerHit) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Annotations.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Annotations.java similarity index 83% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Annotations.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Annotations.java index 980425c0c..986ad2ad2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Annotations.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Annotations.java @@ -1,9 +1,9 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.annotations.Annotation; +import org.maplibre.android.annotations.Annotation; import java.util.List; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AttributionDialogManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AttributionDialogManager.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AttributionDialogManager.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AttributionDialogManager.java index df683b1b4..129fe10d5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AttributionDialogManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/AttributionDialogManager.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.app.Activity; import android.app.AlertDialog; @@ -14,13 +14,13 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.Mapbox; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.attribution.Attribution; -import com.mapbox.mapboxsdk.attribution.AttributionParser; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.style.sources.Source; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.MapLibre; +import org.maplibre.android.R; +import org.maplibre.android.attribution.Attribution; +import org.maplibre.android.attribution.AttributionParser; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.style.sources.Source; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -47,19 +47,19 @@ public class AttributionDialogManager implements View.OnClickListener, DialogInt @NonNull private final Context context; @NonNull - private final MapboxMap mapboxMap; + private final MapLibreMap maplibreMap; private Set attributionSet; private AlertDialog dialog; - public AttributionDialogManager(@NonNull Context context, @NonNull MapboxMap mapboxMap) { + public AttributionDialogManager(@NonNull Context context, @NonNull MapLibreMap maplibreMap) { this.context = context; - this.mapboxMap = mapboxMap; + this.maplibreMap = maplibreMap; } // Called when someone presses the attribution icon on the map @Override public void onClick(@NonNull View view) { - attributionSet = new AttributionBuilder(mapboxMap, view.getContext()).build(); + attributionSet = new AttributionBuilder(maplibreMap, view.getContext()).build(); boolean isActivityFinishing = false; if (context instanceof Activity) { @@ -108,7 +108,7 @@ public class AttributionDialogManager implements View.OnClickListener, DialogInt Attribution[] attributions = attributionSet.toArray(new Attribution[attributionSet.size()]); String url = attributions[which].getUrl(); if (url.contains(MAP_FEEDBACK_URL_OLD) || url.contains(MAP_FEEDBACK_URL)) { - url = buildMapFeedbackMapUrl(Mapbox.getApiKey()); + url = buildMapFeedbackMapUrl(MapLibre.getApiKey()); } showWebPage(url); } @@ -120,7 +120,7 @@ public class AttributionDialogManager implements View.OnClickListener, DialogInt Uri.Builder builder = Uri.parse(MAP_FEEDBACK_URL).buildUpon(); - CameraPosition cameraPosition = mapboxMap.getCameraPosition(); + CameraPosition cameraPosition = maplibreMap.getCameraPosition(); if (cameraPosition != null) { builder.encodedFragment(String.format(Locale.getDefault(), MAP_FEEDBACK_URL_LOCATION_FRAGMENT_FORMAT, cameraPosition.target.getLongitude(), cameraPosition.target.getLatitude(), @@ -137,7 +137,7 @@ public class AttributionDialogManager implements View.OnClickListener, DialogInt builder.appendQueryParameter("access_token", apiKey); } - Style style = mapboxMap.getStyle(); + Style style = maplibreMap.getStyle(); if (style != null) { String styleUri = style.getUri(); Pattern pattern = Pattern.compile(MAP_FEEDBACK_STYLE_URI_REGEX); @@ -169,12 +169,12 @@ public class AttributionDialogManager implements View.OnClickListener, DialogInt private static class AttributionBuilder { - private final MapboxMap mapboxMap; + private final MapLibreMap maplibreMap; @NonNull private final WeakReference context; - AttributionBuilder(MapboxMap mapboxMap, Context context) { - this.mapboxMap = mapboxMap; + AttributionBuilder(MapLibreMap maplibreMap, Context context) { + this.maplibreMap = maplibreMap; this.context = new WeakReference<>(context); } @@ -187,7 +187,7 @@ public class AttributionDialogManager implements View.OnClickListener, DialogInt List attributions = new ArrayList<>(); String attribution; - Style style = mapboxMap.getStyle(); + Style style = maplibreMap.getStyle(); if (style != null) { for (Source source : style.getSources()) { attribution = source.getAttribution(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/CameraChangeDispatcher.java similarity index 91% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/CameraChangeDispatcher.java index a9a05843c..a366a0ebd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/CameraChangeDispatcher.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.os.Handler; import android.os.Message; @@ -10,17 +10,17 @@ import java.lang.annotation.Retention; import java.lang.ref.WeakReference; import java.util.concurrent.CopyOnWriteArrayList; -import static com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraIdleListener; -import static com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraMoveCanceledListener; -import static com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraMoveListener; -import static com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraMoveStartedListener; +import static org.maplibre.android.maps.MapLibreMap.OnCameraIdleListener; +import static org.maplibre.android.maps.MapLibreMap.OnCameraMoveCanceledListener; +import static org.maplibre.android.maps.MapLibreMap.OnCameraMoveListener; +import static org.maplibre.android.maps.MapLibreMap.OnCameraMoveStartedListener; import static java.lang.annotation.RetentionPolicy.SOURCE; /** * Class responsible for dispatching camera change events to registered listeners. */ -class CameraChangeDispatcher implements MapboxMap.OnCameraMoveStartedListener, MapboxMap.OnCameraMoveListener, - MapboxMap.OnCameraMoveCanceledListener, OnCameraIdleListener { +class CameraChangeDispatcher implements MapLibreMap.OnCameraMoveStartedListener, MapLibreMap.OnCameraMoveListener, + MapLibreMap.OnCameraMoveCanceledListener, OnCameraIdleListener { private final CameraChangeHandler handler = new CameraChangeHandler(this); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/FocalPointChangeListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/FocalPointChangeListener.java similarity index 86% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/FocalPointChangeListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/FocalPointChangeListener.java index aec9a848b..b9cb55db8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/FocalPointChangeListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/FocalPointChangeListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.PointF; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/IconManager.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/IconManager.java index 6bda7752c..11e449bfc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/IconManager.java @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.Bitmap; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.Mapbox; -import com.mapbox.mapboxsdk.annotations.Icon; -import com.mapbox.mapboxsdk.annotations.IconFactory; -import com.mapbox.mapboxsdk.annotations.Marker; +import org.maplibre.android.MapLibre; +import org.maplibre.android.annotations.Icon; +import org.maplibre.android.annotations.IconFactory; +import org.maplibre.android.annotations.Marker; import java.util.HashMap; import java.util.List; @@ -60,7 +60,7 @@ class IconManager { } private Icon loadDefaultIconForMarker(Marker marker) { - Icon icon = IconFactory.getInstance(Mapbox.getApplicationContext()).defaultMarker(); + Icon icon = IconFactory.getInstance(MapLibre.getApplicationContext()).defaultMarker(); Bitmap bitmap = icon.getBitmap(); updateHighestIconSize(bitmap.getWidth(), bitmap.getHeight() / 2); marker.setIcon(icon); @@ -115,18 +115,18 @@ class IconManager { } } - void ensureIconLoaded(@NonNull Marker marker, @NonNull MapboxMap mapboxMap) { + void ensureIconLoaded(@NonNull Marker marker, @NonNull MapLibreMap maplibreMap) { Icon icon = marker.getIcon(); if (icon == null) { icon = loadDefaultIconForMarker(marker); } addIcon(icon); - setTopOffsetPixels(marker, mapboxMap, icon); + setTopOffsetPixels(marker, maplibreMap, icon); } - private void setTopOffsetPixels(Marker marker, @NonNull MapboxMap mapboxMap, @NonNull Icon icon) { + private void setTopOffsetPixels(Marker marker, @NonNull MapLibreMap maplibreMap, @NonNull Icon icon) { // this seems to be a costly operation according to the profiler so I'm trying to save some calls - Marker previousMarker = marker.getId() != -1 ? (Marker) mapboxMap.getAnnotation(marker.getId()) : null; + Marker previousMarker = marker.getId() != -1 ? (Marker) maplibreMap.getAnnotation(marker.getId()) : null; if (previousMarker == null || previousMarker.getIcon() == null || previousMarker.getIcon() != marker.getIcon()) { marker.setTopOffsetPixels(getTopOffsetPixelsForIcon(icon)); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Image.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Image.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Image.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Image.java index 8a648de31..627ca482e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Image.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Image.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.Keep; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ImageContent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ImageContent.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ImageContent.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ImageContent.java index 4b72280c4..b97dd4ed5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ImageContent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ImageContent.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; /** * Describes the image content, e.g. where text can be fit into an image. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ImageStretches.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ImageStretches.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ImageStretches.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ImageStretches.java index ec3357167..48f456c69 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ImageStretches.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ImageStretches.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; /** diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/InfoWindowManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/InfoWindowManager.java similarity index 57% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/InfoWindowManager.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/InfoWindowManager.java index 3527a39ae..39607e487 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/InfoWindowManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/InfoWindowManager.java @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.text.TextUtils; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.annotations.InfoWindow; -import com.mapbox.mapboxsdk.annotations.Marker; +import org.maplibre.android.annotations.InfoWindow; +import org.maplibre.android.annotations.Marker; import java.util.ArrayList; import java.util.List; @@ -16,8 +16,8 @@ import java.util.List; * Maintains a {@link List} of opened {@link InfoWindow} and tracks configurations as * allowConcurrentMultipleInfoWindows which allows to have multiple {@link InfoWindow} open at the * same time. Responsible for managing listeners as - * {@link com.mapbox.mapboxsdk.maps.MapboxMap.OnInfoWindowClickListener} and - * {@link com.mapbox.mapboxsdk.maps.MapboxMap.OnInfoWindowLongClickListener}. + * {@link MapLibreMap.OnInfoWindowClickListener} and + * {@link MapLibreMap.OnInfoWindowLongClickListener}. *

*/ class InfoWindowManager { @@ -25,15 +25,15 @@ class InfoWindowManager { private final List infoWindows = new ArrayList<>(); @Nullable - private MapboxMap.InfoWindowAdapter infoWindowAdapter; + private MapLibreMap.InfoWindowAdapter infoWindowAdapter; private boolean allowConcurrentMultipleInfoWindows; @Nullable - private MapboxMap.OnInfoWindowClickListener onInfoWindowClickListener; + private MapLibreMap.OnInfoWindowClickListener onInfoWindowClickListener; @Nullable - private MapboxMap.OnInfoWindowLongClickListener onInfoWindowLongClickListener; + private MapLibreMap.OnInfoWindowLongClickListener onInfoWindowLongClickListener; @Nullable - private MapboxMap.OnInfoWindowCloseListener onInfoWindowCloseListener; + private MapLibreMap.OnInfoWindowCloseListener onInfoWindowCloseListener; void update() { if (!infoWindows.isEmpty()) { @@ -43,12 +43,12 @@ class InfoWindowManager { } } - void setInfoWindowAdapter(@Nullable MapboxMap.InfoWindowAdapter infoWindowAdapter) { + void setInfoWindowAdapter(@Nullable MapLibreMap.InfoWindowAdapter infoWindowAdapter) { this.infoWindowAdapter = infoWindowAdapter; } @Nullable - MapboxMap.InfoWindowAdapter getInfoWindowAdapter() { + MapLibreMap.InfoWindowAdapter getInfoWindowAdapter() { return infoWindowAdapter; } @@ -64,30 +64,30 @@ class InfoWindowManager { return marker != null && (!TextUtils.isEmpty(marker.getTitle()) || !TextUtils.isEmpty(marker.getSnippet())); } - void setOnInfoWindowClickListener(@Nullable MapboxMap.OnInfoWindowClickListener listener) { + void setOnInfoWindowClickListener(@Nullable MapLibreMap.OnInfoWindowClickListener listener) { onInfoWindowClickListener = listener; } @Nullable - MapboxMap.OnInfoWindowClickListener getOnInfoWindowClickListener() { + MapLibreMap.OnInfoWindowClickListener getOnInfoWindowClickListener() { return onInfoWindowClickListener; } - void setOnInfoWindowLongClickListener(@Nullable MapboxMap.OnInfoWindowLongClickListener listener) { + void setOnInfoWindowLongClickListener(@Nullable MapLibreMap.OnInfoWindowLongClickListener listener) { onInfoWindowLongClickListener = listener; } @Nullable - MapboxMap.OnInfoWindowLongClickListener getOnInfoWindowLongClickListener() { + MapLibreMap.OnInfoWindowLongClickListener getOnInfoWindowLongClickListener() { return onInfoWindowLongClickListener; } - void setOnInfoWindowCloseListener(@Nullable MapboxMap.OnInfoWindowCloseListener listener) { + void setOnInfoWindowCloseListener(@Nullable MapLibreMap.OnInfoWindowCloseListener listener) { onInfoWindowCloseListener = listener; } @Nullable - MapboxMap.OnInfoWindowCloseListener getOnInfoWindowCloseListener() { + MapLibreMap.OnInfoWindowCloseListener getOnInfoWindowCloseListener() { return onInfoWindowCloseListener; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapChangeReceiver.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapChangeReceiver.java index 5932f6fbf..72d4d3e37 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapChangeReceiver.java @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.log.Logger; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapFragment.java similarity index 89% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapFragment.java index 481063fd5..95f85dfbb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapFragment.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.app.Fragment; import android.content.Context; @@ -11,7 +11,7 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.utils.MapFragmentUtils; +import org.maplibre.android.utils.MapFragmentUtils; import java.util.ArrayList; import java.util.List; @@ -34,7 +34,7 @@ public final class MapFragment extends Fragment implements OnMapReadyCallback { private final List mapReadyCallbackList = new ArrayList<>(); private OnMapViewReadyCallback mapViewReadyCallback; - private MapboxMap mapboxMap; + private MapLibreMap maplibreMap; private MapView map; /** @@ -49,13 +49,13 @@ public final class MapFragment extends Fragment implements OnMapReadyCallback { /** * Creates a MapFragment instance * - * @param mapboxMapOptions The configuration options to be used. + * @param maplibreMapOptions The configuration options to be used. * @return MapFragment instantiated. */ @NonNull - public static MapFragment newInstance(@Nullable MapboxMapOptions mapboxMapOptions) { + public static MapFragment newInstance(@Nullable MapLibreMapOptions maplibreMapOptions) { MapFragment mapFragment = new MapFragment(); - mapFragment.setArguments(MapFragmentUtils.createFragmentArgs(mapboxMapOptions)); + mapFragment.setArguments(MapFragmentUtils.createFragmentArgs(maplibreMapOptions)); return mapFragment; } @@ -69,7 +69,7 @@ public final class MapFragment extends Fragment implements OnMapReadyCallback { @Override public void onInflate(@NonNull Context context, AttributeSet attrs, Bundle savedInstanceState) { super.onInflate(context, attrs, savedInstanceState); - setArguments(MapFragmentUtils.createFragmentArgs(MapboxMapOptions.createFromAttributes(context, attrs))); + setArguments(MapFragmentUtils.createFragmentArgs(MapLibreMapOptions.createFromAttributes(context, attrs))); } /** @@ -122,13 +122,13 @@ public final class MapFragment extends Fragment implements OnMapReadyCallback { /** * Called when the style of the map has successfully loaded. * - * @param mapboxMap The public api controller of the map + * @param maplibreMap The public api controller of the map */ @Override - public void onMapReady(@NonNull MapboxMap mapboxMap) { - this.mapboxMap = mapboxMap; + public void onMapReady(@NonNull MapLibreMap maplibreMap) { + this.maplibreMap = maplibreMap; for (OnMapReadyCallback onMapReadyCallback : mapReadyCallbackList) { - onMapReadyCallback.onMapReady(mapboxMap); + onMapReadyCallback.onMapReady(maplibreMap); } } @@ -216,10 +216,10 @@ public final class MapFragment extends Fragment implements OnMapReadyCallback { * @param onMapReadyCallback The callback to be invoked. */ public void getMapAsync(@NonNull final OnMapReadyCallback onMapReadyCallback) { - if (mapboxMap == null) { + if (maplibreMap == null) { mapReadyCallbackList.add(onMapReadyCallback); } else { - onMapReadyCallback.onMapReady(mapboxMap); + onMapReadyCallback.onMapReady(maplibreMap); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapGestureDetector.java similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapGestureDetector.java index 0f59cdf39..6b5e2e756 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapGestureDetector.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -21,9 +21,9 @@ import com.mapbox.android.gestures.RotateGestureDetector; import com.mapbox.android.gestures.ShoveGestureDetector; import com.mapbox.android.gestures.StandardGestureDetector; import com.mapbox.android.gestures.StandardScaleGestureDetector; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.utils.MathUtils; +import org.maplibre.android.R; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.utils.MathUtils; import java.util.ArrayList; import java.util.HashSet; @@ -31,15 +31,15 @@ import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.MAXIMUM_ANGULAR_VELOCITY; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.MAX_ABSOLUTE_SCALE_VELOCITY_CHANGE; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.QUICK_ZOOM_MAX_ZOOM_CHANGE; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.ROTATE_VELOCITY_RATIO_THRESHOLD; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.SCALE_VELOCITY_ANIMATION_DURATION_MULTIPLIER; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.SCALE_VELOCITY_RATIO_THRESHOLD; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.ZOOM_RATE; -import static com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraMoveStartedListener.REASON_API_GESTURE; -import static com.mapbox.mapboxsdk.utils.MathUtils.normalize; +import static org.maplibre.android.constants.MapLibreConstants.MAXIMUM_ANGULAR_VELOCITY; +import static org.maplibre.android.constants.MapLibreConstants.MAX_ABSOLUTE_SCALE_VELOCITY_CHANGE; +import static org.maplibre.android.constants.MapLibreConstants.QUICK_ZOOM_MAX_ZOOM_CHANGE; +import static org.maplibre.android.constants.MapLibreConstants.ROTATE_VELOCITY_RATIO_THRESHOLD; +import static org.maplibre.android.constants.MapLibreConstants.SCALE_VELOCITY_ANIMATION_DURATION_MULTIPLIER; +import static org.maplibre.android.constants.MapLibreConstants.SCALE_VELOCITY_RATIO_THRESHOLD; +import static org.maplibre.android.constants.MapLibreConstants.ZOOM_RATE; +import static org.maplibre.android.maps.MapLibreMap.OnCameraMoveStartedListener.REASON_API_GESTURE; +import static org.maplibre.android.utils.MathUtils.normalize; import timber.log.Timber; @@ -55,25 +55,25 @@ final class MapGestureDetector { private final CameraChangeDispatcher cameraChangeDispatcher; // new map touch API - private final CopyOnWriteArrayList onMapClickListenerList + private final CopyOnWriteArrayList onMapClickListenerList = new CopyOnWriteArrayList<>(); - private final CopyOnWriteArrayList onMapLongClickListenerList + private final CopyOnWriteArrayList onMapLongClickListenerList = new CopyOnWriteArrayList<>(); - private final CopyOnWriteArrayList onFlingListenerList + private final CopyOnWriteArrayList onFlingListenerList = new CopyOnWriteArrayList<>(); - private final CopyOnWriteArrayList onMoveListenerList + private final CopyOnWriteArrayList onMoveListenerList = new CopyOnWriteArrayList<>(); - private final CopyOnWriteArrayList onRotateListenerList + private final CopyOnWriteArrayList onRotateListenerList = new CopyOnWriteArrayList<>(); - private final CopyOnWriteArrayList onScaleListenerList + private final CopyOnWriteArrayList onScaleListenerList = new CopyOnWriteArrayList<>(); - private final CopyOnWriteArrayList onShoveListenerList + private final CopyOnWriteArrayList onShoveListenerList = new CopyOnWriteArrayList<>(); /** @@ -93,7 +93,7 @@ final class MapGestureDetector { /** * Cancels scheduled velocity animations if user doesn't lift fingers within - * {@link MapboxConstants#SCHEDULED_ANIMATION_TIMEOUT} + * {@link MapLibreConstants#SCHEDULED_ANIMATION_TIMEOUT} */ @NonNull private Handler animationsTimeoutHandler = new Handler(); @@ -284,7 +284,7 @@ final class MapGestureDetector { private void scheduleAnimator(Animator animator) { scheduledAnimators.add(animator); animationsTimeoutHandler.removeCallbacksAndMessages(null); - animationsTimeoutHandler.postDelayed(cancelAnimatorsRunnable, MapboxConstants.SCHEDULED_ANIMATION_TIMEOUT); + animationsTimeoutHandler.postDelayed(cancelAnimatorsRunnable, MapLibreConstants.SCHEDULED_ANIMATION_TIMEOUT); } /** @@ -441,7 +441,7 @@ final class MapGestureDetector { if (!uiSettings.isHorizontalScrollGesturesEnabled()) { // determine if angle of fling is valid for performing a vertical fling double angle = Math.abs(Math.toDegrees(Math.atan(offsetX / offsetY))); - if (angle > MapboxConstants.ANGLE_THRESHOLD_IGNORE_VERTICAL_FLING) { + if (angle > MapLibreConstants.ANGLE_THRESHOLD_IGNORE_VERTICAL_FLING) { return false; } offsetX = 0.0; @@ -856,8 +856,8 @@ final class MapGestureDetector { // Get tilt value (scale and clamp) double pitch = transform.getTilt(); - pitch -= MapboxConstants.SHOVE_PIXEL_CHANGE_FACTOR * deltaPixelsSinceLast; - pitch = MathUtils.clamp(pitch, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT); + pitch -= MapLibreConstants.SHOVE_PIXEL_CHANGE_FACTOR * deltaPixelsSinceLast; + pitch = MathUtils.clamp(pitch, MapLibreConstants.MINIMUM_TILT, MapLibreConstants.MAXIMUM_TILT); // Tilt the map transform.setTilt(pitch); @@ -969,7 +969,7 @@ final class MapGestureDetector { currentZoom, zoomIn ? 1 : -1, zoomFocalPoint, - MapboxConstants.ANIMATION_DURATION); + MapLibreConstants.ANIMATION_DURATION); if (runImmediately) { scaleAnimator.start(); } else { @@ -1002,7 +1002,7 @@ final class MapGestureDetector { } void notifyOnMapClickListeners(@NonNull PointF tapPoint) { - for (MapboxMap.OnMapClickListener listener : onMapClickListenerList) { + for (MapLibreMap.OnMapClickListener listener : onMapClickListenerList) { if (listener.onMapClick(projection.fromScreenLocation(tapPoint))) { return; } @@ -1010,7 +1010,7 @@ final class MapGestureDetector { } void notifyOnMapLongClickListeners(@NonNull PointF longClickPoint) { - for (MapboxMap.OnMapLongClickListener listener : onMapLongClickListenerList) { + for (MapLibreMap.OnMapLongClickListener listener : onMapLongClickListenerList) { if (listener.onMapLongClick(projection.fromScreenLocation(longClickPoint))) { return; } @@ -1018,136 +1018,136 @@ final class MapGestureDetector { } void notifyOnFlingListeners() { - for (MapboxMap.OnFlingListener listener : onFlingListenerList) { + for (MapLibreMap.OnFlingListener listener : onFlingListenerList) { listener.onFling(); } } void notifyOnMoveBeginListeners(@NonNull MoveGestureDetector detector) { - for (MapboxMap.OnMoveListener listener : onMoveListenerList) { + for (MapLibreMap.OnMoveListener listener : onMoveListenerList) { listener.onMoveBegin(detector); } } void notifyOnMoveListeners(@NonNull MoveGestureDetector detector) { - for (MapboxMap.OnMoveListener listener : onMoveListenerList) { + for (MapLibreMap.OnMoveListener listener : onMoveListenerList) { listener.onMove(detector); } } void notifyOnMoveEndListeners(@NonNull MoveGestureDetector detector) { - for (MapboxMap.OnMoveListener listener : onMoveListenerList) { + for (MapLibreMap.OnMoveListener listener : onMoveListenerList) { listener.onMoveEnd(detector); } } void notifyOnRotateBeginListeners(@NonNull RotateGestureDetector detector) { - for (MapboxMap.OnRotateListener listener : onRotateListenerList) { + for (MapLibreMap.OnRotateListener listener : onRotateListenerList) { listener.onRotateBegin(detector); } } void notifyOnRotateListeners(@NonNull RotateGestureDetector detector) { - for (MapboxMap.OnRotateListener listener : onRotateListenerList) { + for (MapLibreMap.OnRotateListener listener : onRotateListenerList) { listener.onRotate(detector); } } void notifyOnRotateEndListeners(@NonNull RotateGestureDetector detector) { - for (MapboxMap.OnRotateListener listener : onRotateListenerList) { + for (MapLibreMap.OnRotateListener listener : onRotateListenerList) { listener.onRotateEnd(detector); } } void notifyOnScaleBeginListeners(@NonNull StandardScaleGestureDetector detector) { - for (MapboxMap.OnScaleListener listener : onScaleListenerList) { + for (MapLibreMap.OnScaleListener listener : onScaleListenerList) { listener.onScaleBegin(detector); } } void notifyOnScaleListeners(@NonNull StandardScaleGestureDetector detector) { - for (MapboxMap.OnScaleListener listener : onScaleListenerList) { + for (MapLibreMap.OnScaleListener listener : onScaleListenerList) { listener.onScale(detector); } } void notifyOnScaleEndListeners(@NonNull StandardScaleGestureDetector detector) { - for (MapboxMap.OnScaleListener listener : onScaleListenerList) { + for (MapLibreMap.OnScaleListener listener : onScaleListenerList) { listener.onScaleEnd(detector); } } void notifyOnShoveBeginListeners(@NonNull ShoveGestureDetector detector) { - for (MapboxMap.OnShoveListener listener : onShoveListenerList) { + for (MapLibreMap.OnShoveListener listener : onShoveListenerList) { listener.onShoveBegin(detector); } } void notifyOnShoveListeners(@NonNull ShoveGestureDetector detector) { - for (MapboxMap.OnShoveListener listener : onShoveListenerList) { + for (MapLibreMap.OnShoveListener listener : onShoveListenerList) { listener.onShove(detector); } } void notifyOnShoveEndListeners(@NonNull ShoveGestureDetector detector) { - for (MapboxMap.OnShoveListener listener : onShoveListenerList) { + for (MapLibreMap.OnShoveListener listener : onShoveListenerList) { listener.onShoveEnd(detector); } } - void addOnMapClickListener(MapboxMap.OnMapClickListener onMapClickListener) { + void addOnMapClickListener(MapLibreMap.OnMapClickListener onMapClickListener) { onMapClickListenerList.add(onMapClickListener); } - void removeOnMapClickListener(MapboxMap.OnMapClickListener onMapClickListener) { + void removeOnMapClickListener(MapLibreMap.OnMapClickListener onMapClickListener) { onMapClickListenerList.remove(onMapClickListener); } - void addOnMapLongClickListener(MapboxMap.OnMapLongClickListener onMapLongClickListener) { + void addOnMapLongClickListener(MapLibreMap.OnMapLongClickListener onMapLongClickListener) { onMapLongClickListenerList.add(onMapLongClickListener); } - void removeOnMapLongClickListener(MapboxMap.OnMapLongClickListener onMapLongClickListener) { + void removeOnMapLongClickListener(MapLibreMap.OnMapLongClickListener onMapLongClickListener) { onMapLongClickListenerList.remove(onMapLongClickListener); } - void addOnFlingListener(MapboxMap.OnFlingListener onFlingListener) { + void addOnFlingListener(MapLibreMap.OnFlingListener onFlingListener) { onFlingListenerList.add(onFlingListener); } - void removeOnFlingListener(MapboxMap.OnFlingListener onFlingListener) { + void removeOnFlingListener(MapLibreMap.OnFlingListener onFlingListener) { onFlingListenerList.remove(onFlingListener); } - void addOnMoveListener(MapboxMap.OnMoveListener listener) { + void addOnMoveListener(MapLibreMap.OnMoveListener listener) { onMoveListenerList.add(listener); } - void removeOnMoveListener(MapboxMap.OnMoveListener listener) { + void removeOnMoveListener(MapLibreMap.OnMoveListener listener) { onMoveListenerList.remove(listener); } - void addOnRotateListener(MapboxMap.OnRotateListener listener) { + void addOnRotateListener(MapLibreMap.OnRotateListener listener) { onRotateListenerList.add(listener); } - void removeOnRotateListener(MapboxMap.OnRotateListener listener) { + void removeOnRotateListener(MapLibreMap.OnRotateListener listener) { onRotateListenerList.remove(listener); } - void addOnScaleListener(MapboxMap.OnScaleListener listener) { + void addOnScaleListener(MapLibreMap.OnScaleListener listener) { onScaleListenerList.add(listener); } - void removeOnScaleListener(MapboxMap.OnScaleListener listener) { + void removeOnScaleListener(MapLibreMap.OnScaleListener listener) { onScaleListenerList.remove(listener); } - void addShoveListener(MapboxMap.OnShoveListener listener) { + void addShoveListener(MapLibreMap.OnShoveListener listener) { onShoveListenerList.add(listener); } - void removeShoveListener(MapboxMap.OnShoveListener listener) { + void removeShoveListener(MapLibreMap.OnShoveListener listener) { onShoveListenerList.remove(listener); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapKeyListener.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapKeyListener.java index fbb128d4b..238cce138 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapKeyListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.PointF; import android.os.Handler; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapLibreMap.java similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapLibreMap.java index 53d6f1901..db5873653 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapLibreMap.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.content.Context; import android.graphics.Bitmap; @@ -22,32 +22,33 @@ import com.mapbox.android.gestures.ShoveGestureDetector; import com.mapbox.android.gestures.StandardScaleGestureDetector; import com.mapbox.geojson.Feature; import com.mapbox.geojson.Geometry; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.annotations.Annotation; -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions; -import com.mapbox.mapboxsdk.annotations.Marker; -import com.mapbox.mapboxsdk.annotations.MarkerOptions; -import com.mapbox.mapboxsdk.annotations.Polygon; -import com.mapbox.mapboxsdk.annotations.PolygonOptions; -import com.mapbox.mapboxsdk.annotations.Polyline; -import com.mapbox.mapboxsdk.annotations.PolylineOptions; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.camera.CameraUpdate; -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.geometry.LatLngBounds; -import com.mapbox.mapboxsdk.location.LocationComponent; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.offline.OfflineRegionDefinition; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.annotations.Annotation; +import org.maplibre.android.annotations.BaseMarkerOptions; +import org.maplibre.android.annotations.Marker; +import org.maplibre.android.annotations.MarkerOptions; +import org.maplibre.android.annotations.Polygon; +import org.maplibre.android.annotations.PolygonOptions; +import org.maplibre.android.annotations.Polyline; +import org.maplibre.android.annotations.PolylineOptions; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.camera.CameraUpdate; +import org.maplibre.android.camera.CameraUpdateFactory; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.geometry.LatLngBounds; +import org.maplibre.android.location.LocationComponent; +import org.maplibre.android.location.LocationComponentActivationOptions; +import org.maplibre.android.log.Logger; +import org.maplibre.android.offline.OfflineRegionDefinition; +import org.maplibre.android.style.expressions.Expression; import java.util.ArrayList; import java.util.List; /** - * The general class to interact with in the Android Mapbox SDK. It exposes the entry point for all - * methods related to the MapView. You cannot instantiate {@link MapboxMap} object directly, rather, + * The general class to interact with in the Android MapLibre SDK. It exposes the entry point for all + * methods related to the MapView. You cannot instantiate {@link MapLibreMap} object directly, rather, * you must obtain one from the getMapAsync() method on a MapFragment or MapView that you have * added to your application. *

@@ -55,7 +56,7 @@ import java.util.List; *

*/ @UiThread -public final class MapboxMap { +public final class MapLibreMap { private static final String TAG = "Mbgl-MapboxMap"; @@ -75,7 +76,7 @@ public final class MapboxMap { private AnnotationManager annotationManager; @Nullable - private MapboxMap.OnFpsChangedListener onFpsChangedListener; + private MapLibreMap.OnFpsChangedListener onFpsChangedListener; @Nullable private Style style; @@ -83,9 +84,9 @@ public final class MapboxMap { private boolean debugActive; private boolean started; - MapboxMap(NativeMap map, Transform transform, UiSettings ui, Projection projection, - OnGesturesManagerInteractionListener listener, CameraChangeDispatcher cameraChangeDispatcher, - List developerAnimationStartedListeners) { + MapLibreMap(NativeMap map, Transform transform, UiSettings ui, Projection projection, + OnGesturesManagerInteractionListener listener, CameraChangeDispatcher cameraChangeDispatcher, + List developerAnimationStartedListeners) { this.nativeMapView = map; this.uiSettings = ui; this.projection = projection; @@ -102,7 +103,7 @@ public final class MapboxMap { nativeMapView.triggerRepaint(); } - void initialise(@NonNull Context context, @NonNull MapboxMapOptions options) { + void initialise(@NonNull Context context, @NonNull MapLibreMapOptions options) { transform.initialise(this, options); uiSettings.initialise(context, options); @@ -162,8 +163,8 @@ public final class MapboxMap { * @param outState the bundle to save the state to. */ void onSaveInstanceState(@NonNull Bundle outState) { - outState.putParcelable(MapboxConstants.STATE_CAMERA_POSITION, transform.getCameraPosition()); - outState.putBoolean(MapboxConstants.STATE_DEBUG_ACTIVE, isDebugActive()); + outState.putParcelable(MapLibreConstants.STATE_CAMERA_POSITION, transform.getCameraPosition()); + outState.putBoolean(MapLibreConstants.STATE_DEBUG_ACTIVE, isDebugActive()); uiSettings.onSaveInstanceState(outState); } @@ -173,7 +174,7 @@ public final class MapboxMap { * @param savedInstanceState the bundle containing the saved state */ void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { - final CameraPosition cameraPosition = savedInstanceState.getParcelable(MapboxConstants.STATE_CAMERA_POSITION); + final CameraPosition cameraPosition = savedInstanceState.getParcelable(MapLibreConstants.STATE_CAMERA_POSITION); uiSettings.onRestoreInstanceState(savedInstanceState); @@ -183,7 +184,7 @@ public final class MapboxMap { ); } - nativeMapView.setDebug(savedInstanceState.getBoolean(MapboxConstants.STATE_DEBUG_ACTIVE)); + nativeMapView.setDebug(savedInstanceState.getBoolean(MapLibreConstants.STATE_DEBUG_ACTIVE)); } /** @@ -262,7 +263,7 @@ public final class MapboxMap { * * @param options the options object */ - private void setPrefetchesTiles(@NonNull MapboxMapOptions options) { + private void setPrefetchesTiles(@NonNull MapLibreMapOptions options) { if (!options.getPrefetchesTiles()) { setPrefetchZoomDelta(0); } else { @@ -286,7 +287,7 @@ public final class MapboxMap { * Check whether tile pre-fetching is enabled or not. * * @return true if enabled - * @see MapboxMap#setPrefetchesTiles(boolean) + * @see MapLibreMap#setPrefetchesTiles(boolean) * @deprecated Use {@link #getPrefetchZoomDelta()} instead. */ @Deprecated @@ -312,7 +313,7 @@ public final class MapboxMap { * Check current pre-fetching zoom delta. * * @return current zoom delta. - * @see MapboxMap#setPrefetchZoomDelta(int) + * @see MapLibreMap#setPrefetchZoomDelta(int) */ @IntRange(from = 0) public int getPrefetchZoomDelta() { @@ -331,7 +332,7 @@ public final class MapboxMap { * @param minZoom The new minimum zoom level. */ public void setMinZoomPreference( - @FloatRange(from = MapboxConstants.MINIMUM_ZOOM, to = MapboxConstants.MAXIMUM_ZOOM) double minZoom) { + @FloatRange(from = MapLibreConstants.MINIMUM_ZOOM, to = MapLibreConstants.MAXIMUM_ZOOM) double minZoom) { transform.setMinZoom(minZoom); } @@ -360,8 +361,8 @@ public final class MapboxMap { * * @param maxZoom The new maximum zoom level. */ - public void setMaxZoomPreference(@FloatRange(from = MapboxConstants.MINIMUM_ZOOM, - to = MapboxConstants.MAXIMUM_ZOOM) double maxZoom) { + public void setMaxZoomPreference(@FloatRange(from = MapLibreConstants.MINIMUM_ZOOM, + to = MapLibreConstants.MAXIMUM_ZOOM) double maxZoom) { transform.setMaxZoom(maxZoom); } @@ -391,7 +392,7 @@ public final class MapboxMap { * @param minPitch The new minimum Pitch. */ public void setMinPitchPreference( - @FloatRange(from = MapboxConstants.MINIMUM_PITCH, to = MapboxConstants.MAXIMUM_PITCH) double minPitch) { + @FloatRange(from = MapLibreConstants.MINIMUM_PITCH, to = MapLibreConstants.MAXIMUM_PITCH) double minPitch) { transform.setMinPitch(minPitch); } @@ -420,8 +421,8 @@ public final class MapboxMap { * * @param maxPitch The new maximum Pitch. */ - public void setMaxPitchPreference(@FloatRange(from = MapboxConstants.MINIMUM_PITCH, - to = MapboxConstants.MAXIMUM_PITCH) double maxPitch) { + public void setMaxPitchPreference(@FloatRange(from = MapLibreConstants.MINIMUM_PITCH, + to = MapLibreConstants.MAXIMUM_PITCH) double maxPitch) { transform.setMaxPitch(maxPitch); } @@ -522,9 +523,9 @@ public final class MapboxMap { * @param callback the callback to be invoked when an animation finishes or is canceled */ public final void moveCamera(@NonNull final CameraUpdate update, - @Nullable final MapboxMap.CancelableCallback callback) { + @Nullable final MapLibreMap.CancelableCallback callback) { notifyDeveloperAnimationListeners(); - transform.moveCamera(MapboxMap.this, update, callback); + transform.moveCamera(MapLibreMap.this, update, callback); } /** @@ -533,10 +534,10 @@ public final class MapboxMap { * it will return the current location of the camera in flight. * * @param update The change that should be applied to the camera. - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ public final void easeCamera(@NonNull CameraUpdate update) { - easeCamera(update, MapboxConstants.ANIMATION_DURATION); + easeCamera(update, MapLibreConstants.ANIMATION_DURATION); } /** @@ -550,10 +551,10 @@ public final class MapboxMap { * will be notified with onFinish(). If the animation stops due to interruption * by a later camera movement or a user gesture, onCancel() will be called. * Do not update or ease the camera from within onCancel(). - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ - public final void easeCamera(@NonNull CameraUpdate update, @Nullable final MapboxMap.CancelableCallback callback) { - easeCamera(update, MapboxConstants.ANIMATION_DURATION, callback); + public final void easeCamera(@NonNull CameraUpdate update, @Nullable final MapLibreMap.CancelableCallback callback) { + easeCamera(update, MapLibreConstants.ANIMATION_DURATION, callback); } /** @@ -564,7 +565,7 @@ public final class MapboxMap { * @param update The change that should be applied to the camera. * @param durationMs The duration of the animation in milliseconds. This must be strictly * positive, otherwise an IllegalArgumentException will be thrown. - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ public final void easeCamera(@NonNull CameraUpdate update, int durationMs) { easeCamera(update, durationMs, null); @@ -587,10 +588,10 @@ public final class MapboxMap { * will be notified with onFinish(). If the animation stops due to interruption * by a later camera movement or a user gesture, onCancel() will be called. * Do not update or ease the camera from within onCancel(). - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ public final void easeCamera(@NonNull CameraUpdate update, int durationMs, - @Nullable final MapboxMap.CancelableCallback callback) { + @Nullable final MapLibreMap.CancelableCallback callback) { easeCamera(update, durationMs, true, callback); } @@ -631,12 +632,12 @@ public final class MapboxMap { public final void easeCamera(@NonNull final CameraUpdate update, final int durationMs, final boolean easingInterpolator, - @Nullable final MapboxMap.CancelableCallback callback) { + @Nullable final MapLibreMap.CancelableCallback callback) { if (durationMs <= 0) { throw new IllegalArgumentException("Null duration passed into easeCamera"); } notifyDeveloperAnimationListeners(); - transform.easeCamera(MapboxMap.this, update, durationMs, easingInterpolator, callback); + transform.easeCamera(MapLibreMap.this, update, durationMs, easingInterpolator, callback); } /** @@ -646,10 +647,10 @@ public final class MapboxMap { * of the camera in flight. * * @param update The change that should be applied to the camera. - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ public final void animateCamera(@NonNull CameraUpdate update) { - animateCamera(update, MapboxConstants.ANIMATION_DURATION, null); + animateCamera(update, MapLibreConstants.ANIMATION_DURATION, null); } /** @@ -662,10 +663,10 @@ public final class MapboxMap { * @param callback The callback to invoke from the main thread when the animation stops. If the * animation completes normally, onFinish() is called; otherwise, onCancel() is * called. Do not update or animate the camera from within onCancel(). - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ - public final void animateCamera(@NonNull CameraUpdate update, @Nullable MapboxMap.CancelableCallback callback) { - animateCamera(update, MapboxConstants.ANIMATION_DURATION, callback); + public final void animateCamera(@NonNull CameraUpdate update, @Nullable MapLibreMap.CancelableCallback callback) { + animateCamera(update, MapLibreConstants.ANIMATION_DURATION, callback); } /** @@ -677,7 +678,7 @@ public final class MapboxMap { * @param update The change that should be applied to the camera. * @param durationMs The duration of the animation in milliseconds. This must be strictly * positive, otherwise an IllegalArgumentException will be thrown. - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ public final void animateCamera(@NonNull CameraUpdate update, int durationMs) { animateCamera(update, durationMs, null); @@ -699,15 +700,15 @@ public final class MapboxMap { * by a later camera movement or a user gesture, onCancel() will be called. * Do not update or animate the camera from within onCancel(). If a callback * isn't required, leave it as null. - * @see com.mapbox.mapboxsdk.camera.CameraUpdateFactory for a set of updates. + * @see CameraUpdateFactory for a set of updates. */ public final void animateCamera(@NonNull final CameraUpdate update, final int durationMs, - @Nullable final MapboxMap.CancelableCallback callback) { + @Nullable final MapLibreMap.CancelableCallback callback) { if (durationMs <= 0) { throw new IllegalArgumentException("Null duration passed into animateCamera"); } notifyDeveloperAnimationListeners(); - transform.animateCamera(MapboxMap.this, update, durationMs, callback); + transform.animateCamera(MapLibreMap.this, update, durationMs, callback); } /** @@ -858,7 +859,7 @@ public final class MapboxMap { // API endpoint config // - private void setApiBaseUrl(@NonNull MapboxMapOptions options) { + private void setApiBaseUrl(@NonNull MapLibreMapOptions options) { String apiBaseUrl = options.getApiBaseUrl(); if (!TextUtils.isEmpty(apiBaseUrl)) { nativeMapView.setApiBaseUrl(apiBaseUrl); @@ -988,7 +989,7 @@ public final class MapboxMap { * @return The {@code Marker} that was added to the map * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1007,7 +1008,7 @@ public final class MapboxMap { * @return The {@code Marker} that was added to the map * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1026,7 +1027,7 @@ public final class MapboxMap { * @return A list of the {@code Marker}s that were added to the map * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1043,7 +1044,7 @@ public final class MapboxMap { * @param updatedMarker An updated marker object * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void updateMarker(@NonNull Marker updatedMarker) { @@ -1057,7 +1058,7 @@ public final class MapboxMap { * @return The {@code Polyine} that was added to the map * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1072,7 +1073,7 @@ public final class MapboxMap { * @return A list of the {@code Polyline}s that were added to the map. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1086,7 +1087,7 @@ public final class MapboxMap { * @param polyline An updated polyline object. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void updatePolyline(@NonNull Polyline polyline) { @@ -1100,7 +1101,7 @@ public final class MapboxMap { * @return The {@code Polygon} that was added to the map. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1115,7 +1116,7 @@ public final class MapboxMap { * @return A list of the {@code Polygon}s that were added to the map * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1129,7 +1130,7 @@ public final class MapboxMap { * @param polygon An updated polygon object * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void updatePolygon(@NonNull Polygon polygon) { @@ -1145,7 +1146,7 @@ public final class MapboxMap { * @param marker Marker to remove * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void removeMarker(@NonNull Marker marker) { @@ -1161,7 +1162,7 @@ public final class MapboxMap { * @param polyline Polyline to remove * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void removePolyline(@NonNull Polyline polyline) { @@ -1177,7 +1178,7 @@ public final class MapboxMap { * @param polygon Polygon to remove * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void removePolygon(@NonNull Polygon polygon) { @@ -1190,7 +1191,7 @@ public final class MapboxMap { * @param annotation The annotation object to remove. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void removeAnnotation(@NonNull Annotation annotation) { @@ -1203,7 +1204,7 @@ public final class MapboxMap { * @param id The identifier associated to the annotation to be removed * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void removeAnnotation(long id) { @@ -1216,7 +1217,7 @@ public final class MapboxMap { * @param annotationList A list of annotation objects to remove. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void removeAnnotations(@NonNull List annotationList) { @@ -1228,7 +1229,7 @@ public final class MapboxMap { * * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void removeAnnotations() { @@ -1240,7 +1241,7 @@ public final class MapboxMap { * * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void clear() { @@ -1254,7 +1255,7 @@ public final class MapboxMap { * @return An annotation with a matched id, null is returned if no match was found * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @Nullable @@ -1269,7 +1270,7 @@ public final class MapboxMap { * list will not update the map * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1284,7 +1285,7 @@ public final class MapboxMap { * list will not update the map. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1299,7 +1300,7 @@ public final class MapboxMap { * list will not update the map. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1314,7 +1315,7 @@ public final class MapboxMap { * list will not update the map. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1329,7 +1330,7 @@ public final class MapboxMap { * To unset the callback, use null. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void setOnMarkerClickListener(@Nullable OnMarkerClickListener listener) { @@ -1343,7 +1344,7 @@ public final class MapboxMap { * To unset the callback, use null. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void setOnPolygonClickListener(@Nullable OnPolygonClickListener listener) { @@ -1357,7 +1358,7 @@ public final class MapboxMap { * To unset the callback, use null. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void setOnPolylineClickListener(@Nullable OnPolylineClickListener listener) { @@ -1375,7 +1376,7 @@ public final class MapboxMap { * @param marker The marker to select. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void selectMarker(@NonNull Marker marker) { @@ -1391,7 +1392,7 @@ public final class MapboxMap { * * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void deselectMarkers() { @@ -1404,7 +1405,7 @@ public final class MapboxMap { * @param marker the marker to deselect * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void deselectMarker(@NonNull Marker marker) { @@ -1417,7 +1418,7 @@ public final class MapboxMap { * @return The currently selected marker. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @NonNull @@ -1440,7 +1441,7 @@ public final class MapboxMap { * To unset the callback, use null. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void setInfoWindowAdapter(@Nullable InfoWindowAdapter infoWindowAdapter) { @@ -1453,7 +1454,7 @@ public final class MapboxMap { * @return The callback to be invoked when an info window will be shown. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated @Nullable @@ -1467,7 +1468,7 @@ public final class MapboxMap { * @param allow If true, map allows concurrent multiple infowindows to be shown. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public void setAllowConcurrentMultipleOpenInfoWindows(boolean allow) { @@ -1480,7 +1481,7 @@ public final class MapboxMap { * @return If true, map allows concurrent multiple infowindows to be shown. * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public boolean isAllowConcurrentMultipleOpenInfoWindows() { @@ -1542,10 +1543,10 @@ public final class MapboxMap { */ @Nullable public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds, - @FloatRange(from = MapboxConstants.MINIMUM_DIRECTION, - to = MapboxConstants.MAXIMUM_DIRECTION) double bearing, - @FloatRange(from = MapboxConstants.MINIMUM_TILT, - to = MapboxConstants.MAXIMUM_TILT) double tilt) { + @FloatRange(from = MapLibreConstants.MINIMUM_DIRECTION, + to = MapLibreConstants.MAXIMUM_DIRECTION) double bearing, + @FloatRange(from = MapLibreConstants.MINIMUM_TILT, + to = MapLibreConstants.MAXIMUM_TILT) double tilt) { return getCameraForLatLngBounds(latLngBounds, new int[] {0, 0, 0, 0}, bearing, tilt); } @@ -1562,10 +1563,10 @@ public final class MapboxMap { @Nullable public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds, @NonNull @Size(value = 4) int[] padding, - @FloatRange(from = MapboxConstants.MINIMUM_DIRECTION, - to = MapboxConstants.MAXIMUM_DIRECTION) double bearing, - @FloatRange(from = MapboxConstants.MINIMUM_TILT, - to = MapboxConstants.MAXIMUM_TILT) double tilt) { + @FloatRange(from = MapLibreConstants.MINIMUM_DIRECTION, + to = MapLibreConstants.MAXIMUM_DIRECTION) double bearing, + @FloatRange(from = MapLibreConstants.MINIMUM_TILT, + to = MapLibreConstants.MAXIMUM_TILT) double tilt) { return nativeMapView.getCameraForLatLngBounds(latLngBounds, padding, bearing, tilt); } @@ -1605,10 +1606,10 @@ public final class MapboxMap { */ @Nullable public CameraPosition getCameraForGeometry(@NonNull Geometry geometry, - @FloatRange(from = MapboxConstants.MINIMUM_DIRECTION, - to = MapboxConstants.MAXIMUM_DIRECTION) double bearing, - @FloatRange(from = MapboxConstants.MINIMUM_TILT, - to = MapboxConstants.MAXIMUM_TILT) double tilt) { + @FloatRange(from = MapLibreConstants.MINIMUM_DIRECTION, + to = MapLibreConstants.MAXIMUM_DIRECTION) double bearing, + @FloatRange(from = MapLibreConstants.MINIMUM_TILT, + to = MapLibreConstants.MAXIMUM_TILT) double tilt) { return getCameraForGeometry(geometry, new int[] {0, 0, 0, 0}, bearing, tilt); } @@ -1624,10 +1625,10 @@ public final class MapboxMap { @Nullable public CameraPosition getCameraForGeometry(@NonNull Geometry geometry, @NonNull @Size(value = 4) int[] padding, - @FloatRange(from = MapboxConstants.MINIMUM_DIRECTION, - to = MapboxConstants.MAXIMUM_DIRECTION) double bearing, - @FloatRange(from = MapboxConstants.MINIMUM_TILT, - to = MapboxConstants.MAXIMUM_TILT) double tilt) { + @FloatRange(from = MapLibreConstants.MINIMUM_DIRECTION, + to = MapLibreConstants.MAXIMUM_DIRECTION) double bearing, + @FloatRange(from = MapLibreConstants.MINIMUM_TILT, + to = MapLibreConstants.MAXIMUM_TILT) double tilt) { return nativeMapView.getCameraForGeometry(geometry, padding, bearing, tilt); } @@ -2093,10 +2094,11 @@ public final class MapboxMap { /** * Returns the {@link LocationComponent} that can be used to display user's location on the map. *

- * Use {@link LocationComponent#activateLocationComponent(Context, Style)} or any overload to activate the component, + * Use {@link LocationComponent#activateLocationComponent(LocationComponentActivationOptions)} or + * any overload to activate the component, * then, enable it with {@link LocationComponent#setLocationComponentEnabled(boolean)}. *

- * You can customize the location icon and more with {@link com.mapbox.mapboxsdk.location.LocationComponentOptions}. + * You can customize the location icon and more with {@link org.maplibre.android.location.LocationComponentOptions}. * * @return the Location Component */ @@ -2112,7 +2114,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the map is flinged. * - * @see MapboxMap#addOnFlingListener(OnFlingListener) + * @see MapLibreMap#addOnFlingListener(OnFlingListener) */ public interface OnFlingListener { /** @@ -2124,7 +2126,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the map is moved. * - * @see MapboxMap#addOnMoveListener(OnMoveListener) + * @see MapLibreMap#addOnMoveListener(OnMoveListener) */ public interface OnMoveListener { void onMoveBegin(@NonNull MoveGestureDetector detector); @@ -2137,7 +2139,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the map is rotated. * - * @see MapboxMap#addOnRotateListener(OnRotateListener) + * @see MapLibreMap#addOnRotateListener(OnRotateListener) */ public interface OnRotateListener { void onRotateBegin(@NonNull RotateGestureDetector detector); @@ -2150,7 +2152,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the map is scaled. * - * @see MapboxMap#addOnScaleListener(OnScaleListener) + * @see MapLibreMap#addOnScaleListener(OnScaleListener) */ public interface OnScaleListener { void onScaleBegin(@NonNull StandardScaleGestureDetector detector); @@ -2163,7 +2165,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the map is tilted. * - * @see MapboxMap#addOnShoveListener(OnShoveListener) + * @see MapLibreMap#addOnShoveListener(OnShoveListener) */ public interface OnShoveListener { void onShoveBegin(@NonNull ShoveGestureDetector detector); @@ -2241,7 +2243,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when a frame is rendered to the map view. * - * @see MapboxMap#setOnFpsChangedListener(OnFpsChangedListener) + * @see MapLibreMap#setOnFpsChangedListener(OnFpsChangedListener) */ public interface OnFpsChangedListener { /** @@ -2297,7 +2299,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the user clicks on the map view. * - * @see MapboxMap#addOnMapClickListener(OnMapClickListener) + * @see MapLibreMap#addOnMapClickListener(OnMapClickListener) */ public interface OnMapClickListener { /** @@ -2313,7 +2315,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the user long clicks on the map view. * - * @see MapboxMap#addOnMapLongClickListener(OnMapLongClickListener) + * @see MapLibreMap#addOnMapLongClickListener(OnMapLongClickListener) */ public interface OnMapLongClickListener { /** @@ -2329,10 +2331,10 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the user clicks on a marker. * - * @see MapboxMap#setOnMarkerClickListener(OnMarkerClickListener) + * @see MapLibreMap#setOnMarkerClickListener(OnMarkerClickListener) * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public interface OnMarkerClickListener { @@ -2348,10 +2350,10 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the user clicks on a polygon. * - * @see MapboxMap#setOnPolygonClickListener(OnPolygonClickListener) + * @see MapLibreMap#setOnPolygonClickListener(OnPolygonClickListener) * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public interface OnPolygonClickListener { @@ -2366,10 +2368,10 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the user clicks on a polyline. * - * @see MapboxMap#setOnPolylineClickListener(OnPolylineClickListener) + * @see MapLibreMap#setOnPolylineClickListener(OnPolylineClickListener) * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public interface OnPolylineClickListener { @@ -2384,7 +2386,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the user clicks on an info window. * - * @see MapboxMap#setOnInfoWindowClickListener(OnInfoWindowClickListener) + * @see MapLibreMap#setOnInfoWindowClickListener(OnInfoWindowClickListener) */ public interface OnInfoWindowClickListener { /** @@ -2399,7 +2401,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when the user long presses on a marker's info window. * - * @see MapboxMap#setOnInfoWindowClickListener(OnInfoWindowClickListener) + * @see MapLibreMap#setOnInfoWindowClickListener(OnInfoWindowClickListener) */ public interface OnInfoWindowLongClickListener { @@ -2414,7 +2416,7 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when a marker's info window is closed. * - * @see MapboxMap#setOnInfoWindowCloseListener(OnInfoWindowCloseListener) + * @see MapLibreMap#setOnInfoWindowCloseListener(OnInfoWindowCloseListener) */ public interface OnInfoWindowCloseListener { @@ -2429,10 +2431,10 @@ public final class MapboxMap { /** * Interface definition for a callback to be invoked when an info window will be shown. * - * @see MapboxMap#setInfoWindowAdapter(InfoWindowAdapter) + * @see MapLibreMap#setInfoWindowAdapter(InfoWindowAdapter) * @deprecated As of 7.0.0, * use - * Mapbox Annotation Plugin instead + * MapLibre Annotation Plugin instead */ @Deprecated public interface InfoWindowAdapter { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapLibreMapOptions.java similarity index 83% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapLibreMapOptions.java index 6b58c2d13..e953bac13 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapLibreMapOptions.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.content.Context; import android.content.res.TypedArray; @@ -18,23 +18,23 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.core.content.res.ResourcesCompat; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.utils.BitmapUtils; -import com.mapbox.mapboxsdk.utils.FontUtils; +import org.maplibre.android.R; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.utils.BitmapUtils; +import org.maplibre.android.utils.FontUtils; import java.util.Arrays; /** - * Defines configuration MapboxMapMapOptions for a MapboxMap. These options can be used when adding a + * Defines configuration MapLibreMapOptions for a MapLibreMap. These options can be used when adding a * map to your application programmatically (as opposed to via XML). If you are using a MapFragment, * you can pass these options in using the static factory method newInstance(MapboxMapOptions). * If you are using a MapView, you can pass these options in using the constructor * MapView(Context, MapboxMapOptions). If you add a map using XML, then you can apply these options * using custom XML tags. */ -public class MapboxMapOptions implements Parcelable { +public class MapLibreMapOptions implements Parcelable { private static final int LIGHT_GRAY = 0xFFF0E9E1; // RGB(240, 233, 225)) private static final float FOUR_DP = 4f; @@ -61,10 +61,10 @@ public class MapboxMapOptions implements Parcelable { private int attributionGravity = Gravity.BOTTOM | Gravity.START; private int[] attributionMargins; - private double minZoom = MapboxConstants.MINIMUM_ZOOM; - private double maxZoom = MapboxConstants.MAXIMUM_ZOOM; - private double minPitch = MapboxConstants.MINIMUM_PITCH; - private double maxPitch = MapboxConstants.MAXIMUM_PITCH; + private double minZoom = MapLibreConstants.MINIMUM_ZOOM; + private double maxZoom = MapLibreConstants.MAXIMUM_ZOOM; + private double minPitch = MapLibreConstants.MINIMUM_PITCH; + private double maxPitch = MapLibreConstants.MAXIMUM_PITCH; private boolean rotateGesturesEnabled = true; private boolean scrollGesturesEnabled = true; @@ -100,10 +100,10 @@ public class MapboxMapOptions implements Parcelable { * @deprecated Use {@link #createFromAttributes(Context, AttributeSet)} instead. */ @Deprecated - public MapboxMapOptions() { + public MapLibreMapOptions() { } - private MapboxMapOptions(Parcel in) { + private MapLibreMapOptions(Parcel in) { cameraPosition = in.readParcelable(CameraPosition.class.getClassLoader()); debugActive = in.readByte() != 0; @@ -160,7 +160,7 @@ public class MapboxMapOptions implements Parcelable { * @return the MapboxMapOptions created from attributes */ @NonNull - public static MapboxMapOptions createFromAttributes(@NonNull Context context) { + public static MapLibreMapOptions createFromAttributes(@NonNull Context context) { return createFromAttributes(context, null); } @@ -172,56 +172,56 @@ public class MapboxMapOptions implements Parcelable { * @return the MapboxMapOptions created from attributes */ @NonNull - public static MapboxMapOptions createFromAttributes(@NonNull Context context, @Nullable AttributeSet attrs) { + public static MapLibreMapOptions createFromAttributes(@NonNull Context context, @Nullable AttributeSet attrs) { TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.maplibre_MapView, 0, 0); - return createFromAttributes(new MapboxMapOptions(), context, typedArray); + return createFromAttributes(new MapLibreMapOptions(), context, typedArray); } @VisibleForTesting - static MapboxMapOptions createFromAttributes(@NonNull MapboxMapOptions mapboxMapOptions, - @NonNull Context context, - @Nullable TypedArray typedArray) { + static MapLibreMapOptions createFromAttributes(@NonNull MapLibreMapOptions maplibreMapOptions, + @NonNull Context context, + @Nullable TypedArray typedArray) { float pxlRatio = context.getResources().getDisplayMetrics().density; try { - mapboxMapOptions.camera(new CameraPosition.Builder(typedArray).build()); + maplibreMapOptions.camera(new CameraPosition.Builder(typedArray).build()); // deprecated - mapboxMapOptions.apiBaseUrl(typedArray.getString(R.styleable.maplibre_MapView_maplibre_apiBaseUrl)); + maplibreMapOptions.apiBaseUrl(typedArray.getString(R.styleable.maplibre_MapView_maplibre_apiBaseUrl)); String baseUri = typedArray.getString(R.styleable.maplibre_MapView_maplibre_apiBaseUri); if (!TextUtils.isEmpty(baseUri)) { // override deprecated property if a value of the new type was provided - mapboxMapOptions.apiBaseUri(baseUri); + maplibreMapOptions.apiBaseUri(baseUri); } - mapboxMapOptions.zoomGesturesEnabled( + maplibreMapOptions.zoomGesturesEnabled( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiZoomGestures, true)); - mapboxMapOptions.scrollGesturesEnabled( + maplibreMapOptions.scrollGesturesEnabled( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiScrollGestures, true)); - mapboxMapOptions.horizontalScrollGesturesEnabled( + maplibreMapOptions.horizontalScrollGesturesEnabled( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiHorizontalScrollGestures, true)); - mapboxMapOptions.rotateGesturesEnabled( + maplibreMapOptions.rotateGesturesEnabled( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiRotateGestures, true)); - mapboxMapOptions.tiltGesturesEnabled( + maplibreMapOptions.tiltGesturesEnabled( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiTiltGestures, true)); - mapboxMapOptions.doubleTapGesturesEnabled( + maplibreMapOptions.doubleTapGesturesEnabled( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiDoubleTapGestures, true)); - mapboxMapOptions.quickZoomGesturesEnabled( + maplibreMapOptions.quickZoomGesturesEnabled( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiQuickZoomGestures, true)); - mapboxMapOptions.maxZoomPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraZoomMax, - MapboxConstants.MAXIMUM_ZOOM)); - mapboxMapOptions.minZoomPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraZoomMin, - MapboxConstants.MINIMUM_ZOOM)); - mapboxMapOptions.maxPitchPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraPitchMax, - MapboxConstants.MAXIMUM_PITCH)); - mapboxMapOptions.minPitchPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraPitchMin, - MapboxConstants.MINIMUM_PITCH)); + maplibreMapOptions.maxZoomPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraZoomMax, + MapLibreConstants.MAXIMUM_ZOOM)); + maplibreMapOptions.minZoomPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraZoomMin, + MapLibreConstants.MINIMUM_ZOOM)); + maplibreMapOptions.maxPitchPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraPitchMax, + MapLibreConstants.MAXIMUM_PITCH)); + maplibreMapOptions.minPitchPreference(typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_cameraPitchMin, + MapLibreConstants.MINIMUM_PITCH)); - mapboxMapOptions.compassEnabled(typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiCompass, true)); - mapboxMapOptions.compassGravity(typedArray.getInt(R.styleable.maplibre_MapView_maplibre_uiCompassGravity, + maplibreMapOptions.compassEnabled(typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiCompass, true)); + maplibreMapOptions.compassGravity(typedArray.getInt(R.styleable.maplibre_MapView_maplibre_uiCompassGravity, Gravity.TOP | Gravity.END)); - mapboxMapOptions.compassMargins(new int[] { + maplibreMapOptions.compassMargins(new int[] { (int) (typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiCompassMarginLeft, FOUR_DP * pxlRatio)), ((int) typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiCompassMarginTop, @@ -230,19 +230,19 @@ public class MapboxMapOptions implements Parcelable { FOUR_DP * pxlRatio)), ((int) typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiCompassMarginBottom, FOUR_DP * pxlRatio))}); - mapboxMapOptions.compassFadesWhenFacingNorth(typedArray.getBoolean( + maplibreMapOptions.compassFadesWhenFacingNorth(typedArray.getBoolean( R.styleable.maplibre_MapView_maplibre_uiCompassFadeFacingNorth, true)); Drawable compassDrawable = typedArray.getDrawable( R.styleable.maplibre_MapView_maplibre_uiCompassDrawable); if (compassDrawable == null) { compassDrawable = ResourcesCompat.getDrawable(context.getResources(), R.drawable.maplibre_compass_icon, null); } - mapboxMapOptions.compassImage(compassDrawable); + maplibreMapOptions.compassImage(compassDrawable); - mapboxMapOptions.logoEnabled(typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiLogo, true)); - mapboxMapOptions.logoGravity(typedArray.getInt(R.styleable.maplibre_MapView_maplibre_uiLogoGravity, + maplibreMapOptions.logoEnabled(typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_uiLogo, true)); + maplibreMapOptions.logoGravity(typedArray.getInt(R.styleable.maplibre_MapView_maplibre_uiLogoGravity, Gravity.BOTTOM | Gravity.START)); - mapboxMapOptions.logoMargins(new int[] { + maplibreMapOptions.logoMargins(new int[] { (int) (typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiLogoMarginLeft, FOUR_DP * pxlRatio)), (int) (typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiLogoMarginTop, @@ -252,13 +252,13 @@ public class MapboxMapOptions implements Parcelable { (int) (typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiLogoMarginBottom, FOUR_DP * pxlRatio))}); - mapboxMapOptions.attributionTintColor(typedArray.getColor( + maplibreMapOptions.attributionTintColor(typedArray.getColor( R.styleable.maplibre_MapView_maplibre_uiAttributionTintColor, UNDEFINED_COLOR)); - mapboxMapOptions.attributionEnabled(typedArray.getBoolean( + maplibreMapOptions.attributionEnabled(typedArray.getBoolean( R.styleable.maplibre_MapView_maplibre_uiAttribution, true)); - mapboxMapOptions.attributionGravity(typedArray.getInt( + maplibreMapOptions.attributionGravity(typedArray.getInt( R.styleable.maplibre_MapView_maplibre_uiAttributionGravity, Gravity.BOTTOM | Gravity.START)); - mapboxMapOptions.attributionMargins(new int[] { + maplibreMapOptions.attributionMargins(new int[] { (int) (typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiAttributionMarginLeft, NINETY_TWO_DP * pxlRatio)), (int) (typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiAttributionMarginTop, @@ -267,18 +267,18 @@ public class MapboxMapOptions implements Parcelable { FOUR_DP * pxlRatio)), (int) (typedArray.getDimension(R.styleable.maplibre_MapView_maplibre_uiAttributionMarginBottom, FOUR_DP * pxlRatio))}); - mapboxMapOptions.textureMode( + maplibreMapOptions.textureMode( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_renderTextureMode, false)); - mapboxMapOptions.translucentTextureSurface( + maplibreMapOptions.translucentTextureSurface( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_renderTextureTranslucentSurface, false)); - mapboxMapOptions.setPrefetchesTiles( + maplibreMapOptions.setPrefetchesTiles( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_enableTilePrefetch, true)); - mapboxMapOptions.setPrefetchZoomDelta( + maplibreMapOptions.setPrefetchZoomDelta( typedArray.getInt(R.styleable.maplibre_MapView_maplibre_prefetchZoomDelta, 4)); - mapboxMapOptions.renderSurfaceOnTop( + maplibreMapOptions.renderSurfaceOnTop( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_enableZMediaOverlay, false)); - mapboxMapOptions.localIdeographFontFamilyEnabled = + maplibreMapOptions.localIdeographFontFamilyEnabled = typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_localIdeographEnabled, true); int localIdeographFontFamiliesResId = @@ -286,29 +286,29 @@ public class MapboxMapOptions implements Parcelable { if (localIdeographFontFamiliesResId != 0) { String[] localIdeographFontFamilies = context.getResources().getStringArray(localIdeographFontFamiliesResId); - mapboxMapOptions.localIdeographFontFamily(localIdeographFontFamilies); + maplibreMapOptions.localIdeographFontFamily(localIdeographFontFamilies); } else { // did user provide xml font string? String localIdeographFontFamily = typedArray.getString(R.styleable.maplibre_MapView_maplibre_localIdeographFontFamily); if (localIdeographFontFamily == null) { - localIdeographFontFamily = MapboxConstants.DEFAULT_FONT; + localIdeographFontFamily = MapLibreConstants.DEFAULT_FONT; } - mapboxMapOptions.localIdeographFontFamily(localIdeographFontFamily); + maplibreMapOptions.localIdeographFontFamily(localIdeographFontFamily); } - mapboxMapOptions.pixelRatio( + maplibreMapOptions.pixelRatio( typedArray.getFloat(R.styleable.maplibre_MapView_maplibre_pixelRatio, 0)); - mapboxMapOptions.foregroundLoadColor( + maplibreMapOptions.foregroundLoadColor( typedArray.getInt(R.styleable.maplibre_MapView_maplibre_foregroundLoadColor, LIGHT_GRAY) ); - mapboxMapOptions.crossSourceCollisions( + maplibreMapOptions.crossSourceCollisions( typedArray.getBoolean(R.styleable.maplibre_MapView_maplibre_cross_source_collisions, true) ); } finally { typedArray.recycle(); } - return mapboxMapOptions; + return maplibreMapOptions; } /** @@ -320,7 +320,7 @@ public class MapboxMapOptions implements Parcelable { */ @Deprecated @NonNull - public MapboxMapOptions apiBaseUrl(String apiBaseUrl) { + public MapLibreMapOptions apiBaseUrl(String apiBaseUrl) { this.apiBaseUri = apiBaseUrl; return this; } @@ -332,7 +332,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions apiBaseUri(String apiBaseUri) { + public MapLibreMapOptions apiBaseUri(String apiBaseUri) { this.apiBaseUri = apiBaseUri; return this; } @@ -344,7 +344,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions camera(CameraPosition cameraPosition) { + public MapLibreMapOptions camera(CameraPosition cameraPosition) { this.cameraPosition = cameraPosition; return this; } @@ -356,7 +356,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions debugActive(boolean enabled) { + public MapLibreMapOptions debugActive(boolean enabled) { debugActive = enabled; return this; } @@ -368,7 +368,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions minZoomPreference(double minZoom) { + public MapLibreMapOptions minZoomPreference(double minZoom) { this.minZoom = minZoom; return this; } @@ -380,7 +380,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions maxZoomPreference(double maxZoom) { + public MapLibreMapOptions maxZoomPreference(double maxZoom) { this.maxZoom = maxZoom; return this; } @@ -393,7 +393,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions minPitchPreference(double minPitch) { + public MapLibreMapOptions minPitchPreference(double minPitch) { this.minPitch = minPitch; return this; } @@ -405,7 +405,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions maxPitchPreference(double maxPitch) { + public MapLibreMapOptions maxPitchPreference(double maxPitch) { this.maxPitch = maxPitch; return this; } @@ -417,7 +417,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions compassEnabled(boolean enabled) { + public MapLibreMapOptions compassEnabled(boolean enabled) { compassEnabled = enabled; return this; } @@ -429,7 +429,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions compassGravity(int gravity) { + public MapLibreMapOptions compassGravity(int gravity) { compassGravity = gravity; return this; } @@ -441,7 +441,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions compassMargins(int[] margins) { + public MapLibreMapOptions compassMargins(int[] margins) { compassMargins = margins; return this; } @@ -456,7 +456,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions compassFadesWhenFacingNorth(boolean compassFadeWhenFacingNorth) { + public MapLibreMapOptions compassFadesWhenFacingNorth(boolean compassFadeWhenFacingNorth) { this.fadeCompassFacingNorth = compassFadeWhenFacingNorth; return this; } @@ -471,7 +471,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions compassImage(Drawable compass) { + public MapLibreMapOptions compassImage(Drawable compass) { this.compassImage = compass; return this; } @@ -483,7 +483,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions logoEnabled(boolean enabled) { + public MapLibreMapOptions logoEnabled(boolean enabled) { logoEnabled = enabled; return this; } @@ -495,7 +495,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions logoGravity(int gravity) { + public MapLibreMapOptions logoGravity(int gravity) { logoGravity = gravity; return this; } @@ -507,7 +507,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions logoMargins(int[] margins) { + public MapLibreMapOptions logoMargins(int[] margins) { logoMargins = margins; return this; } @@ -519,7 +519,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions attributionEnabled(boolean enabled) { + public MapLibreMapOptions attributionEnabled(boolean enabled) { attributionEnabled = enabled; return this; } @@ -531,7 +531,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions attributionGravity(int gravity) { + public MapLibreMapOptions attributionGravity(int gravity) { attributionGravity = gravity; return this; } @@ -543,7 +543,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions attributionMargins(int[] margins) { + public MapLibreMapOptions attributionMargins(int[] margins) { attributionMargins = margins; return this; } @@ -555,7 +555,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions attributionTintColor(@ColorInt int color) { + public MapLibreMapOptions attributionTintColor(@ColorInt int color) { attributionTintColor = color; return this; } @@ -567,7 +567,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions rotateGesturesEnabled(boolean enabled) { + public MapLibreMapOptions rotateGesturesEnabled(boolean enabled) { rotateGesturesEnabled = enabled; return this; } @@ -579,7 +579,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions scrollGesturesEnabled(boolean enabled) { + public MapLibreMapOptions scrollGesturesEnabled(boolean enabled) { scrollGesturesEnabled = enabled; return this; } @@ -591,7 +591,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions horizontalScrollGesturesEnabled(boolean enabled) { + public MapLibreMapOptions horizontalScrollGesturesEnabled(boolean enabled) { horizontalScrollGesturesEnabled = enabled; return this; } @@ -603,7 +603,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions tiltGesturesEnabled(boolean enabled) { + public MapLibreMapOptions tiltGesturesEnabled(boolean enabled) { tiltGesturesEnabled = enabled; return this; } @@ -615,7 +615,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions zoomGesturesEnabled(boolean enabled) { + public MapLibreMapOptions zoomGesturesEnabled(boolean enabled) { zoomGesturesEnabled = enabled; return this; } @@ -627,7 +627,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions doubleTapGesturesEnabled(boolean enabled) { + public MapLibreMapOptions doubleTapGesturesEnabled(boolean enabled) { doubleTapGesturesEnabled = enabled; return this; } @@ -639,7 +639,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions quickZoomGesturesEnabled(boolean enabled) { + public MapLibreMapOptions quickZoomGesturesEnabled(boolean enabled) { quickZoomGesturesEnabled = enabled; return this; } @@ -658,13 +658,13 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions textureMode(boolean textureMode) { + public MapLibreMapOptions textureMode(boolean textureMode) { this.textureMode = textureMode; return this; } @NonNull - public MapboxMapOptions translucentTextureSurface(boolean translucentTextureSurface) { + public MapLibreMapOptions translucentTextureSurface(boolean translucentTextureSurface) { this.translucentTextureSurface = translucentTextureSurface; return this; } @@ -676,7 +676,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions foregroundLoadColor(@ColorInt int loadColor) { + public MapLibreMapOptions foregroundLoadColor(@ColorInt int loadColor) { this.foregroundLoadColor = loadColor; return this; } @@ -692,7 +692,7 @@ public class MapboxMapOptions implements Parcelable { */ @Deprecated @NonNull - public MapboxMapOptions setPrefetchesTiles(boolean enable) { + public MapLibreMapOptions setPrefetchesTiles(boolean enable) { this.prefetchesTiles = enable; return this; } @@ -709,7 +709,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions setPrefetchZoomDelta(@IntRange(from = 0) int delta) { + public MapLibreMapOptions setPrefetchZoomDelta(@IntRange(from = 0) int delta) { this.prefetchZoomDelta = delta; return this; } @@ -725,7 +725,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions crossSourceCollisions(boolean crossSourceCollisions) { + public MapLibreMapOptions crossSourceCollisions(boolean crossSourceCollisions) { this.crossSourceCollisions = crossSourceCollisions; return this; } @@ -737,7 +737,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions localIdeographFontFamilyEnabled(boolean enabled) { + public MapLibreMapOptions localIdeographFontFamilyEnabled(boolean enabled) { this.localIdeographFontFamilyEnabled = enabled; return this; } @@ -748,13 +748,13 @@ public class MapboxMapOptions implements Parcelable { *

* The font family argument is passed to {@link android.graphics.Typeface#create(String, int)}. * Default system fonts are defined in '/system/etc/fonts.xml' - * Default font for local ideograph font family is {@link MapboxConstants#DEFAULT_FONT}. + * Default font for local ideograph font family is {@link MapLibreConstants#DEFAULT_FONT}. * * @param fontFamily font family for local ideograph generation. * @return This */ @NonNull - public MapboxMapOptions localIdeographFontFamily(String fontFamily) { + public MapLibreMapOptions localIdeographFontFamily(String fontFamily) { this.localIdeographFontFamily = FontUtils.extractValidFont(fontFamily); return this; } @@ -762,18 +762,18 @@ public class MapboxMapOptions implements Parcelable { /** * Set a font family from range of font families for generating glyphs locally for ideographs in the * 'CJK Unified Ideographs' and 'Hangul Syllables' ranges. The first matching font - * will be selected. If no valid font found, it defaults to {@link MapboxConstants#DEFAULT_FONT}. + * will be selected. If no valid font found, it defaults to {@link MapLibreConstants#DEFAULT_FONT}. *

* The font families are checked against the default system fonts defined in * '/system/etc/fonts.xml' Default font for local ideograph font family is - * {@link MapboxConstants#DEFAULT_FONT}. + * {@link MapLibreConstants#DEFAULT_FONT}. *

* * @param fontFamilies an array of font families for local ideograph generation. * @return This */ @NonNull - public MapboxMapOptions localIdeographFontFamily(String... fontFamilies) { + public MapLibreMapOptions localIdeographFontFamily(String... fontFamilies) { this.localIdeographFontFamily = FontUtils.extractValidFont(fontFamilies); return this; } @@ -786,7 +786,7 @@ public class MapboxMapOptions implements Parcelable { * @return This */ @NonNull - public MapboxMapOptions pixelRatio(float pixelRatio) { + public MapLibreMapOptions pixelRatio(float pixelRatio) { this.pixelRatio = pixelRatio; return this; } @@ -1116,7 +1116,7 @@ public class MapboxMapOptions implements Parcelable { /** * Returns the font-family for locally overriding generation of glyphs in the * 'CJK Unified Ideographs' and 'Hangul Syllables' ranges. - * Default font for local ideograph font family is {@link MapboxConstants#DEFAULT_FONT}. + * Default font for local ideograph font family is {@link MapLibreConstants#DEFAULT_FONT}. * Returns null if local ideograph font families are disabled. * * @return Local ideograph font family name. @@ -1144,13 +1144,13 @@ public class MapboxMapOptions implements Parcelable { return pixelRatio; } - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public MapboxMapOptions createFromParcel(@NonNull Parcel in) { - return new MapboxMapOptions(in); + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public MapLibreMapOptions createFromParcel(@NonNull Parcel in) { + return new MapLibreMapOptions(in); } - public MapboxMapOptions[] newArray(int size) { - return new MapboxMapOptions[size]; + public MapLibreMapOptions[] newArray(int size) { + return new MapLibreMapOptions[size]; } }; @@ -1216,7 +1216,7 @@ public class MapboxMapOptions implements Parcelable { return false; } - MapboxMapOptions options = (MapboxMapOptions) o; + MapLibreMapOptions options = (MapLibreMapOptions) o; if (debugActive != options.debugActive) { return false; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapView.java similarity index 86% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapView.java index b609c7d17..8c927970c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MapView.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.content.Context; import android.graphics.Bitmap; @@ -21,22 +21,22 @@ import androidx.collection.LongSparseArray; import timber.log.Timber; import com.mapbox.android.gestures.AndroidGesturesManager; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.Mapbox; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.WellKnownTileServer; -import com.mapbox.mapboxsdk.annotations.Annotation; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException; -import com.mapbox.mapboxsdk.location.LocationComponent; -import com.mapbox.mapboxsdk.maps.renderer.MapRenderer; -import com.mapbox.mapboxsdk.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer; -import com.mapbox.mapboxsdk.maps.renderer.glsurfaceview.MapboxGLSurfaceView; -import com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewMapRenderer; -import com.mapbox.mapboxsdk.maps.widgets.CompassView; -import com.mapbox.mapboxsdk.net.ConnectivityReceiver; -import com.mapbox.mapboxsdk.storage.FileSource; -import com.mapbox.mapboxsdk.utils.BitmapUtils; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.MapLibre; +import org.maplibre.android.R; +import org.maplibre.android.WellKnownTileServer; +import org.maplibre.android.annotations.Annotation; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.exceptions.MapLibreConfigurationException; +import org.maplibre.android.location.LocationComponent; +import org.maplibre.android.maps.renderer.MapRenderer; +import org.maplibre.android.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer; +import org.maplibre.android.maps.renderer.glsurfaceview.MapLibreGLSurfaceView; +import org.maplibre.android.maps.renderer.textureview.TextureViewMapRenderer; +import org.maplibre.android.maps.widgets.CompassView; +import org.maplibre.android.net.ConnectivityReceiver; +import org.maplibre.android.storage.FileSource; +import org.maplibre.android.utils.BitmapUtils; import java.util.ArrayList; import java.util.Iterator; @@ -45,8 +45,8 @@ import java.util.List; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; -import static com.mapbox.mapboxsdk.maps.widgets.CompassView.TIME_MAP_NORTH_ANIMATION; -import static com.mapbox.mapboxsdk.maps.widgets.CompassView.TIME_WAIT_IDLE; +import static org.maplibre.android.maps.widgets.CompassView.TIME_MAP_NORTH_ANIMATION; +import static org.maplibre.android.maps.widgets.CompassView.TIME_WAIT_IDLE; /** *

@@ -56,8 +56,8 @@ import static com.mapbox.mapboxsdk.maps.widgets.CompassView.TIME_WAIT_IDLE; * and style the features of the map to fit your application's use case. *

*

- * Use of {@code MapView} requires a Mapbox API access token. - * Obtain an access token on the Mapbox account page. + * Use of {@code MapView} requires a MapLibre API access token. + * Obtain an access token on the MapLibre account page. *

* Warning: Please note that you are responsible for getting permission to use the map data, * and for ensuring your use adheres to the relevant terms of use. @@ -71,11 +71,11 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { @Nullable private NativeMap nativeMapView; @Nullable - private MapboxMap mapboxMap; + private MapLibreMap maplibreMap; private View renderView; private AttributionClickListener attributionClickListener; - MapboxMapOptions mapboxMapOptions; + MapLibreMapOptions maplibreMapOptions; private MapRenderer mapRenderer; private boolean destroyed; @@ -102,46 +102,46 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { public MapView(@NonNull Context context) { super(context); Timber.d("MapView constructed with context"); - initialize(context, MapboxMapOptions.createFromAttributes(context)); + initialize(context, MapLibreMapOptions.createFromAttributes(context)); } @UiThread public MapView(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); Timber.d("MapView constructed with context and attribute set"); - initialize(context, MapboxMapOptions.createFromAttributes(context, attrs)); + initialize(context, MapLibreMapOptions.createFromAttributes(context, attrs)); } @UiThread public MapView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); Timber.d( "MapView constructed with context, attributeSet and defStyleAttr"); - initialize(context, MapboxMapOptions.createFromAttributes(context, attrs)); + initialize(context, MapLibreMapOptions.createFromAttributes(context, attrs)); } @UiThread - public MapView(@NonNull Context context, @Nullable MapboxMapOptions options) { + public MapView(@NonNull Context context, @Nullable MapLibreMapOptions options) { super(context); Timber.d("MapView constructed with context and MapboxMapOptions"); - initialize(context, options == null ? MapboxMapOptions.createFromAttributes(context) : options); + initialize(context, options == null ? MapLibreMapOptions.createFromAttributes(context) : options); } @CallSuper @UiThread - protected void initialize(@NonNull final Context context, @NonNull final MapboxMapOptions options) { + protected void initialize(@NonNull final Context context, @NonNull final MapLibreMapOptions options) { if (isInEditMode()) { // in IDE layout editor, just return return; } - if (!Mapbox.hasInstance()) { - throw new MapboxConfigurationException(); + if (!MapLibre.hasInstance()) { + throw new MapLibreConfigurationException(); } // hide surface until map is fully loaded #10990 setForeground(new ColorDrawable(options.getForegroundLoadColor())); - mapboxMapOptions = options; + maplibreMapOptions = options; // add accessibility support setContentDescription(context.getString(R.string.maplibre_mapActionDescription)); @@ -170,10 +170,10 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { Transform transform = new Transform(this, nativeMapView, cameraDispatcher); // MapboxMap - List developerAnimationListeners = new ArrayList<>(); - mapboxMap = new MapboxMap(nativeMapView, transform, uiSettings, proj, registerTouchListener, cameraDispatcher, + List developerAnimationListeners = new ArrayList<>(); + maplibreMap = new MapLibreMap(nativeMapView, transform, uiSettings, proj, registerTouchListener, cameraDispatcher, developerAnimationListeners); - mapboxMap.injectAnnotationManager(annotationManager); + maplibreMap.injectAnnotationManager(annotationManager); // user input mapGestureDetector = new MapGestureDetector(context, transform, proj, uiSettings, @@ -181,7 +181,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { mapKeyListener = new MapKeyListener(transform, uiSettings, mapGestureDetector); // LocationComponent - mapboxMap.injectLocationComponent(new LocationComponent(mapboxMap, transform, developerAnimationListeners)); + maplibreMap.injectLocationComponent(new LocationComponent(maplibreMap, transform, developerAnimationListeners)); // Ensure this view is interactable setClickable(true); @@ -191,13 +191,13 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { requestDisallowInterceptTouchEvent(true); // notify Map object about current connectivity state - nativeMapView.setReachability(Mapbox.isConnected()); + nativeMapView.setReachability(MapLibre.isConnected()); // initialise MapboxMap if (savedInstanceState == null) { - mapboxMap.initialise(context, mapboxMapOptions); + maplibreMap.initialise(context, maplibreMapOptions); } else { - mapboxMap.onRestoreInstanceState(savedInstanceState); + maplibreMap.onRestoreInstanceState(savedInstanceState); } mapCallback.initialised(); @@ -227,7 +227,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { attrView.setContentDescription(getResources().getString(R.string.maplibre_attributionsIconContentDescription)); attrView.setImageDrawable(BitmapUtils.getDrawableFromRes(getContext(), R.drawable.maplibre_info_bg_selector)); // inject widgets with MapboxMap - attrView.setOnClickListener(attributionClickListener = new AttributionClickListener(getContext(), mapboxMap)); + attrView.setOnClickListener(attributionClickListener = new AttributionClickListener(getContext(), maplibreMap)); return attrView; } @@ -250,9 +250,9 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { }; } - private MapboxMap.OnCompassAnimationListener createCompassAnimationListener(@NonNull final CameraChangeDispatcher + private MapLibreMap.OnCompassAnimationListener createCompassAnimationListener(@NonNull final CameraChangeDispatcher cameraChangeDispatcher) { - return new MapboxMap.OnCompassAnimationListener() { + return new MapLibreMap.OnCompassAnimationListener() { @Override public void onCompassAnimation() { cameraChangeDispatcher.onCameraMove(); @@ -272,13 +272,15 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { return new OnClickListener() { @Override public void onClick(View v) { - if (mapboxMap != null && compassView != null) { + if (maplibreMap != null && compassView != null) { if (focalPoint != null) { - mapboxMap.setFocalBearing(0, focalPoint.x, focalPoint.y, TIME_MAP_NORTH_ANIMATION); + maplibreMap.setFocalBearing(0, focalPoint.x, focalPoint.y, TIME_MAP_NORTH_ANIMATION); } else { - mapboxMap.setFocalBearing(0, mapboxMap.getWidth() / 2, mapboxMap.getHeight() / 2, TIME_MAP_NORTH_ANIMATION); + maplibreMap.setFocalBearing( + 0, maplibreMap.getWidth() / 2, maplibreMap.getHeight() / 2, + TIME_MAP_NORTH_ANIMATION); } - cameraChangeDispatcher.onCameraMoveStarted(MapboxMap.OnCameraMoveStartedListener.REASON_API_ANIMATION); + cameraChangeDispatcher.onCameraMoveStarted(MapLibreMap.OnCameraMoveStartedListener.REASON_API_ANIMATION); compassView.isAnimating(true); compassView.postDelayed(compassView, TIME_WAIT_IDLE + TIME_MAP_NORTH_ANIMATION); } @@ -296,20 +298,20 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { * Fragment#onViewCreated(View, Bundle). *

* You must set a valid access token with - * {@link com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String, WellKnownTileServer)} + * {@link MapLibre#getInstance(Context, String, WellKnownTileServer)} * before you call this method or an exception will be thrown. * * @param savedInstanceState Pass in the parent's savedInstanceState. - * @see com.mapbox.mapboxsdk.Mapbox#getInstance(Context, String, WellKnownTileServer) + * @see MapLibre#getInstance(Context, String, WellKnownTileServer) */ @UiThread public void onCreate(@Nullable Bundle savedInstanceState) { - if (savedInstanceState != null && savedInstanceState.getBoolean(MapboxConstants.STATE_HAS_SAVED_STATE)) { + if (savedInstanceState != null && savedInstanceState.getBoolean(MapLibreConstants.STATE_HAS_SAVED_STATE)) { this.savedInstanceState = savedInstanceState; } } - private void initialiseDrawingSurface(MapboxMapOptions options) { + private void initialiseDrawingSurface(MapLibreMapOptions options) { String localFontFamily = options.getLocalIdeographFontFamily(); if (options.getTextureMode()) { TextureView textureView = new TextureView(getContext()); @@ -326,8 +328,8 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { addView(textureView, 0); renderView = textureView; } else { - MapboxGLSurfaceView glSurfaceView = new MapboxGLSurfaceView(getContext()); - glSurfaceView.setZOrderMediaOverlay(mapboxMapOptions.getRenderSurfaceOnTop()); + MapLibreGLSurfaceView glSurfaceView = new MapLibreGLSurfaceView(getContext()); + glSurfaceView.setZOrderMediaOverlay(maplibreMapOptions.getRenderSurfaceOnTop()); mapRenderer = new GLSurfaceViewMapRenderer(getContext(), glSurfaceView, localFontFamily) { @Override public void onSurfaceCreated(GL10 gl, EGLConfig config) { @@ -340,7 +342,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { renderView = glSurfaceView; } - boolean crossSourceCollisions = mapboxMapOptions.getCrossSourceCollisions(); + boolean crossSourceCollisions = maplibreMapOptions.getCrossSourceCollisions(); nativeMapView = new NativeMapView( getContext(), getPixelRatio(), crossSourceCollisions, this, mapChangeReceiver, mapRenderer ); @@ -351,9 +353,9 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { @Override public void run() { // Initialise only when not destroyed and only once - if (!destroyed && mapboxMap == null) { + if (!destroyed && maplibreMap == null) { MapView.this.initialiseMap(); - mapboxMap.onStart(); + maplibreMap.onStart(); } } }); @@ -367,9 +369,9 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { */ @UiThread public void onSaveInstanceState(@NonNull Bundle outState) { - if (mapboxMap != null) { - outState.putBoolean(MapboxConstants.STATE_HAS_SAVED_STATE, true); - mapboxMap.onSaveInstanceState(outState); + if (maplibreMap != null) { + outState.putBoolean(MapLibreConstants.STATE_HAS_SAVED_STATE, true); + maplibreMap.onSaveInstanceState(outState); } } @@ -383,8 +385,8 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { FileSource.getInstance(getContext()).activate(); isStarted = true; } - if (mapboxMap != null) { - mapboxMap.onStart(); + if (maplibreMap != null) { + maplibreMap.onStart(); } if (mapRenderer != null) { @@ -421,10 +423,10 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { attributionClickListener.onStop(); } - if (mapboxMap != null) { + if (maplibreMap != null) { // map was destroyed before it was started mapGestureDetector.cancelAnimators(); - mapboxMap.onStop(); + maplibreMap.onStop(); } if (mapRenderer != null) { @@ -453,8 +455,8 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { compassView.resetAnimation(); } - if (mapboxMap != null) { - mapboxMap.onDestroy(); + if (maplibreMap != null) { + maplibreMap.onDestroy(); } if (nativeMapView != null) { @@ -575,7 +577,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { */ @UiThread public void onLowMemory() { - if (nativeMapView != null && mapboxMap != null && !destroyed) { + if (nativeMapView != null && maplibreMap != null && !destroyed) { nativeMapView.onLowMemory(); } } @@ -594,13 +596,13 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { /** * Returns the map pixel ratio, by default it returns the device pixel ratio. - * Can be overwritten using {@link MapboxMapOptions#pixelRatio(float)}. + * Can be overwritten using {@link MapLibreMapOptions#pixelRatio(float)}. * * @return the current map pixel ratio */ public float getPixelRatio() { // check is user defined his own pixel ratio value - float pixelRatio = mapboxMapOptions.getPixelRatio(); + float pixelRatio = maplibreMapOptions.getPixelRatio(); if (pixelRatio == 0) { // if not, get the one defined by the system pixelRatio = getResources().getDisplayMetrics().density; @@ -1044,7 +1046,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { /** * Interface definition for a callback to be invoked when the map has entered the idle state. *

- * Calling {@link MapboxMap#snapshot(MapboxMap.SnapshotReadyCallback)} from this callback + * Calling {@link MapLibreMap#snapshot(MapLibreMap.SnapshotReadyCallback)} from this callback * will result in recursive execution. Use {@link OnDidFinishRenderingFrameListener} instead. *

*

@@ -1122,17 +1124,17 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { } /** - * Sets a callback object which will be triggered when the {@link MapboxMap} instance is ready to be used. + * Sets a callback object which will be triggered when the {@link MapLibreMap} instance is ready to be used. * * @param callback The callback object that will be triggered when the map is ready to be used. */ @UiThread public void getMapAsync(final @NonNull OnMapReadyCallback callback) { - if (mapboxMap == null) { + if (maplibreMap == null) { // Add callback to the list only if the style hasn't loaded, or the drawing surface isn't ready mapCallback.addOnMapReadyCallback(callback); } else { - callback.onMapReady(mapboxMap); + callback.onMapReady(maplibreMap); } } @@ -1145,12 +1147,12 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { } @Nullable - MapboxMap getMapboxMap() { - return mapboxMap; + MapLibreMap getMapboxMap() { + return maplibreMap; } - void setMapboxMap(MapboxMap mapboxMap) { - this.mapboxMap = mapboxMap; + void setMapboxMap(MapLibreMap maplibreMap) { + this.maplibreMap = maplibreMap; } private class FocalPointInvalidator implements FocalPointChangeListener { @@ -1184,7 +1186,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { @Override public void onDidFinishRenderingFrame(boolean fully) { - if (mapboxMap != null && mapboxMap.getStyle() != null && mapboxMap.getStyle().isFullyLoaded()) { + if (maplibreMap != null && maplibreMap.getStyle() != null && maplibreMap.getStyle().isFullyLoaded()) { renderCount++; if (renderCount == 3) { MapView.this.setForeground(null); @@ -1198,75 +1200,75 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { } } - private class GesturesManagerInteractionListener implements MapboxMap.OnGesturesManagerInteractionListener { + private class GesturesManagerInteractionListener implements MapLibreMap.OnGesturesManagerInteractionListener { @Override - public void onAddMapClickListener(MapboxMap.OnMapClickListener listener) { + public void onAddMapClickListener(MapLibreMap.OnMapClickListener listener) { mapGestureDetector.addOnMapClickListener(listener); } @Override - public void onRemoveMapClickListener(MapboxMap.OnMapClickListener listener) { + public void onRemoveMapClickListener(MapLibreMap.OnMapClickListener listener) { mapGestureDetector.removeOnMapClickListener(listener); } @Override - public void onAddMapLongClickListener(MapboxMap.OnMapLongClickListener listener) { + public void onAddMapLongClickListener(MapLibreMap.OnMapLongClickListener listener) { mapGestureDetector.addOnMapLongClickListener(listener); } @Override - public void onRemoveMapLongClickListener(MapboxMap.OnMapLongClickListener listener) { + public void onRemoveMapLongClickListener(MapLibreMap.OnMapLongClickListener listener) { mapGestureDetector.removeOnMapLongClickListener(listener); } @Override - public void onAddFlingListener(MapboxMap.OnFlingListener listener) { + public void onAddFlingListener(MapLibreMap.OnFlingListener listener) { mapGestureDetector.addOnFlingListener(listener); } @Override - public void onRemoveFlingListener(MapboxMap.OnFlingListener listener) { + public void onRemoveFlingListener(MapLibreMap.OnFlingListener listener) { mapGestureDetector.removeOnFlingListener(listener); } @Override - public void onAddMoveListener(MapboxMap.OnMoveListener listener) { + public void onAddMoveListener(MapLibreMap.OnMoveListener listener) { mapGestureDetector.addOnMoveListener(listener); } @Override - public void onRemoveMoveListener(MapboxMap.OnMoveListener listener) { + public void onRemoveMoveListener(MapLibreMap.OnMoveListener listener) { mapGestureDetector.removeOnMoveListener(listener); } @Override - public void onAddRotateListener(MapboxMap.OnRotateListener listener) { + public void onAddRotateListener(MapLibreMap.OnRotateListener listener) { mapGestureDetector.addOnRotateListener(listener); } @Override - public void onRemoveRotateListener(MapboxMap.OnRotateListener listener) { + public void onRemoveRotateListener(MapLibreMap.OnRotateListener listener) { mapGestureDetector.removeOnRotateListener(listener); } @Override - public void onAddScaleListener(MapboxMap.OnScaleListener listener) { + public void onAddScaleListener(MapLibreMap.OnScaleListener listener) { mapGestureDetector.addOnScaleListener(listener); } @Override - public void onRemoveScaleListener(MapboxMap.OnScaleListener listener) { + public void onRemoveScaleListener(MapLibreMap.OnScaleListener listener) { mapGestureDetector.removeOnScaleListener(listener); } @Override - public void onAddShoveListener(MapboxMap.OnShoveListener listener) { + public void onAddShoveListener(MapLibreMap.OnShoveListener listener) { mapGestureDetector.addShoveListener(listener); } @Override - public void onRemoveShoveListener(MapboxMap.OnShoveListener listener) { + public void onRemoveShoveListener(MapLibreMap.OnShoveListener listener) { mapGestureDetector.removeShoveListener(listener); } @@ -1304,9 +1306,9 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { } void initialised() { - mapboxMap.onPreMapReady(); + maplibreMap.onPreMapReady(); onMapReady(); - mapboxMap.onPostMapReady(); + maplibreMap.onPostMapReady(); } /** @@ -1319,7 +1321,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { OnMapReadyCallback callback = iterator.next(); if (callback != null) { // null checking required for #13279 - callback.onMapReady(mapboxMap); + callback.onMapReady(maplibreMap); } iterator.remove(); } @@ -1342,43 +1344,43 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { @Override public void onDidFinishLoadingStyle() { - if (mapboxMap != null) { - mapboxMap.onFinishLoadingStyle(); + if (maplibreMap != null) { + maplibreMap.onFinishLoadingStyle(); } } @Override public void onDidFailLoadingMap(String errorMessage) { - if (mapboxMap != null) { - mapboxMap.onFailLoadingStyle(); + if (maplibreMap != null) { + maplibreMap.onFailLoadingStyle(); } } @Override public void onDidFinishRenderingFrame(boolean fully) { - if (mapboxMap != null) { - mapboxMap.onUpdateFullyRendered(); + if (maplibreMap != null) { + maplibreMap.onUpdateFullyRendered(); } } @Override public void onDidFinishLoadingMap() { - if (mapboxMap != null) { - mapboxMap.onUpdateRegionChange(); + if (maplibreMap != null) { + maplibreMap.onUpdateRegionChange(); } } @Override public void onCameraIsChanging() { - if (mapboxMap != null) { - mapboxMap.onUpdateRegionChange(); + if (maplibreMap != null) { + maplibreMap.onUpdateRegionChange(); } } @Override public void onCameraDidChange(boolean animated) { - if (mapboxMap != null) { - mapboxMap.onUpdateRegionChange(); + if (maplibreMap != null) { + maplibreMap.onUpdateRegionChange(); } } } @@ -1392,9 +1394,9 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { private final AttributionDialogManager defaultDialogManager; private UiSettings uiSettings; - private AttributionClickListener(@NonNull Context context, @NonNull MapboxMap mapboxMap) { - this.defaultDialogManager = new AttributionDialogManager(context, mapboxMap); - this.uiSettings = mapboxMap.getUiSettings(); + private AttributionClickListener(@NonNull Context context, @NonNull MapLibreMap maplibreMap) { + this.defaultDialogManager = new AttributionDialogManager(context, maplibreMap); + this.uiSettings = maplibreMap.getUiSettings(); } @Override @@ -1417,7 +1419,7 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { } /** - * Sets the strict mode that will throw the {@link com.mapbox.mapboxsdk.MapStrictModeException} + * Sets the strict mode that will throw the {@link org.maplibre.android.MapStrictModeException} * whenever the map would fail silently otherwise. * * @param strictModeEnabled true to enable the strict mode, false otherwise diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MarkerContainer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MarkerContainer.java similarity index 83% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MarkerContainer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MarkerContainer.java index 92263bfda..6a6ebceed 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MarkerContainer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/MarkerContainer.java @@ -1,14 +1,14 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.RectF; import androidx.annotation.NonNull; import androidx.collection.LongSparseArray; -import com.mapbox.mapboxsdk.annotations.Annotation; -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions; -import com.mapbox.mapboxsdk.annotations.Icon; -import com.mapbox.mapboxsdk.annotations.Marker; +import org.maplibre.android.annotations.Annotation; +import org.maplibre.android.annotations.BaseMarkerOptions; +import org.maplibre.android.annotations.Icon; +import org.maplibre.android.annotations.Marker; import java.util.ArrayList; import java.util.List; @@ -29,10 +29,10 @@ class MarkerContainer implements Markers { } @Override - public Marker addBy(@NonNull BaseMarkerOptions markerOptions, @NonNull MapboxMap mapboxMap) { + public Marker addBy(@NonNull BaseMarkerOptions markerOptions, @NonNull MapLibreMap maplibreMap) { Marker marker = prepareMarker(markerOptions); long id = nativeMapView != null ? nativeMapView.addMarker(marker) : 0; - marker.setMapboxMap(mapboxMap); + marker.setMapboxMap(maplibreMap); marker.setId(id); annotations.put(id, marker); return marker; @@ -40,8 +40,8 @@ class MarkerContainer implements Markers { @NonNull @Override - public List addBy(@NonNull List markerOptionsList, @NonNull MapboxMap - mapboxMap) { + public List addBy(@NonNull List markerOptionsList, @NonNull MapLibreMap + maplibreMap) { int count = markerOptionsList.size(); List markers = new ArrayList<>(count); if (nativeMapView != null && count > 0) { @@ -57,7 +57,7 @@ class MarkerContainer implements Markers { long[] ids = nativeMapView.addMarkers(markers); for (int i = 0; i < ids.length; i++) { Marker createdMarker = markers.get(i); - createdMarker.setMapboxMap(mapboxMap); + createdMarker.setMapboxMap(maplibreMap); createdMarker.setId(ids[i]); annotations.put(ids[i], createdMarker); } @@ -67,8 +67,8 @@ class MarkerContainer implements Markers { } @Override - public void update(@NonNull Marker updatedMarker, @NonNull MapboxMap mapboxMap) { - ensureIconLoaded(updatedMarker, mapboxMap); + public void update(@NonNull Marker updatedMarker, @NonNull MapLibreMap maplibreMap) { + ensureIconLoaded(updatedMarker, maplibreMap); nativeMapView.updateMarker(updatedMarker); annotations.setValueAt(annotations.indexOfKey(updatedMarker.getId()), updatedMarker); } @@ -102,8 +102,8 @@ class MarkerContainer implements Markers { int count = annotationList.size(); for (int i = 0; i < count; i++) { Annotation annotation = annotationList.get(i); - if (annotation instanceof com.mapbox.mapboxsdk.annotations.Marker && idsList.contains(annotation.getId())) { - annotations.add((com.mapbox.mapboxsdk.annotations.Marker) annotation); + if (annotation instanceof org.maplibre.android.annotations.Marker && idsList.contains(annotation.getId())) { + annotations.add((org.maplibre.android.annotations.Marker) annotation); } } @@ -132,8 +132,8 @@ class MarkerContainer implements Markers { return marker; } - private void ensureIconLoaded(Marker marker, @NonNull MapboxMap mapboxMap) { - iconManager.ensureIconLoaded(marker, mapboxMap); + private void ensureIconLoaded(Marker marker, @NonNull MapLibreMap maplibreMap) { + iconManager.ensureIconLoaded(marker, maplibreMap); } @NonNull diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Markers.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Markers.java similarity index 60% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Markers.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Markers.java index dcb85fa7c..691b9ad0c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Markers.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Markers.java @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.RectF; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions; -import com.mapbox.mapboxsdk.annotations.Marker; +import org.maplibre.android.annotations.BaseMarkerOptions; +import org.maplibre.android.annotations.Marker; import java.util.List; @@ -13,11 +13,11 @@ import java.util.List; * Interface that defines convenient methods for working with a {@link Marker}'s collection. */ interface Markers { - Marker addBy(@NonNull BaseMarkerOptions markerOptions, @NonNull MapboxMap mapboxMap); + Marker addBy(@NonNull BaseMarkerOptions markerOptions, @NonNull MapLibreMap maplibreMap); - List addBy(@NonNull List markerOptionsList, @NonNull MapboxMap mapboxMap); + List addBy(@NonNull List markerOptionsList, @NonNull MapLibreMap maplibreMap); - void update(@NonNull Marker updatedMarker, @NonNull MapboxMap mapboxMap); + void update(@NonNull Marker updatedMarker, @NonNull MapLibreMap maplibreMap); List obtainAll(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/NativeMap.java similarity index 88% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/NativeMap.java index 990dfde8f..36da6e418 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/NativeMap.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.Bitmap; import android.graphics.PointF; @@ -10,18 +10,18 @@ import androidx.annotation.Nullable; import com.mapbox.geojson.Feature; import com.mapbox.geojson.Geometry; -import com.mapbox.mapboxsdk.annotations.Marker; -import com.mapbox.mapboxsdk.annotations.Polygon; -import com.mapbox.mapboxsdk.annotations.Polyline; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.geometry.LatLngBounds; -import com.mapbox.mapboxsdk.geometry.ProjectedMeters; -import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.style.layers.TransitionOptions; -import com.mapbox.mapboxsdk.style.light.Light; -import com.mapbox.mapboxsdk.style.sources.Source; +import org.maplibre.android.annotations.Marker; +import org.maplibre.android.annotations.Polygon; +import org.maplibre.android.annotations.Polyline; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.geometry.LatLngBounds; +import org.maplibre.android.geometry.ProjectedMeters; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.style.layers.TransitionOptions; +import org.maplibre.android.style.light.Light; +import org.maplibre.android.style.sources.Source; import java.util.List; @@ -214,7 +214,7 @@ interface NativeMap { // Utils API // - void setOnFpsChangedListener(@NonNull MapboxMap.OnFpsChangedListener listener); + void setOnFpsChangedListener(@NonNull MapLibreMap.OnFpsChangedListener listener); void setDebug(boolean debug); @@ -285,5 +285,5 @@ interface NativeMap { long getNativePtr(); - void addSnapshotCallback(@NonNull MapboxMap.SnapshotReadyCallback callback); + void addSnapshotCallback(@NonNull MapLibreMap.SnapshotReadyCallback callback); } \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/NativeMapView.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/NativeMapView.java index bcf4a70da..5e1088c54 100755 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/NativeMapView.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.content.Context; import android.graphics.Bitmap; @@ -14,28 +14,28 @@ import androidx.annotation.Nullable; import com.mapbox.geojson.Feature; import com.mapbox.geojson.Geometry; -import com.mapbox.mapboxsdk.LibraryLoader; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.annotations.Icon; -import com.mapbox.mapboxsdk.annotations.Marker; -import com.mapbox.mapboxsdk.annotations.Polygon; -import com.mapbox.mapboxsdk.annotations.Polyline; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.exceptions.CalledFromWorkerThreadException; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.geometry.LatLngBounds; -import com.mapbox.mapboxsdk.geometry.ProjectedMeters; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.maps.renderer.MapRenderer; -import com.mapbox.mapboxsdk.storage.FileSource; -import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.layers.CannotAddLayerException; -import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.style.layers.TransitionOptions; -import com.mapbox.mapboxsdk.style.light.Light; -import com.mapbox.mapboxsdk.style.sources.CannotAddSourceException; -import com.mapbox.mapboxsdk.style.sources.Source; -import com.mapbox.mapboxsdk.utils.BitmapUtils; +import org.maplibre.android.LibraryLoader; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.annotations.Icon; +import org.maplibre.android.annotations.Marker; +import org.maplibre.android.annotations.Polygon; +import org.maplibre.android.annotations.Polyline; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.exceptions.CalledFromWorkerThreadException; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.geometry.LatLngBounds; +import org.maplibre.android.geometry.ProjectedMeters; +import org.maplibre.android.log.Logger; +import org.maplibre.android.maps.renderer.MapRenderer; +import org.maplibre.android.storage.FileSource; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.CannotAddLayerException; +import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.style.layers.TransitionOptions; +import org.maplibre.android.style.light.Light; +import org.maplibre.android.style.sources.CannotAddSourceException; +import org.maplibre.android.style.sources.Source; +import org.maplibre.android.utils.BitmapUtils; import java.util.ArrayList; import java.util.Arrays; @@ -79,7 +79,7 @@ final class NativeMapView implements NativeMap { private long nativePtr = 0; // Listener invoked to return a bitmap of the map - private MapboxMap.SnapshotReadyCallback snapshotReadyCallback; + private MapLibreMap.SnapshotReadyCallback snapshotReadyCallback; static { LibraryLoader.load(); @@ -1509,7 +1509,7 @@ final class NativeMapView implements NativeMap { // @Override - public void addSnapshotCallback(@NonNull MapboxMap.SnapshotReadyCallback callback) { + public void addSnapshotCallback(@NonNull MapLibreMap.SnapshotReadyCallback callback) { if (checkState("addSnapshotCallback")) { return; } @@ -1518,14 +1518,14 @@ final class NativeMapView implements NativeMap { } @Override - public void setOnFpsChangedListener(@Nullable final MapboxMap.OnFpsChangedListener listener) { + public void setOnFpsChangedListener(@Nullable final MapLibreMap.OnFpsChangedListener listener) { final Handler handler = new Handler(); mapRenderer.queueEvent(new Runnable() { @Override public void run() { if (listener != null) { - mapRenderer.setOnFpsChangedListener(new MapboxMap.OnFpsChangedListener() { + mapRenderer.setOnFpsChangedListener(new MapLibreMap.OnFpsChangedListener() { @Override public void onFpsChanged(final double fps) { handler.post(() -> listener.onFpsChanged(fps)); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/OnMapReadyCallback.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/OnMapReadyCallback.java similarity index 71% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/OnMapReadyCallback.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/OnMapReadyCallback.java index 8a27be1c7..639b6b460 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/OnMapReadyCallback.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/OnMapReadyCallback.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.NonNull; @@ -7,7 +7,7 @@ import androidx.annotation.NonNull; *

* Once an instance of this interface is set on a {@link MapFragment} or {@link MapView} object, * the onMapReady(MapboxMap) method is triggered when the map is ready to be used and provides an instance of - * {@link MapboxMap}. + * {@link MapLibreMap}. *

*/ public interface OnMapReadyCallback { @@ -15,8 +15,8 @@ public interface OnMapReadyCallback { /** * Called when the map is ready to be used. * - * @param mapboxMap An instance of MapboxMap associated with the {@link MapFragment} or + * @param maplibreMap An instance of MapboxMap associated with the {@link MapFragment} or * {@link MapView} that defines the callback. */ - void onMapReady(@NonNull MapboxMap mapboxMap); + void onMapReady(@NonNull MapLibreMap maplibreMap); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/PolygonContainer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/PolygonContainer.java similarity index 85% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/PolygonContainer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/PolygonContainer.java index 90d900c75..dd97ca439 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/PolygonContainer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/PolygonContainer.java @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.NonNull; import androidx.collection.LongSparseArray; -import com.mapbox.mapboxsdk.annotations.Annotation; -import com.mapbox.mapboxsdk.annotations.Polygon; -import com.mapbox.mapboxsdk.annotations.PolygonOptions; +import org.maplibre.android.annotations.Annotation; +import org.maplibre.android.annotations.Polygon; +import org.maplibre.android.annotations.PolygonOptions; import java.util.ArrayList; import java.util.List; @@ -25,12 +25,12 @@ class PolygonContainer implements Polygons { } @Override - public Polygon addBy(@NonNull PolygonOptions polygonOptions, @NonNull MapboxMap mapboxMap) { + public Polygon addBy(@NonNull PolygonOptions polygonOptions, @NonNull MapLibreMap maplibreMap) { Polygon polygon = polygonOptions.getPolygon(); if (!polygon.getPoints().isEmpty()) { long id = nativeMap != null ? nativeMap.addPolygon(polygon) : 0; polygon.setId(id); - polygon.setMapboxMap(mapboxMap); + polygon.setMapboxMap(maplibreMap); annotations.put(id, polygon); } return polygon; @@ -38,7 +38,7 @@ class PolygonContainer implements Polygons { @NonNull @Override - public List addBy(@NonNull List polygonOptionsList, @NonNull MapboxMap mapboxMap) { + public List addBy(@NonNull List polygonOptionsList, @NonNull MapLibreMap maplibreMap) { int count = polygonOptionsList.size(); Polygon polygon; @@ -54,7 +54,7 @@ class PolygonContainer implements Polygons { long[] ids = nativeMap.addPolygons(polygons); for (int i = 0; i < ids.length; i++) { polygon = polygons.get(i); - polygon.setMapboxMap(mapboxMap); + polygon.setMapboxMap(maplibreMap); polygon.setId(ids[i]); annotations.put(ids[i], polygon); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Polygons.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Polygons.java similarity index 64% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Polygons.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Polygons.java index 0bec558e9..96b7c4ebc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Polygons.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Polygons.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.annotations.Polygon; -import com.mapbox.mapboxsdk.annotations.PolygonOptions; +import org.maplibre.android.annotations.Polygon; +import org.maplibre.android.annotations.PolygonOptions; import java.util.List; @@ -12,9 +12,9 @@ import java.util.List; * Interface that defines convenient methods for working with a {@link Polygon}'s collection. */ interface Polygons { - Polygon addBy(@NonNull PolygonOptions polygonOptions, @NonNull MapboxMap mapboxMap); + Polygon addBy(@NonNull PolygonOptions polygonOptions, @NonNull MapLibreMap maplibreMap); - List addBy(@NonNull List polygonOptionsList, @NonNull MapboxMap mapboxMap); + List addBy(@NonNull List polygonOptionsList, @NonNull MapLibreMap maplibreMap); void update(Polygon polygon); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/PolylineContainer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/PolylineContainer.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/PolylineContainer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/PolylineContainer.java index 4de35a1f2..8e68f0635 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/PolylineContainer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/PolylineContainer.java @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.NonNull; import androidx.collection.LongSparseArray; -import com.mapbox.mapboxsdk.annotations.Annotation; -import com.mapbox.mapboxsdk.annotations.Polyline; -import com.mapbox.mapboxsdk.annotations.PolylineOptions; +import org.maplibre.android.annotations.Annotation; +import org.maplibre.android.annotations.Polyline; +import org.maplibre.android.annotations.PolylineOptions; import java.util.ArrayList; import java.util.List; @@ -25,11 +25,11 @@ class PolylineContainer implements Polylines { } @Override - public Polyline addBy(@NonNull PolylineOptions polylineOptions, @NonNull MapboxMap mapboxMap) { + public Polyline addBy(@NonNull PolylineOptions polylineOptions, @NonNull MapLibreMap maplibreMap) { Polyline polyline = polylineOptions.getPolyline(); if (!polyline.getPoints().isEmpty()) { long id = nativeMap != null ? nativeMap.addPolyline(polyline) : 0; - polyline.setMapboxMap(mapboxMap); + polyline.setMapboxMap(maplibreMap); polyline.setId(id); annotations.put(id, polyline); } @@ -38,7 +38,7 @@ class PolylineContainer implements Polylines { @NonNull @Override - public List addBy(@NonNull List polylineOptionsList, @NonNull MapboxMap mapboxMap) { + public List addBy(@NonNull List polylineOptionsList, @NonNull MapLibreMap maplibreMap) { int count = polylineOptionsList.size(); Polyline polyline; List polylines = new ArrayList<>(count); @@ -53,7 +53,7 @@ class PolylineContainer implements Polylines { long[] ids = nativeMap.addPolylines(polylines); for (int i = 0; i < ids.length; i++) { Polyline polylineCreated = polylines.get(i); - polylineCreated.setMapboxMap(mapboxMap); + polylineCreated.setMapboxMap(maplibreMap); polylineCreated.setId(ids[i]); annotations.put(ids[i], polylineCreated); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Polylines.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Polylines.java similarity index 63% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Polylines.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Polylines.java index 10b53e6a6..80cfa2865 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Polylines.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Polylines.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.annotations.Polyline; -import com.mapbox.mapboxsdk.annotations.PolylineOptions; +import org.maplibre.android.annotations.Polyline; +import org.maplibre.android.annotations.PolylineOptions; import java.util.List; @@ -12,9 +12,9 @@ import java.util.List; * Interface that defines convenient methods for working with a {@link Polyline}'s collection. */ interface Polylines { - Polyline addBy(@NonNull PolylineOptions polylineOptions, @NonNull MapboxMap mapboxMap); + Polyline addBy(@NonNull PolylineOptions polylineOptions, @NonNull MapLibreMap maplibreMap); - List addBy(@NonNull List polylineOptionsList, @NonNull MapboxMap mapboxMap); + List addBy(@NonNull List polylineOptionsList, @NonNull MapLibreMap maplibreMap); void update(Polyline polyline); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Projection.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Projection.java index b4a497634..2bde9ea97 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Projection.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.PointF; @@ -6,11 +6,11 @@ import androidx.annotation.FloatRange; import androidx.annotation.NonNull; import com.mapbox.geojson.Point; -import com.mapbox.mapboxsdk.constants.GeometryConstants; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.geometry.LatLngBounds; -import com.mapbox.mapboxsdk.geometry.ProjectedMeters; -import com.mapbox.mapboxsdk.geometry.VisibleRegion; +import org.maplibre.android.constants.GeometryConstants; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.geometry.LatLngBounds; +import org.maplibre.android.geometry.ProjectedMeters; +import org.maplibre.android.geometry.VisibleRegion; import java.util.ArrayList; import java.util.List; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ShapeAnnotationContainer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ShapeAnnotationContainer.java similarity index 93% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ShapeAnnotationContainer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ShapeAnnotationContainer.java index b47597dad..2f87dccfd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ShapeAnnotationContainer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ShapeAnnotationContainer.java @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.RectF; import androidx.annotation.NonNull; import androidx.collection.LongSparseArray; -import com.mapbox.mapboxsdk.annotations.Annotation; +import org.maplibre.android.annotations.Annotation; import java.util.ArrayList; import java.util.List; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ShapeAnnotations.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ShapeAnnotations.java similarity index 60% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ShapeAnnotations.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ShapeAnnotations.java index f9b2ca10d..87354854d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/ShapeAnnotations.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/ShapeAnnotations.java @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.RectF; -import com.mapbox.mapboxsdk.annotations.Annotation; +import org.maplibre.android.annotations.Annotation; import java.util.List; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Style.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Style.java index a8f4bce2a..baa077236 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Style.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Style.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; @@ -10,14 +10,14 @@ import androidx.annotation.IntRange; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.Mapbox; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.style.layers.Layer; -import com.mapbox.mapboxsdk.style.layers.TransitionOptions; -import com.mapbox.mapboxsdk.style.light.Light; -import com.mapbox.mapboxsdk.style.sources.Source; -import com.mapbox.mapboxsdk.util.DefaultStyle; -import com.mapbox.mapboxsdk.utils.BitmapUtils; +import org.maplibre.android.MapLibre; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.style.layers.TransitionOptions; +import org.maplibre.android.style.light.Light; +import org.maplibre.android.style.sources.Source; +import org.maplibre.android.util.DefaultStyle; +import org.maplibre.android.utils.BitmapUtils; import java.lang.ref.WeakReference; import java.nio.ByteBuffer; @@ -31,7 +31,7 @@ import java.util.Map; * The proxy object for current map style. *

* To create new instances of this object, create a new instance using a {@link Builder} and load the style with - * MapboxMap. This object is returned from {@link MapboxMap#getStyle()} once the style + * MapboxMap. This object is returned from {@link MapLibreMap#getStyle()} once the style * has been loaded by underlying map. *

*/ @@ -741,7 +741,7 @@ public class Style { addLayerBelow(layerWrapper.layer, ((Builder.LayerBelowWrapper) layerWrapper).belowLayer); } else { // just add layer to map, but below annotations - addLayerBelow(layerWrapper.layer, MapboxConstants.LAYER_ID_ANNOTATIONS); + addLayerBelow(layerWrapper.layer, MapLibreConstants.LAYER_ID_ANNOTATIONS); } } @@ -851,7 +851,7 @@ public class Style { *

* This method is asynchronous and will return before the style finishes loading. * If you wish to wait for the map to finish loading, listen to the {@link MapView.OnDidFinishLoadingStyleListener} - * callback or use {@link MapboxMap#setStyle(String, OnStyleLoaded)} instead. + * callback or use {@link MapLibreMap#setStyle(String, OnStyleLoaded)} instead. *

* If the style fails to load or an invalid style URI is set, the map view will become blank. * An error message will be logged in the Android logcat and {@link MapView.OnDidFailLoadingMapListener} callback @@ -1413,7 +1413,7 @@ public class Style { * @return The list of predefined styles */ public static DefaultStyle[] getPredefinedStyles() { - return Mapbox.getPredefinedStyles(); + return MapLibre.getPredefinedStyles(); } /** @@ -1423,7 +1423,7 @@ public class Style { */ @NonNull public static String getPredefinedStyle(String name) { - DefaultStyle style = Mapbox.getPredefinedStyle(name); + DefaultStyle style = MapLibre.getPredefinedStyle(name); if (style != null) { return style.getUrl(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/SupportMapFragment.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/SupportMapFragment.java similarity index 89% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/SupportMapFragment.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/SupportMapFragment.java index 8fb03b896..c895d509e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/SupportMapFragment.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/SupportMapFragment.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.content.Context; import android.os.Bundle; @@ -11,7 +11,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; -import com.mapbox.mapboxsdk.utils.MapFragmentUtils; +import org.maplibre.android.utils.MapFragmentUtils; import java.util.ArrayList; import java.util.List; @@ -34,7 +34,7 @@ public class SupportMapFragment extends Fragment implements OnMapReadyCallback { private final List mapReadyCallbackList = new ArrayList<>(); private MapFragment.OnMapViewReadyCallback mapViewReadyCallback; - private MapboxMap mapboxMap; + private MapLibreMap maplibreMap; private MapView map; /** @@ -49,13 +49,13 @@ public class SupportMapFragment extends Fragment implements OnMapReadyCallback { /** * Creates a MapFragment instance * - * @param mapboxMapOptions The configuration options to be used. + * @param maplibreMapOptions The configuration options to be used. * @return MapFragment created. */ @NonNull - public static SupportMapFragment newInstance(@Nullable MapboxMapOptions mapboxMapOptions) { + public static SupportMapFragment newInstance(@Nullable MapLibreMapOptions maplibreMapOptions) { SupportMapFragment mapFragment = new SupportMapFragment(); - mapFragment.setArguments(MapFragmentUtils.createFragmentArgs(mapboxMapOptions)); + mapFragment.setArguments(MapFragmentUtils.createFragmentArgs(maplibreMapOptions)); return mapFragment; } @@ -82,7 +82,7 @@ public class SupportMapFragment extends Fragment implements OnMapReadyCallback { @Override public void onInflate(@NonNull Context context, AttributeSet attrs, Bundle savedInstanceState) { super.onInflate(context, attrs, savedInstanceState); - setArguments(MapFragmentUtils.createFragmentArgs(MapboxMapOptions.createFromAttributes(context, attrs))); + setArguments(MapFragmentUtils.createFragmentArgs(MapLibreMapOptions.createFromAttributes(context, attrs))); } /** @@ -120,10 +120,10 @@ public class SupportMapFragment extends Fragment implements OnMapReadyCallback { } @Override - public void onMapReady(@NonNull MapboxMap mapboxMap) { - this.mapboxMap = mapboxMap; + public void onMapReady(@NonNull MapLibreMap maplibreMap) { + this.maplibreMap = maplibreMap; for (OnMapReadyCallback onMapReadyCallback : mapReadyCallbackList) { - onMapReadyCallback.onMapReady(mapboxMap); + onMapReadyCallback.onMapReady(maplibreMap); } } @@ -211,10 +211,10 @@ public class SupportMapFragment extends Fragment implements OnMapReadyCallback { * @param onMapReadyCallback The callback to be invoked. */ public void getMapAsync(@NonNull final OnMapReadyCallback onMapReadyCallback) { - if (mapboxMap == null) { + if (maplibreMap == null) { mapReadyCallbackList.add(onMapReadyCallback); } else { - onMapReadyCallback.onMapReady(mapboxMap); + onMapReadyCallback.onMapReady(maplibreMap); } } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Transform.java similarity index 82% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Transform.java index 0323591ae..56efd57f8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/Transform.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.graphics.PointF; import android.os.Handler; @@ -7,14 +7,14 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.camera.CameraUpdate; -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.camera.CameraUpdate; +import org.maplibre.android.camera.CameraUpdateFactory; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.geometry.LatLng; +import org.maplibre.android.log.Logger; -import static com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraMoveStartedListener; +import static org.maplibre.android.maps.MapLibreMap.OnCameraMoveStartedListener; /** * Internal use. @@ -36,7 +36,7 @@ public final class Transform implements MapView.OnCameraDidChangeListener { @Nullable private CameraPosition cameraPosition; @Nullable - private MapboxMap.CancelableCallback cameraCancelableCallback; + private MapLibreMap.CancelableCallback cameraCancelableCallback; private CameraChangeDispatcher cameraChangeDispatcher; private final MapView.OnCameraDidChangeListener moveByChangeListener = new MapView.OnCameraDidChangeListener() { @@ -55,10 +55,10 @@ public final class Transform implements MapView.OnCameraDidChangeListener { this.cameraChangeDispatcher = cameraChangeDispatcher; } - void initialise(@NonNull MapboxMap mapboxMap, @NonNull MapboxMapOptions options) { + void initialise(@NonNull MapLibreMap maplibreMap, @NonNull MapLibreMapOptions options) { CameraPosition position = options.getCamera(); if (position != null && !position.equals(CameraPosition.DEFAULT)) { - moveCamera(mapboxMap, CameraUpdateFactory.newCameraPosition(position), null); + moveCamera(maplibreMap, CameraUpdateFactory.newCameraPosition(position), null); } setMinZoom(options.getMinZoomPreference()); setMaxZoom(options.getMaxZoomPreference()); @@ -84,7 +84,7 @@ public final class Transform implements MapView.OnCameraDidChangeListener { if (animated) { invalidateCameraPosition(); if (cameraCancelableCallback != null) { - final MapboxMap.CancelableCallback callback = cameraCancelableCallback; + final MapLibreMap.CancelableCallback callback = cameraCancelableCallback; // nullification has to happen before Handler#post, see https://github.com/robolectric/robolectric/issues/1306 cameraCancelableCallback = null; @@ -105,9 +105,9 @@ public final class Transform implements MapView.OnCameraDidChangeListener { * Internal use. */ @UiThread - public final void moveCamera(@NonNull MapboxMap mapboxMap, CameraUpdate update, - @Nullable final MapboxMap.CancelableCallback callback) { - CameraPosition cameraPosition = update.getCameraPosition(mapboxMap); + public final void moveCamera(@NonNull MapLibreMap maplibreMap, CameraUpdate update, + @Nullable final MapLibreMap.CancelableCallback callback) { + CameraPosition cameraPosition = update.getCameraPosition(maplibreMap); if (isValidCameraPosition(cameraPosition)) { cancelTransitions(); cameraChangeDispatcher.onCameraMoveStarted(OnCameraMoveStartedListener.REASON_API_ANIMATION); @@ -129,9 +129,10 @@ public final class Transform implements MapView.OnCameraDidChangeListener { } @UiThread - final void easeCamera(@NonNull MapboxMap mapboxMap, CameraUpdate update, int durationMs, boolean easingInterpolator, - @Nullable final MapboxMap.CancelableCallback callback) { - CameraPosition cameraPosition = update.getCameraPosition(mapboxMap); + final void easeCamera(@NonNull MapLibreMap maplibreMap, CameraUpdate update, int durationMs, + boolean easingInterpolator, + @Nullable final MapLibreMap.CancelableCallback callback) { + CameraPosition cameraPosition = update.getCameraPosition(maplibreMap); if (isValidCameraPosition(cameraPosition)) { cancelTransitions(); cameraChangeDispatcher.onCameraMoveStarted(OnCameraMoveStartedListener.REASON_API_ANIMATION); @@ -151,9 +152,9 @@ public final class Transform implements MapView.OnCameraDidChangeListener { * Internal use. */ @UiThread - public final void animateCamera(@NonNull MapboxMap mapboxMap, CameraUpdate update, int durationMs, - @Nullable final MapboxMap.CancelableCallback callback) { - CameraPosition cameraPosition = update.getCameraPosition(mapboxMap); + public final void animateCamera(@NonNull MapLibreMap maplibreMap, CameraUpdate update, int durationMs, + @Nullable final MapLibreMap.CancelableCallback callback) { + CameraPosition cameraPosition = update.getCameraPosition(maplibreMap); if (isValidCameraPosition(cameraPosition)) { cancelTransitions(); cameraChangeDispatcher.onCameraMoveStarted(OnCameraMoveStartedListener.REASON_API_ANIMATION); @@ -193,7 +194,7 @@ public final class Transform implements MapView.OnCameraDidChangeListener { // notify animateCamera and easeCamera about cancelling if (cameraCancelableCallback != null) { - final MapboxMap.CancelableCallback callback = cameraCancelableCallback; + final MapLibreMap.CancelableCallback callback = cameraCancelableCallback; cameraChangeDispatcher.onCameraIdle(); // nullification has to happen before Handler#post, see https://github.com/robolectric/robolectric/issues/1306 @@ -319,7 +320,7 @@ public final class Transform implements MapView.OnCameraDidChangeListener { // void setMinZoom(double minZoom) { - if ((minZoom < MapboxConstants.MINIMUM_ZOOM) || (minZoom > MapboxConstants.MAXIMUM_ZOOM)) { + if ((minZoom < MapLibreConstants.MINIMUM_ZOOM) || (minZoom > MapLibreConstants.MAXIMUM_ZOOM)) { Logger.e(TAG, String.format("Not setting minZoomPreference, value is in unsupported range: %s", minZoom)); return; } @@ -331,7 +332,7 @@ public final class Transform implements MapView.OnCameraDidChangeListener { } void setMaxZoom(double maxZoom) { - if ((maxZoom < MapboxConstants.MINIMUM_ZOOM) || (maxZoom > MapboxConstants.MAXIMUM_ZOOM)) { + if ((maxZoom < MapLibreConstants.MINIMUM_ZOOM) || (maxZoom > MapLibreConstants.MAXIMUM_ZOOM)) { Logger.e(TAG, String.format("Not setting maxZoomPreference, value is in unsupported range: %s", maxZoom)); return; } @@ -343,7 +344,7 @@ public final class Transform implements MapView.OnCameraDidChangeListener { } void setMinPitch(double minPitch) { - if ((minPitch < MapboxConstants.MINIMUM_PITCH) || (minPitch > MapboxConstants.MAXIMUM_PITCH)) { + if ((minPitch < MapLibreConstants.MINIMUM_PITCH) || (minPitch > MapLibreConstants.MAXIMUM_PITCH)) { Logger.e(TAG, String.format("Not setting minPitchPreference, value is in unsupported range: %s", minPitch)); return; } @@ -355,7 +356,7 @@ public final class Transform implements MapView.OnCameraDidChangeListener { } void setMaxPitch(double maxPitch) { - if ((maxPitch < MapboxConstants.MINIMUM_PITCH) || (maxPitch > MapboxConstants.MAXIMUM_PITCH)) { + if ((maxPitch < MapLibreConstants.MINIMUM_PITCH) || (maxPitch > MapLibreConstants.MAXIMUM_PITCH)) { Logger.e(TAG, String.format("Not setting maxPitchPreference, value is in unsupported range: %s", maxPitch)); return; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/UiSettings.java similarity index 81% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/UiSettings.java index 1836e667c..d8a89da9b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/UiSettings.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/UiSettings.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps; +package org.maplibre.android.maps; import android.content.Context; import android.content.res.Resources; @@ -21,12 +21,12 @@ import androidx.annotation.VisibleForTesting; import androidx.core.content.ContextCompat; import androidx.core.content.res.ResourcesCompat; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.camera.CameraPosition; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.maps.widgets.CompassView; -import com.mapbox.mapboxsdk.utils.BitmapUtils; -import com.mapbox.mapboxsdk.utils.ColorUtils; +import org.maplibre.android.R; +import org.maplibre.android.camera.CameraPosition; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.maps.widgets.CompassView; +import org.maplibre.android.utils.BitmapUtils; +import org.maplibre.android.utils.ColorUtils; /** * Settings for the user interface of a MapboxMap. To obtain this interface, call getUiSettings(). @@ -83,8 +83,8 @@ public final class UiSettings { private boolean deselectMarkersOnTap = true; - private long flingAnimationBaseTime = MapboxConstants.ANIMATION_DURATION_FLING_BASE; - private long flingThreshold = MapboxConstants.VELOCITY_THRESHOLD_IGNORE_FLING; + private long flingAnimationBaseTime = MapLibreConstants.ANIMATION_DURATION_FLING_BASE; + private long flingThreshold = MapLibreConstants.VELOCITY_THRESHOLD_IGNORE_FLING; @Nullable private PointF userProvidedFocalPoint; @@ -105,7 +105,7 @@ public final class UiSettings { this.mapView = mapView; } - void initialise(@NonNull Context context, @NonNull MapboxMapOptions options) { + void initialise(@NonNull Context context, @NonNull MapLibreMapOptions options) { Resources resources = context.getResources(); initialiseGestures(options); if (options.getCompassEnabled()) { @@ -137,7 +137,7 @@ public final class UiSettings { restoreFocalPoint(savedInstanceState); } - private void initialiseGestures(MapboxMapOptions options) { + private void initialiseGestures(MapLibreMapOptions options) { setZoomGesturesEnabled(options.getZoomGesturesEnabled()); setScrollGesturesEnabled(options.getScrollGesturesEnabled()); setHorizontalScrollGesturesEnabled(options.getHorizontalScrollGesturesEnabled()); @@ -148,42 +148,42 @@ public final class UiSettings { } private void saveGestures(Bundle outState) { - outState.putBoolean(MapboxConstants.STATE_HORIZONAL_SCROLL_ENABLED, isHorizontalScrollGesturesEnabled()); - outState.putBoolean(MapboxConstants.STATE_ZOOM_ENABLED, isZoomGesturesEnabled()); - outState.putBoolean(MapboxConstants.STATE_SCROLL_ENABLED, isScrollGesturesEnabled()); - outState.putBoolean(MapboxConstants.STATE_ROTATE_ENABLED, isRotateGesturesEnabled()); - outState.putBoolean(MapboxConstants.STATE_TILT_ENABLED, isTiltGesturesEnabled()); - outState.putBoolean(MapboxConstants.STATE_DOUBLE_TAP_ENABLED, isDoubleTapGesturesEnabled()); - outState.putBoolean(MapboxConstants.STATE_SCALE_ANIMATION_ENABLED, isScaleVelocityAnimationEnabled()); - outState.putBoolean(MapboxConstants.STATE_ROTATE_ANIMATION_ENABLED, isRotateVelocityAnimationEnabled()); - outState.putBoolean(MapboxConstants.STATE_FLING_ANIMATION_ENABLED, isFlingVelocityAnimationEnabled()); - outState.putBoolean(MapboxConstants.STATE_INCREASE_ROTATE_THRESHOLD, isIncreaseRotateThresholdWhenScaling()); - outState.putBoolean(MapboxConstants.STATE_DISABLE_ROTATE_WHEN_SCALING, isDisableRotateWhenScaling()); - outState.putBoolean(MapboxConstants.STATE_INCREASE_SCALE_THRESHOLD, isIncreaseScaleThresholdWhenRotating()); - outState.putBoolean(MapboxConstants.STATE_QUICK_ZOOM_ENABLED, isQuickZoomGesturesEnabled()); - outState.putFloat(MapboxConstants.STATE_ZOOM_RATE, getZoomRate()); + outState.putBoolean(MapLibreConstants.STATE_HORIZONAL_SCROLL_ENABLED, isHorizontalScrollGesturesEnabled()); + outState.putBoolean(MapLibreConstants.STATE_ZOOM_ENABLED, isZoomGesturesEnabled()); + outState.putBoolean(MapLibreConstants.STATE_SCROLL_ENABLED, isScrollGesturesEnabled()); + outState.putBoolean(MapLibreConstants.STATE_ROTATE_ENABLED, isRotateGesturesEnabled()); + outState.putBoolean(MapLibreConstants.STATE_TILT_ENABLED, isTiltGesturesEnabled()); + outState.putBoolean(MapLibreConstants.STATE_DOUBLE_TAP_ENABLED, isDoubleTapGesturesEnabled()); + outState.putBoolean(MapLibreConstants.STATE_SCALE_ANIMATION_ENABLED, isScaleVelocityAnimationEnabled()); + outState.putBoolean(MapLibreConstants.STATE_ROTATE_ANIMATION_ENABLED, isRotateVelocityAnimationEnabled()); + outState.putBoolean(MapLibreConstants.STATE_FLING_ANIMATION_ENABLED, isFlingVelocityAnimationEnabled()); + outState.putBoolean(MapLibreConstants.STATE_INCREASE_ROTATE_THRESHOLD, isIncreaseRotateThresholdWhenScaling()); + outState.putBoolean(MapLibreConstants.STATE_DISABLE_ROTATE_WHEN_SCALING, isDisableRotateWhenScaling()); + outState.putBoolean(MapLibreConstants.STATE_INCREASE_SCALE_THRESHOLD, isIncreaseScaleThresholdWhenRotating()); + outState.putBoolean(MapLibreConstants.STATE_QUICK_ZOOM_ENABLED, isQuickZoomGesturesEnabled()); + outState.putFloat(MapLibreConstants.STATE_ZOOM_RATE, getZoomRate()); } private void restoreGestures(Bundle savedInstanceState) { - setHorizontalScrollGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_HORIZONAL_SCROLL_ENABLED)); - setZoomGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_ZOOM_ENABLED)); - setScrollGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_SCROLL_ENABLED)); - setRotateGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_ROTATE_ENABLED)); - setTiltGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_TILT_ENABLED)); - setDoubleTapGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_DOUBLE_TAP_ENABLED)); - setScaleVelocityAnimationEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_SCALE_ANIMATION_ENABLED)); - setRotateVelocityAnimationEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_ROTATE_ANIMATION_ENABLED)); - setFlingVelocityAnimationEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_FLING_ANIMATION_ENABLED)); + setHorizontalScrollGesturesEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_HORIZONAL_SCROLL_ENABLED)); + setZoomGesturesEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_ZOOM_ENABLED)); + setScrollGesturesEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_SCROLL_ENABLED)); + setRotateGesturesEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_ROTATE_ENABLED)); + setTiltGesturesEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_TILT_ENABLED)); + setDoubleTapGesturesEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_DOUBLE_TAP_ENABLED)); + setScaleVelocityAnimationEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_SCALE_ANIMATION_ENABLED)); + setRotateVelocityAnimationEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_ROTATE_ANIMATION_ENABLED)); + setFlingVelocityAnimationEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_FLING_ANIMATION_ENABLED)); setIncreaseRotateThresholdWhenScaling( - savedInstanceState.getBoolean(MapboxConstants.STATE_INCREASE_ROTATE_THRESHOLD)); - setDisableRotateWhenScaling(savedInstanceState.getBoolean(MapboxConstants.STATE_DISABLE_ROTATE_WHEN_SCALING)); + savedInstanceState.getBoolean(MapLibreConstants.STATE_INCREASE_ROTATE_THRESHOLD)); + setDisableRotateWhenScaling(savedInstanceState.getBoolean(MapLibreConstants.STATE_DISABLE_ROTATE_WHEN_SCALING)); setIncreaseScaleThresholdWhenRotating( - savedInstanceState.getBoolean(MapboxConstants.STATE_INCREASE_SCALE_THRESHOLD)); - setQuickZoomGesturesEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_QUICK_ZOOM_ENABLED)); - setZoomRate(savedInstanceState.getFloat(MapboxConstants.STATE_ZOOM_RATE, 1.0f)); + savedInstanceState.getBoolean(MapLibreConstants.STATE_INCREASE_SCALE_THRESHOLD)); + setQuickZoomGesturesEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_QUICK_ZOOM_ENABLED)); + setZoomRate(savedInstanceState.getFloat(MapLibreConstants.STATE_ZOOM_RATE, 1.0f)); } - private void initialiseCompass(MapboxMapOptions options, @NonNull Resources resources) { + private void initialiseCompass(MapLibreMapOptions options, @NonNull Resources resources) { isCompassInitialized = true; compassView = mapView.initialiseCompassView(); setCompassEnabled(options.getCompassEnabled()); @@ -203,35 +203,35 @@ public final class UiSettings { } private void saveCompass(Bundle outState) { - outState.putBoolean(MapboxConstants.STATE_COMPASS_ENABLED, isCompassEnabled()); - outState.putInt(MapboxConstants.STATE_COMPASS_GRAVITY, getCompassGravity()); - outState.putInt(MapboxConstants.STATE_COMPASS_MARGIN_LEFT, getCompassMarginLeft()); - outState.putInt(MapboxConstants.STATE_COMPASS_MARGIN_TOP, getCompassMarginTop()); - outState.putInt(MapboxConstants.STATE_COMPASS_MARGIN_BOTTOM, getCompassMarginBottom()); - outState.putInt(MapboxConstants.STATE_COMPASS_MARGIN_RIGHT, getCompassMarginRight()); - outState.putBoolean(MapboxConstants.STATE_COMPASS_FADE_WHEN_FACING_NORTH, isCompassFadeWhenFacingNorth()); - outState.putByteArray(MapboxConstants.STATE_COMPASS_IMAGE_BITMAP, + outState.putBoolean(MapLibreConstants.STATE_COMPASS_ENABLED, isCompassEnabled()); + outState.putInt(MapLibreConstants.STATE_COMPASS_GRAVITY, getCompassGravity()); + outState.putInt(MapLibreConstants.STATE_COMPASS_MARGIN_LEFT, getCompassMarginLeft()); + outState.putInt(MapLibreConstants.STATE_COMPASS_MARGIN_TOP, getCompassMarginTop()); + outState.putInt(MapLibreConstants.STATE_COMPASS_MARGIN_BOTTOM, getCompassMarginBottom()); + outState.putInt(MapLibreConstants.STATE_COMPASS_MARGIN_RIGHT, getCompassMarginRight()); + outState.putBoolean(MapLibreConstants.STATE_COMPASS_FADE_WHEN_FACING_NORTH, isCompassFadeWhenFacingNorth()); + outState.putByteArray(MapLibreConstants.STATE_COMPASS_IMAGE_BITMAP, BitmapUtils.getByteArrayFromDrawable(getCompassImage())); } private void restoreCompass(Bundle savedInstanceState) { - boolean compassEnabled = savedInstanceState.getBoolean(MapboxConstants.STATE_COMPASS_ENABLED); + boolean compassEnabled = savedInstanceState.getBoolean(MapLibreConstants.STATE_COMPASS_ENABLED); if (compassEnabled && !isCompassInitialized) { compassView = mapView.initialiseCompassView(); isCompassInitialized = true; } - setCompassEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_COMPASS_ENABLED)); - setCompassGravity(savedInstanceState.getInt(MapboxConstants.STATE_COMPASS_GRAVITY)); - setCompassMargins(savedInstanceState.getInt(MapboxConstants.STATE_COMPASS_MARGIN_LEFT), - savedInstanceState.getInt(MapboxConstants.STATE_COMPASS_MARGIN_TOP), - savedInstanceState.getInt(MapboxConstants.STATE_COMPASS_MARGIN_RIGHT), - savedInstanceState.getInt(MapboxConstants.STATE_COMPASS_MARGIN_BOTTOM)); - setCompassFadeFacingNorth(savedInstanceState.getBoolean(MapboxConstants.STATE_COMPASS_FADE_WHEN_FACING_NORTH)); + setCompassEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_COMPASS_ENABLED)); + setCompassGravity(savedInstanceState.getInt(MapLibreConstants.STATE_COMPASS_GRAVITY)); + setCompassMargins(savedInstanceState.getInt(MapLibreConstants.STATE_COMPASS_MARGIN_LEFT), + savedInstanceState.getInt(MapLibreConstants.STATE_COMPASS_MARGIN_TOP), + savedInstanceState.getInt(MapLibreConstants.STATE_COMPASS_MARGIN_RIGHT), + savedInstanceState.getInt(MapLibreConstants.STATE_COMPASS_MARGIN_BOTTOM)); + setCompassFadeFacingNorth(savedInstanceState.getBoolean(MapLibreConstants.STATE_COMPASS_FADE_WHEN_FACING_NORTH)); setCompassImage(BitmapUtils.getDrawableFromByteArray( - mapView.getContext(), savedInstanceState.getByteArray(MapboxConstants.STATE_COMPASS_IMAGE_BITMAP))); + mapView.getContext(), savedInstanceState.getByteArray(MapLibreConstants.STATE_COMPASS_IMAGE_BITMAP))); } - private void initialiseLogo(MapboxMapOptions options, @NonNull Resources resources) { + private void initialiseLogo(MapLibreMapOptions options, @NonNull Resources resources) { isLogoInitialized = true; logoView = mapView.initialiseLogoView(); setLogoEnabled(options.getLogoEnabled()); @@ -250,29 +250,29 @@ public final class UiSettings { } private void saveLogo(Bundle outState) { - outState.putInt(MapboxConstants.STATE_LOGO_GRAVITY, getLogoGravity()); - outState.putInt(MapboxConstants.STATE_LOGO_MARGIN_LEFT, getLogoMarginLeft()); - outState.putInt(MapboxConstants.STATE_LOGO_MARGIN_TOP, getLogoMarginTop()); - outState.putInt(MapboxConstants.STATE_LOGO_MARGIN_RIGHT, getLogoMarginRight()); - outState.putInt(MapboxConstants.STATE_LOGO_MARGIN_BOTTOM, getLogoMarginBottom()); - outState.putBoolean(MapboxConstants.STATE_LOGO_ENABLED, isLogoEnabled()); + outState.putInt(MapLibreConstants.STATE_LOGO_GRAVITY, getLogoGravity()); + outState.putInt(MapLibreConstants.STATE_LOGO_MARGIN_LEFT, getLogoMarginLeft()); + outState.putInt(MapLibreConstants.STATE_LOGO_MARGIN_TOP, getLogoMarginTop()); + outState.putInt(MapLibreConstants.STATE_LOGO_MARGIN_RIGHT, getLogoMarginRight()); + outState.putInt(MapLibreConstants.STATE_LOGO_MARGIN_BOTTOM, getLogoMarginBottom()); + outState.putBoolean(MapLibreConstants.STATE_LOGO_ENABLED, isLogoEnabled()); } private void restoreLogo(Bundle savedInstanceState) { - boolean logoEnabled = savedInstanceState.getBoolean(MapboxConstants.STATE_LOGO_ENABLED); + boolean logoEnabled = savedInstanceState.getBoolean(MapLibreConstants.STATE_LOGO_ENABLED); if (logoEnabled && !isLogoInitialized) { logoView = mapView.initialiseLogoView(); isLogoInitialized = true; } - setLogoEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_LOGO_ENABLED)); - setLogoGravity(savedInstanceState.getInt(MapboxConstants.STATE_LOGO_GRAVITY)); - setLogoMargins(savedInstanceState.getInt(MapboxConstants.STATE_LOGO_MARGIN_LEFT), - savedInstanceState.getInt(MapboxConstants.STATE_LOGO_MARGIN_TOP), - savedInstanceState.getInt(MapboxConstants.STATE_LOGO_MARGIN_RIGHT), - savedInstanceState.getInt(MapboxConstants.STATE_LOGO_MARGIN_BOTTOM)); + setLogoEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_LOGO_ENABLED)); + setLogoGravity(savedInstanceState.getInt(MapLibreConstants.STATE_LOGO_GRAVITY)); + setLogoMargins(savedInstanceState.getInt(MapLibreConstants.STATE_LOGO_MARGIN_LEFT), + savedInstanceState.getInt(MapLibreConstants.STATE_LOGO_MARGIN_TOP), + savedInstanceState.getInt(MapLibreConstants.STATE_LOGO_MARGIN_RIGHT), + savedInstanceState.getInt(MapLibreConstants.STATE_LOGO_MARGIN_BOTTOM)); } - private void initialiseAttribution(@NonNull Context context, MapboxMapOptions options) { + private void initialiseAttribution(@NonNull Context context, MapLibreMapOptions options) { isAttributionInitialized = true; attributionsView = mapView.initialiseAttributionView(); setAttributionEnabled(options.getAttributionEnabled()); @@ -297,26 +297,26 @@ public final class UiSettings { } private void saveAttribution(Bundle outState) { - outState.putInt(MapboxConstants.STATE_ATTRIBUTION_GRAVITY, getAttributionGravity()); - outState.putInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_LEFT, getAttributionMarginLeft()); - outState.putInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_TOP, getAttributionMarginTop()); - outState.putInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_RIGHT, getAttributionMarginRight()); - outState.putInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_BOTTOM, getAttributionMarginBottom()); - outState.putBoolean(MapboxConstants.STATE_ATTRIBUTION_ENABLED, isAttributionEnabled()); + outState.putInt(MapLibreConstants.STATE_ATTRIBUTION_GRAVITY, getAttributionGravity()); + outState.putInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_LEFT, getAttributionMarginLeft()); + outState.putInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_TOP, getAttributionMarginTop()); + outState.putInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_RIGHT, getAttributionMarginRight()); + outState.putInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_BOTTOM, getAttributionMarginBottom()); + outState.putBoolean(MapLibreConstants.STATE_ATTRIBUTION_ENABLED, isAttributionEnabled()); } private void restoreAttribution(Bundle savedInstanceState) { - boolean attributionEnabled = savedInstanceState.getBoolean(MapboxConstants.STATE_ATTRIBUTION_ENABLED); + boolean attributionEnabled = savedInstanceState.getBoolean(MapLibreConstants.STATE_ATTRIBUTION_ENABLED); if (attributionEnabled && !isAttributionInitialized) { attributionsView = mapView.initialiseAttributionView(); isAttributionInitialized = true; } - setAttributionEnabled(savedInstanceState.getBoolean(MapboxConstants.STATE_ATTRIBUTION_ENABLED)); - setAttributionGravity(savedInstanceState.getInt(MapboxConstants.STATE_ATTRIBUTION_GRAVITY)); - setAttributionMargins(savedInstanceState.getInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_LEFT), - savedInstanceState.getInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_TOP), - savedInstanceState.getInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_RIGHT), - savedInstanceState.getInt(MapboxConstants.STATE_ATTRIBUTION_MARGIN_BOTTOM)); + setAttributionEnabled(savedInstanceState.getBoolean(MapLibreConstants.STATE_ATTRIBUTION_ENABLED)); + setAttributionGravity(savedInstanceState.getInt(MapLibreConstants.STATE_ATTRIBUTION_GRAVITY)); + setAttributionMargins(savedInstanceState.getInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_LEFT), + savedInstanceState.getInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_TOP), + savedInstanceState.getInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_RIGHT), + savedInstanceState.getInt(MapLibreConstants.STATE_ATTRIBUTION_MARGIN_BOTTOM)); } public long getFlingAnimationBaseTime() { @@ -348,7 +348,7 @@ public final class UiSettings { */ public void setCompassEnabled(boolean compassEnabled) { if (compassEnabled && !isCompassInitialized) { - initialiseCompass(mapView.mapboxMapOptions, mapView.getContext().getResources()); + initialiseCompass(mapView.maplibreMapOptions, mapView.getContext().getResources()); } if (compassView != null) { compassView.setEnabled(compassEnabled); @@ -518,7 +518,7 @@ public final class UiSettings { /** *

- * Enables or disables the Mapbox logo. + * Enables or disables the MapLibre logo. *

* By default, the logo is enabled. * @@ -526,7 +526,7 @@ public final class UiSettings { */ public void setLogoEnabled(boolean enabled) { if (enabled && !isLogoInitialized) { - initialiseLogo(mapView.mapboxMapOptions, mapView.getContext().getResources()); + initialiseLogo(mapView.maplibreMapOptions, mapView.getContext().getResources()); } if (logoView != null) { logoView.setVisibility(enabled ? View.VISIBLE : View.GONE); @@ -549,7 +549,7 @@ public final class UiSettings { /** *

* Sets the gravity of the logo view. Use this to change the corner of the map view that the - * Mapbox logo is displayed in. + * MapLibre logo is displayed in. *

* By default, the logo is in the bottom left corner. * @@ -575,7 +575,7 @@ public final class UiSettings { } /** - * Sets the margins of the logo view in pixels. Use this to change the distance of the Mapbox logo from the + * Sets the margins of the logo view in pixels. Use this to change the distance of the MapLibre logo from the * map view edge. * * @param left The left margin in pixels. @@ -639,7 +639,7 @@ public final class UiSettings { */ public void setAttributionEnabled(boolean enabled) { if (enabled && !isAttributionInitialized) { - initialiseAttribution(mapView.getContext(), mapView.mapboxMapOptions); + initialiseAttribution(mapView.getContext(), mapView.maplibreMapOptions); } if (attributionsView != null) { attributionsView.setVisibility(enabled ? View.VISIBLE : View.GONE); @@ -686,7 +686,7 @@ public final class UiSettings { *

* Sets the gravity of the attribution. *

- * By default, the attribution is in the bottom left corner next to the Mapbox logo. + * By default, the attribution is in the bottom left corner next to the MapLibre logo. * * @param gravity Android SDK Gravity. */ @@ -929,11 +929,11 @@ public final class UiSettings { } private void restoreDeselectMarkersOnTap(Bundle savedInstanceState) { - setDeselectMarkersOnTap(savedInstanceState.getBoolean(MapboxConstants.STATE_DESELECT_MARKER_ON_TAP)); + setDeselectMarkersOnTap(savedInstanceState.getBoolean(MapLibreConstants.STATE_DESELECT_MARKER_ON_TAP)); } private void saveDeselectMarkersOnTap(Bundle outState) { - outState.putBoolean(MapboxConstants.STATE_DESELECT_MARKER_ON_TAP, isDeselectMarkersOnTap()); + outState.putBoolean(MapLibreConstants.STATE_DESELECT_MARKER_ON_TAP, isDeselectMarkersOnTap()); } /** @@ -1169,11 +1169,11 @@ public final class UiSettings { } private void saveFocalPoint(Bundle outState) { - outState.putParcelable(MapboxConstants.STATE_USER_FOCAL_POINT, getFocalPoint()); + outState.putParcelable(MapLibreConstants.STATE_USER_FOCAL_POINT, getFocalPoint()); } private void restoreFocalPoint(Bundle savedInstanceState) { - PointF pointF = savedInstanceState.getParcelable(MapboxConstants.STATE_USER_FOCAL_POINT); + PointF pointF = savedInstanceState.getParcelable(MapLibreConstants.STATE_USER_FOCAL_POINT); if (pointF != null) { setFocalPoint(pointF); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/package-info.java new file mode 100644 index 000000000..26699e2cb --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Maps API classes. + */ +package org.maplibre.android.maps; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRenderer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRenderer.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRenderer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRenderer.java index 8381a7966..0e8fe35b4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRenderer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRenderer.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer; +package org.maplibre.android.maps.renderer; import android.content.Context; @@ -6,9 +6,9 @@ import androidx.annotation.CallSuper; import androidx.annotation.Keep; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.LibraryLoader; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.LibraryLoader; +import org.maplibre.android.log.Logger; +import org.maplibre.android.maps.MapLibreMap; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; @@ -32,7 +32,7 @@ public abstract class MapRenderer implements MapRendererScheduler { // Holds the pointer to the native peer after initialisation private long nativePtr = 0; private double expectedRenderTime = 0; - private MapboxMap.OnFpsChangedListener onFpsChangedListener; + private MapLibreMap.OnFpsChangedListener onFpsChangedListener; public MapRenderer(@NonNull Context context, String localIdeographFontFamily) { float pixelRatio = context.getResources().getDisplayMetrics().density; @@ -61,7 +61,7 @@ public abstract class MapRenderer implements MapRendererScheduler { // Implement if needed } - public void setOnFpsChangedListener(MapboxMap.OnFpsChangedListener listener) { + public void setOnFpsChangedListener(MapLibreMap.OnFpsChangedListener listener) { onFpsChangedListener = listener; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRendererRunnable.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRendererRunnable.java similarity index 93% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRendererRunnable.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRendererRunnable.java index 0dcf64c8e..ad990a965 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRendererRunnable.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRendererRunnable.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer; +package org.maplibre.android.maps.renderer; import androidx.annotation.Keep; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRendererScheduler.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRendererScheduler.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRendererScheduler.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRendererScheduler.java index 237350461..145ae6397 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRendererScheduler.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/MapRendererScheduler.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer; +package org.maplibre.android.maps.renderer; import androidx.annotation.Keep; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLConfigChooser.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLConfigChooser.java index de866eef0..5af47d414 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLConfigChooser.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLConfigChooser.java @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.maps.renderer.egl; +package org.maplibre.android.maps.renderer.egl; import android.opengl.GLSurfaceView; import android.os.Build; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.log.Logger; import java.util.ArrayList; import java.util.Collections; @@ -16,7 +16,7 @@ import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLDisplay; -import static com.mapbox.mapboxsdk.utils.Compare.compare; +import static org.maplibre.android.utils.Compare.compare; import static javax.microedition.khronos.egl.EGL10.EGL_ALPHA_MASK_SIZE; import static javax.microedition.khronos.egl.EGL10.EGL_ALPHA_SIZE; import static javax.microedition.khronos.egl.EGL10.EGL_BLUE_SIZE; @@ -88,7 +88,7 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { int[] numConfigs = new int[1]; if (!egl.eglChooseConfig(display, configAttributes, null, 0, numConfigs)) { Logger.e(TAG, String.format( - MapboxConstants.MAPBOX_LOCALE, "eglChooseConfig(NULL) returned error %d", egl.eglGetError()) + MapLibreConstants.MAPLIBRE_LOCALE, "eglChooseConfig(NULL) returned error %d", egl.eglGetError()) ); } return numConfigs; @@ -100,7 +100,7 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { EGLConfig[] configs = new EGLConfig[numConfigs[0]]; if (!egl.eglChooseConfig(display, configAttributes, configs, numConfigs[0], numConfigs)) { Logger.e(TAG, String.format( - MapboxConstants.MAPBOX_LOCALE, "eglChooseConfig() returned error %d", egl.eglGetError()) + MapLibreConstants.MAPLIBRE_LOCALE, "eglChooseConfig() returned error %d", egl.eglGetError()) ); } return configs; @@ -258,7 +258,7 @@ public class EGLConfigChooser implements GLSurfaceView.EGLConfigChooser { int[] attributevalue = new int[1]; if (!egl.eglGetConfigAttrib(display, config, attributeName, attributevalue)) { Logger.e(TAG, String.format( - MapboxConstants.MAPBOX_LOCALE, "eglGetConfigAttrib(%d) returned error %d", attributeName, egl.eglGetError()) + MapLibreConstants.MAPLIBRE_LOCALE, "eglGetConfigAttrib(%d) returned error %d", attributeName, egl.eglGetError()) ); } return attributevalue[0]; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLContextFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLContextFactory.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLContextFactory.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLContextFactory.java index 2908c5f2e..bf5c4f815 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLContextFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLContextFactory.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer.egl; +package org.maplibre.android.maps.renderer.egl; import android.opengl.GLSurfaceView; import android.util.Log; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLLogWrapper.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLLogWrapper.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLLogWrapper.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLLogWrapper.java index 0d84027a4..5f94b6556 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLLogWrapper.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLLogWrapper.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer.egl; +package org.maplibre.android.maps.renderer.egl; import android.opengl.GLDebugHelper; import android.opengl.GLException; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLWindowSurfaceFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLWindowSurfaceFactory.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLWindowSurfaceFactory.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLWindowSurfaceFactory.java index 845d7ae2e..b8f417145 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/egl/EGLWindowSurfaceFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/EGLWindowSurfaceFactory.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer.egl; +package org.maplibre.android.maps.renderer.egl; import android.opengl.GLSurfaceView; import android.util.Log; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/package-info.java new file mode 100644 index 000000000..5ab9bb210 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/egl/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android EGL API classes. + */ +package org.maplibre.android.maps.renderer.egl; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/GLSurfaceViewMapRenderer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/GLSurfaceViewMapRenderer.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/GLSurfaceViewMapRenderer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/GLSurfaceViewMapRenderer.java index 21a4cb501..ac8030683 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/GLSurfaceViewMapRenderer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/GLSurfaceViewMapRenderer.java @@ -1,14 +1,14 @@ -package com.mapbox.mapboxsdk.maps.renderer.glsurfaceview; +package org.maplibre.android.maps.renderer.glsurfaceview; import android.content.Context; import android.opengl.GLSurfaceView; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.maps.renderer.MapRenderer; -import com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser; -import com.mapbox.mapboxsdk.maps.renderer.egl.EGLContextFactory; -import com.mapbox.mapboxsdk.maps.renderer.egl.EGLWindowSurfaceFactory; +import org.maplibre.android.maps.renderer.MapRenderer; +import org.maplibre.android.maps.renderer.egl.EGLConfigChooser; +import org.maplibre.android.maps.renderer.egl.EGLContextFactory; +import org.maplibre.android.maps.renderer.egl.EGLWindowSurfaceFactory; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; @@ -24,10 +24,10 @@ import static android.opengl.GLSurfaceView.RENDERMODE_WHEN_DIRTY; public class GLSurfaceViewMapRenderer extends MapRenderer implements GLSurfaceView.Renderer { @NonNull - private final MapboxGLSurfaceView glSurfaceView; + private final MapLibreGLSurfaceView glSurfaceView; public GLSurfaceViewMapRenderer(Context context, - MapboxGLSurfaceView glSurfaceView, + MapLibreGLSurfaceView glSurfaceView, String localIdeographFontFamily) { super(context, localIdeographFontFamily); this.glSurfaceView = glSurfaceView; @@ -37,7 +37,7 @@ public class GLSurfaceViewMapRenderer extends MapRenderer implements GLSurfaceVi glSurfaceView.setRenderer(this); glSurfaceView.setRenderMode(RENDERMODE_WHEN_DIRTY); glSurfaceView.setPreserveEGLContextOnPause(true); - glSurfaceView.setDetachedListener(new MapboxGLSurfaceView.OnGLSurfaceViewDetachedListener() { + glSurfaceView.setDetachedListener(new MapLibreGLSurfaceView.OnGLSurfaceViewDetachedListener() { @Override public void onGLSurfaceViewDetached() { // because the GL thread is destroyed when the view is detached from window, diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/MapboxGLSurfaceView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/MapLibreGLSurfaceView.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/MapboxGLSurfaceView.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/MapLibreGLSurfaceView.java index 27f90be3a..2847bc5a8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/glsurfaceview/MapboxGLSurfaceView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/MapLibreGLSurfaceView.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer.glsurfaceview; +package org.maplibre.android.maps.renderer.glsurfaceview; import android.content.Context; import android.opengl.GLSurfaceView; @@ -9,7 +9,7 @@ import android.view.SurfaceView; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.maps.renderer.egl.EGLLogWrapper; +import org.maplibre.android.maps.renderer.egl.EGLLogWrapper; import java.io.Writer; import java.lang.ref.WeakReference; @@ -30,12 +30,12 @@ import static android.opengl.GLSurfaceView.RENDERMODE_CONTINUOUSLY; * {@link GLSurfaceView} extension that notifies a listener when the view is detached from window, * which is the point of destruction of the GL thread. */ -public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Callback2 { +public class MapLibreGLSurfaceView extends SurfaceView implements SurfaceHolder.Callback2 { private static final String TAG = "GLSurfaceView"; private static final GLThreadManager glThreadManager = new GLThreadManager(); - private final WeakReference viewWeakReference = new WeakReference<>(this); + private final WeakReference viewWeakReference = new WeakReference<>(this); private GLThread glThread; private GLSurfaceView.Renderer renderer; private GLSurfaceView.EGLConfigChooser eglConfigChooser; @@ -50,7 +50,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca * Standard View constructor. In order to render something, you * must call {@link #setRenderer} to register a renderer. */ - public MapboxGLSurfaceView(Context context) { + public MapLibreGLSurfaceView(Context context) { super(context); init(); } @@ -59,7 +59,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca * Standard View constructor. In order to render something, you * must call {@link #setRenderer} to register a renderer. */ - public MapboxGLSurfaceView(Context context, AttributeSet attrs) { + public MapLibreGLSurfaceView(Context context, AttributeSet attrs) { super(context, attrs); init(); } @@ -354,7 +354,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca * An EGL helper class. */ private static class EglHelper { - private EglHelper(WeakReference glSurfaceViewWeakRef) { + private EglHelper(WeakReference glSurfaceViewWeakRef) { mGLSurfaceViewWeakRef = glSurfaceViewWeakRef; } @@ -386,7 +386,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca Log.e(TAG, "eglInitialize failed"); return; } - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view == null) { mEglConfig = null; mEglContext = null; @@ -442,7 +442,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca /* * Create an EGL surface we can render into. */ - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { mEglSurface = view.eglWindowSurfaceFactory.createWindowSurface(mEgl, mEglDisplay, mEglConfig, view.getHolder()); @@ -502,7 +502,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { view.eglWindowSurfaceFactory.destroySurface(mEgl, mEglDisplay, mEglSurface); } @@ -512,7 +512,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca public void finish() { if (mEglContext != null) { - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { view.eglContextFactory.destroyContext(mEgl, mEglDisplay, mEglContext); } @@ -532,7 +532,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca return function + " failed: " + EGLLogWrapper.getErrorString(error); } - private WeakReference mGLSurfaceViewWeakRef; + private WeakReference mGLSurfaceViewWeakRef; EGL10 mEgl; EGLDisplay mEglDisplay; EGLSurface mEglSurface; @@ -550,7 +550,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca * sGLThreadManager object. This avoids multiple-lock ordering issues. */ static class GLThread extends Thread { - GLThread(WeakReference glSurfaceViewWeakRef) { + GLThread(WeakReference glSurfaceViewWeakRef) { super(); width = 0; height = 0; @@ -659,7 +659,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca // When pausing, optionally release the EGL Context: if (pausing && haveEglContext) { - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); boolean preserveEglContextOnPause = view != null && view.preserveEGLContextOnPause; if (!preserveEglContextOnPause) { stopEglContextLocked(); @@ -784,7 +784,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca } if (createEglContext) { - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { view.renderer.onSurfaceCreated(gl, eglHelper.mEglConfig); } @@ -792,14 +792,14 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca } if (sizeChanged) { - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { view.renderer.onSurfaceChanged(gl, w, h); } sizeChanged = false; } - MapboxGLSurfaceView view = mGLSurfaceViewWeakRef.get(); + MapLibreGLSurfaceView view = mGLSurfaceViewWeakRef.get(); if (view != null) { view.renderer.onDrawFrame(gl); if (finishDrawingRunnable != null) { @@ -1050,7 +1050,7 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca * called. This weak reference allows the GLSurfaceView to be garbage collected while * the GLThread is still alive. */ - private WeakReference mGLSurfaceViewWeakRef; + private WeakReference mGLSurfaceViewWeakRef; } @@ -1111,12 +1111,12 @@ public class MapboxGLSurfaceView extends SurfaceView implements SurfaceHolder.Ca } /** - * Listener interface that notifies when a {@link MapboxGLSurfaceView} is detached from window. + * Listener interface that notifies when a {@link MapLibreGLSurfaceView} is detached from window. */ public interface OnGLSurfaceViewDetachedListener { /** - * Called when a {@link MapboxGLSurfaceView} is detached from window. + * Called when a {@link MapLibreGLSurfaceView} is detached from window. */ void onGLSurfaceViewDetached(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/package-info.java new file mode 100644 index 000000000..7caaed9e7 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/glsurfaceview/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android GLSurfaceView API classes. + */ +package org.maplibre.android.maps.renderer.glsurfaceview; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/package-info.java new file mode 100644 index 000000000..79998ed6f --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Renderer API classes. + */ +package org.maplibre.android.maps.renderer; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/TextureViewMapRenderer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/TextureViewMapRenderer.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/TextureViewMapRenderer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/TextureViewMapRenderer.java index 3fdcc01ac..420b23d10 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/TextureViewMapRenderer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/TextureViewMapRenderer.java @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.maps.renderer.textureview; +package org.maplibre.android.maps.renderer.textureview; import android.content.Context; import android.view.TextureView; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.maps.renderer.MapRenderer; +import org.maplibre.android.maps.renderer.MapRenderer; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/TextureViewRenderThread.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/TextureViewRenderThread.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/TextureViewRenderThread.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/TextureViewRenderThread.java index e35d778ee..5f5772af4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/textureview/TextureViewRenderThread.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/TextureViewRenderThread.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.renderer.textureview; +package org.maplibre.android.maps.renderer.textureview; import android.graphics.SurfaceTexture; import android.view.TextureView; @@ -7,8 +7,8 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser; +import org.maplibre.android.log.Logger; +import org.maplibre.android.maps.renderer.egl.EGLConfigChooser; import java.lang.ref.WeakReference; import java.util.ArrayList; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/package-info.java new file mode 100644 index 000000000..65f12758b --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/renderer/textureview/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android TextureView API classes. + */ +package org.maplibre.android.maps.renderer.textureview; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/widgets/CompassView.java similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/widgets/CompassView.java index 77e086482..97e5dbb79 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/widgets/CompassView.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.maps.widgets; +package org.maplibre.android.maps.widgets; import android.content.Context; import android.graphics.drawable.Drawable; @@ -13,15 +13,16 @@ import androidx.core.view.ViewCompat; import androidx.core.view.ViewPropertyAnimatorCompat; import androidx.core.view.ViewPropertyAnimatorListenerAdapter; -import com.mapbox.mapboxsdk.maps.MapboxMap; +import org.maplibre.android.maps.MapLibreMap; +import org.maplibre.android.maps.MapLibreMapOptions; /** * UI element overlaid on a map to show the map's bearing when it isn't true north (0.0). Tapping * the compass resets the bearing to true north and hides the compass. *

* You can change the behaviour of this View during initialisation with - * {@link com.mapbox.mapboxsdk.maps.MapboxMapOptions}, and xml attributes. While running you can - * use {@link com.mapbox.mapboxsdk.maps.UiSettings}. + * {@link MapLibreMapOptions}, and xml attributes. While running you can + * use {@link org.maplibre.android.maps.UiSettings}. *

*/ public final class CompassView extends ImageView implements Runnable { @@ -34,7 +35,7 @@ public final class CompassView extends ImageView implements Runnable { private boolean fadeCompassViewFacingNorth = true; @Nullable private ViewPropertyAnimatorCompat fadeAnimator; - private MapboxMap.OnCompassAnimationListener compassAnimationListener; + private MapLibreMap.OnCompassAnimationListener compassAnimationListener; private boolean isAnimating = false; public CompassView(@NonNull Context context) { @@ -61,7 +62,7 @@ public final class CompassView extends ImageView implements Runnable { setLayoutParams(lp); } - public void injectCompassAnimationListener(@NonNull MapboxMap.OnCompassAnimationListener compassAnimationListener) { + public void injectCompassAnimationListener(@NonNull MapLibreMap.OnCompassAnimationListener compassAnimationListener) { this.compassAnimationListener = compassAnimationListener; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/widgets/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/widgets/package-info.java new file mode 100644 index 000000000..51163b201 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/maps/widgets/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Widgets API classes. + */ +package org.maplibre.android.maps.widgets; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/HttpRequestImpl.java similarity index 91% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/HttpRequestImpl.java index bbd2ac8dd..cf509def7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/HttpRequestImpl.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.module.http; +package org.maplibre.android.module.http; import android.os.Build; import android.text.TextUtils; @@ -8,13 +8,13 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; -import com.mapbox.mapboxsdk.BuildConfig; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.http.HttpIdentifier; -import com.mapbox.mapboxsdk.http.HttpLogger; -import com.mapbox.mapboxsdk.http.HttpRequest; -import com.mapbox.mapboxsdk.http.HttpRequestUrl; -import com.mapbox.mapboxsdk.http.HttpResponder; +import org.maplibre.android.BuildConfig; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.http.HttpIdentifier; +import org.maplibre.android.http.HttpLogger; +import org.maplibre.android.http.HttpRequest; +import org.maplibre.android.http.HttpRequestUrl; +import org.maplibre.android.http.HttpResponder; import java.io.IOException; import java.io.InterruptedIOException; @@ -34,7 +34,7 @@ import okhttp3.Request; import okhttp3.Response; import okhttp3.ResponseBody; -import static com.mapbox.mapboxsdk.module.http.HttpRequestUtil.toHumanReadableAscii; +import static org.maplibre.android.module.http.HttpRequestUtil.toHumanReadableAscii; public class HttpRequestImpl implements HttpRequest { @@ -66,12 +66,12 @@ public class HttpRequestImpl implements HttpRequest { return; } - final String host = httpUrl.host().toLowerCase(MapboxConstants.MAPBOX_LOCALE); + final String host = httpUrl.host().toLowerCase(MapLibreConstants.MAPLIBRE_LOCALE); resourceUrl = HttpRequestUrl.buildResourceUrl(host, resourceUrl, httpUrl.querySize(), offlineUsage); final Request.Builder builder = new Request.Builder() .url(resourceUrl) - .tag(resourceUrl.toLowerCase(MapboxConstants.MAPBOX_LOCALE)) + .tag(resourceUrl.toLowerCase(MapLibreConstants.MAPLIBRE_LOCALE)) .addHeader("User-Agent", userAgentString); if (etag.length() > 0) { builder.addHeader("If-None-Match", etag); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestUtil.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/HttpRequestUtil.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestUtil.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/HttpRequestUtil.java index e2ac8ffde..0750a96df 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestUtil.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/HttpRequestUtil.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.module.http; +package org.maplibre.android.module.http; import androidx.annotation.NonNull; import androidx.annotation.Nullable; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/package-info.java new file mode 100644 index 000000000..9a3d9e3c2 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/http/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Modular Http API classes. + */ +package org.maplibre.android.module.http; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/LibraryLoaderProviderImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/loader/LibraryLoaderProviderImpl.java similarity index 81% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/LibraryLoaderProviderImpl.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/loader/LibraryLoaderProviderImpl.java index 948164b32..02ea2b843 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/loader/LibraryLoaderProviderImpl.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/loader/LibraryLoaderProviderImpl.java @@ -1,7 +1,7 @@ -package com.mapbox.mapboxsdk.module.loader; +package org.maplibre.android.module.loader; -import com.mapbox.mapboxsdk.LibraryLoader; -import com.mapbox.mapboxsdk.LibraryLoaderProvider; +import org.maplibre.android.LibraryLoader; +import org.maplibre.android.LibraryLoaderProvider; /** * Concrete implementation of a native library loader. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/loader/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/loader/package-info.java new file mode 100644 index 000000000..be0068a51 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/module/loader/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Modular Library Loader API classes. + */ +package org.maplibre.android.module.loader; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/ConnectivityListener.java similarity index 80% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/ConnectivityListener.java index 8f1046c79..f8c8fdd94 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/ConnectivityListener.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.net; +package org.maplibre.android.net; /** * Receives updates on connectivity state diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityReceiver.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/ConnectivityReceiver.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityReceiver.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/ConnectivityReceiver.java index 27e222317..e3e02a8df 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/ConnectivityReceiver.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/ConnectivityReceiver.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.net; +package org.maplibre.android.net; import android.annotation.SuppressLint; import android.content.BroadcastReceiver; @@ -12,7 +12,8 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.MapLibre; +import org.maplibre.android.log.Logger; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; @@ -100,7 +101,7 @@ public class ConnectivityReceiver extends BroadcastReceiver { } /** - * Overwrites system connectivity state. To set, use {@link com.mapbox.mapboxsdk.Mapbox#setConnected(Boolean)}. + * Overwrites system connectivity state. To set, use {@link MapLibre#setConnected(Boolean)}. * * @param connected flag to determine the connectivity state, true for connected, false for * disconnected, and null for ConnectivityManager to determine. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/NativeConnectivityListener.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/NativeConnectivityListener.java similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/NativeConnectivityListener.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/NativeConnectivityListener.java index bbc70673a..69839d422 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/net/NativeConnectivityListener.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/NativeConnectivityListener.java @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.net; +package org.maplibre.android.net; import androidx.annotation.Keep; -import com.mapbox.mapboxsdk.LibraryLoader; +import org.maplibre.android.LibraryLoader; /** * Updates the native library's connectivity state diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/package-info.java new file mode 100644 index 000000000..d5f8b5c50 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/net/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Network API classes. + */ +package org.maplibre.android.net; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineGeometryRegionDefinition.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineGeometryRegionDefinition.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineGeometryRegionDefinition.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineGeometryRegionDefinition.kt index 3640bf9fa..590f7d55a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineGeometryRegionDefinition.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineGeometryRegionDefinition.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.offline +package org.maplibre.android.offline import android.os.Parcel import android.os.Parcelable import androidx.annotation.Keep import com.mapbox.geojson.Feature import com.mapbox.geojson.Geometry -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.geometry.LatLngBounds.Companion.from import com.mapbox.turf.TurfMeasurement +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.geometry.LatLngBounds.Companion.from /** * An offline region defined by a style URL, geometry, zoom range, and diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineManager.kt similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineManager.kt index 4672ccd5d..e234c2781 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineManager.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineManager.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.offline +package org.maplibre.android.offline import android.annotation.SuppressLint import android.content.Context @@ -6,12 +6,12 @@ import android.os.Handler import android.os.Looper import androidx.annotation.Keep import androidx.annotation.UiThread -import com.mapbox.mapboxsdk.LibraryLoader -import com.mapbox.mapboxsdk.R -import com.mapbox.mapboxsdk.geometry.LatLngBounds.Companion.world -import com.mapbox.mapboxsdk.net.ConnectivityReceiver -import com.mapbox.mapboxsdk.storage.FileSource -import com.mapbox.mapboxsdk.utils.FileUtils +import org.maplibre.android.LibraryLoader +import org.maplibre.android.R +import org.maplibre.android.geometry.LatLngBounds.Companion.world +import org.maplibre.android.net.ConnectivityReceiver +import org.maplibre.android.storage.FileSource +import org.maplibre.android.utils.FileUtils import java.io.File import java.io.FileInputStream import java.io.FileOutputStream @@ -284,7 +284,7 @@ class OfflineManager private constructor(context: Context) { * Forces re-validation of the ambient cache. * * - * Forces Mapbox GL Native to revalidate resources stored in the ambient + * Forces MapLibre GL Native to revalidate resources stored in the ambient * cache with the tile server before using them, making sure they * are the latest version. This is more efficient than cleaning the * cache because if the resource is considered valid after the server @@ -521,7 +521,7 @@ class OfflineManager private constructor(context: Context) { } /** - * Sets the maximum number of Mapbox-hosted tiles that may be downloaded and stored on the current device. + * Sets the maximum number of MapLibre-hosted tiles that may be downloaded and stored on the current device. * By default, the limit is set to 6,000. * * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegion.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegion.kt index f32ad84df..4727636e5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegion.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegion.kt @@ -1,18 +1,18 @@ -package com.mapbox.mapboxsdk.offline +package org.maplibre.android.offline import android.content.Context import android.os.Handler import android.os.Looper import androidx.annotation.IntDef import androidx.annotation.Keep -import com.mapbox.mapboxsdk.LibraryLoader -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.net.ConnectivityReceiver -import com.mapbox.mapboxsdk.storage.FileSource +import org.maplibre.android.LibraryLoader +import org.maplibre.android.MapLibre +import org.maplibre.android.net.ConnectivityReceiver +import org.maplibre.android.storage.FileSource /** * An offline region is the basic building block for offline mobile maps. - * Use [com.mapbox.mapboxsdk.offline.OfflineManager.CreateOfflineRegionCallback] + * Use [org.maplibre.android.offline.OfflineManager.CreateOfflineRegionCallback] * to create a new offline region. */ class OfflineRegion @Keep private constructor(offlineRegionPtr: Long, fileSource: FileSource, idParam: Long, definition: OfflineRegionDefinition, metadata: ByteArray) { @@ -82,13 +82,13 @@ class OfflineRegion @Keep private constructor(offlineRegionPtr: Long, fileSource fun onError(error: OfflineRegionError) /* - * Implement this method to be notified when the limit on the number of Mapbox + * Implement this method to be notified when the limit on the number of MapLibre * tiles stored for offline regions has been reached. * * Once the limit has been reached, the SDK will not download further offline - * tiles from Mapbox APIs until existing tiles have been removed. + * tiles from MapLibre APIs until existing tiles have been removed. * - * This limit does not apply to non-Mapbox tile sources. + * This limit does not apply to non-MapLibre tile sources. * * This method will be executed on the main thread. */ @@ -229,7 +229,7 @@ class OfflineRegion @Keep private constructor(offlineRegionPtr: Long, fileSource * [com.mapbox.mapboxsdk.offline.OfflineManager.createOfflineRegion] instead. */ init { - context = Mapbox.getApplicationContext() + context = MapLibre.getApplicationContext() this.fileSource = fileSource this.id = idParam this.definition = definition @@ -361,7 +361,7 @@ class OfflineRegion @Keep private constructor(offlineRegionPtr: Long, fileSource } /** - * Invalidate all the tiles from an offline region forcing Mapbox GL to revalidate + * Invalidate all the tiles from an offline region forcing MapLibre GL to revalidate * the tiles with the server before using. This is more efficient than deleting the * offline region and downloading it again because if the data on the cache matches * the server, no new data gets transmitted. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionDefinition.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionDefinition.kt similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionDefinition.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionDefinition.kt index b9661623b..b31de0469 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionDefinition.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionDefinition.kt @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.offline +package org.maplibre.android.offline import android.os.Parcelable import androidx.annotation.Keep -import com.mapbox.mapboxsdk.geometry.LatLngBounds +import org.maplibre.android.geometry.LatLngBounds /** * This is the interface that all Offline Region definitions have to implement. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionError.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionError.kt similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionError.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionError.kt index a5df8a1bf..9905728ae 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionError.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionError.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.offline +package org.maplibre.android.offline import androidx.annotation.Keep import androidx.annotation.StringDef diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionStatus.kt similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionStatus.kt index 2acc5897b..89bd7e4cf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineRegionStatus.kt @@ -1,7 +1,7 @@ -package com.mapbox.mapboxsdk.offline +package org.maplibre.android.offline import androidx.annotation.Keep -import com.mapbox.mapboxsdk.offline.OfflineRegion.DownloadState +import org.maplibre.android.offline.OfflineRegion.DownloadState /** * A region's status includes its active/inactive state as well as counts diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineTilePyramidRegionDefinition.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineTilePyramidRegionDefinition.kt index c00213d39..da1142083 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineTilePyramidRegionDefinition.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/OfflineTilePyramidRegionDefinition.kt @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.offline +package org.maplibre.android.offline import android.os.Parcel import android.os.Parcelable import androidx.annotation.Keep -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds /** * An offline region defined by a style URL, geographic bounding box, zoom range, and diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/PackageInfo.kt new file mode 100644 index 000000000..ab70f96c5 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/offline/PackageInfo.kt @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Offline API classes. + */ +package org.maplibre.android.offline diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/package-info.java new file mode 100644 index 000000000..9b0ed1f9d --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android API classes. + */ +package org.maplibre.android; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnaphotUtil.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnaphotUtil.kt similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnaphotUtil.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnaphotUtil.kt index f3ad3335d..6d6d6ef26 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnaphotUtil.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnaphotUtil.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.snapshotter +package org.maplibre.android.snapshotter import android.graphics.BitmapFactory diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshot.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnapshot.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshot.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnapshot.kt index 6590ea4c9..37d48666b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshot.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnapshot.kt @@ -1,9 +1,9 @@ -package com.mapbox.mapboxsdk.snapshotter +package org.maplibre.android.snapshotter import android.graphics.Bitmap import android.graphics.PointF import androidx.annotation.Keep -import com.mapbox.mapboxsdk.geometry.LatLng +import org.maplibre.android.geometry.LatLng /** * A completed snapshot. @@ -24,7 +24,7 @@ class MapSnapshot private constructor(val nativePtr: Long, bitmap: Bitmap, attri val attributions: Array /** - * @return Flag indicating to show the Mapbox logo. + * @return Flag indicating to show the MapLibre logo. */ val isShowLogo: Boolean diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnapshotter.kt similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnapshotter.kt index a1bd46c94..374cacc90 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/MapSnapshotter.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.snapshotter +package org.maplibre.android.snapshotter import android.content.Context import android.graphics.* @@ -11,22 +11,22 @@ import android.widget.TextView import androidx.annotation.Keep import androidx.annotation.UiThread import androidx.core.content.res.ResourcesCompat -import com.mapbox.mapboxsdk.R -import com.mapbox.mapboxsdk.attribution.AttributionLayout -import com.mapbox.mapboxsdk.attribution.AttributionMeasure -import com.mapbox.mapboxsdk.attribution.AttributionParser -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.constants.MapboxConstants -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.log.Logger -import com.mapbox.mapboxsdk.maps.Image -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.maps.Style.Builder.* -import com.mapbox.mapboxsdk.storage.FileSource -import com.mapbox.mapboxsdk.style.layers.Layer -import com.mapbox.mapboxsdk.style.sources.Source -import com.mapbox.mapboxsdk.utils.FontUtils -import com.mapbox.mapboxsdk.utils.ThreadUtils +import org.maplibre.android.R +import org.maplibre.android.attribution.AttributionLayout +import org.maplibre.android.attribution.AttributionMeasure +import org.maplibre.android.attribution.AttributionParser +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.constants.MapLibreConstants +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.log.Logger +import org.maplibre.android.maps.Image +import org.maplibre.android.maps.Style +import org.maplibre.android.maps.Style.Builder.* +import org.maplibre.android.storage.FileSource +import org.maplibre.android.style.layers.Layer +import org.maplibre.android.style.sources.Source +import org.maplibre.android.utils.FontUtils +import org.maplibre.android.utils.ThreadUtils /** * The map snapshotter creates a large of the map, rendered @@ -133,9 +133,9 @@ open class MapSnapshotter(context: Context, options: Options) { /** * @return the font family used for locally generating ideographs, - * Default font for local ideograph font family is [MapboxConstants.DEFAULT_FONT]. + * Default font for local ideograph font family is [MapLibreConstants.DEFAULT_FONT]. */ - var localIdeographFontFamily = MapboxConstants.DEFAULT_FONT + var localIdeographFontFamily = MapLibreConstants.DEFAULT_FONT private set /** @@ -222,7 +222,7 @@ open class MapSnapshotter(context: Context, options: Options) { } /** - * @param showLogo The flag indicating to show the Mapbox logo. + * @param showLogo The flag indicating to show the MapLibre logo. * @return the mutated [Options] */ fun withLogo(showLogo: Boolean): Options { @@ -237,7 +237,7 @@ open class MapSnapshotter(context: Context, options: Options) { * * The font family argument is passed to [android.graphics.Typeface.create]. * Default system fonts are defined in '/system/etc/fonts.xml' - * Default font for local ideograph font family is [MapboxConstants.DEFAULT_FONT]. + * Default font for local ideograph font family is [MapLibreConstants.DEFAULT_FONT]. * * * @param fontFamily font family for local ideograph generation. @@ -255,7 +255,7 @@ open class MapSnapshotter(context: Context, options: Options) { * * The font families are checked against the default system fonts defined in * '/system/etc/fonts.xml'. Default font for local ideograph font family is - * [MapboxConstants.DEFAULT_FONT]. + * [MapLibreConstants.DEFAULT_FONT]. * * * @param fontFamilies font families for local ideograph generation. @@ -663,7 +663,7 @@ open class MapSnapshotter(context: Context, options: Options) { } else if (layerWrapper is LayerBelowWrapper) { addLayerBelow(layerWrapper.getLayer(), layerWrapper.belowLayer) } else { - addLayerBelow(layerWrapper.layer, MapboxConstants.LAYER_ID_ANNOTATIONS) + addLayerBelow(layerWrapper.layer, MapLibreConstants.LAYER_ID_ANNOTATIONS) } } for (image in builder.images) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/PackageInfo.kt new file mode 100644 index 000000000..2d615491d --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/snapshotter/PackageInfo.kt @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Snapshotter API classes. + */ +package org.maplibre.android.snapshotter diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/FileSource.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/FileSource.java index b58337c71..c6c5a2936 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/FileSource.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.storage; +package org.maplibre.android.storage; import android.content.Context; import android.content.SharedPreferences; @@ -12,13 +12,13 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.Mapbox; -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.util.TileServerOptions; -import com.mapbox.mapboxsdk.utils.FileUtils; -import com.mapbox.mapboxsdk.utils.ThreadUtils; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.MapLibre; +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.log.Logger; +import org.maplibre.android.util.TileServerOptions; +import org.maplibre.android.utils.FileUtils; +import org.maplibre.android.utils.ThreadUtils; import java.io.File; import java.util.concurrent.locks.Lock; @@ -107,7 +107,7 @@ public class FileSource { @NonNull private static String getCachePath(@NonNull Context context) { SharedPreferences preferences = context.getSharedPreferences( - MapboxConstants.MAPBOX_SHARED_PREFERENCES, Context.MODE_PRIVATE); + MapLibreConstants.MAPLIBRE_SHARED_PREFERENCES, Context.MODE_PRIVATE); String cachePath = preferences.getString(MAPBOX_SHARED_PREFERENCE_RESOURCES_CACHE_PATH, null); if (!isPathWritable(cachePath)) { @@ -116,7 +116,7 @@ public class FileSource { // Reset stored cache path SharedPreferences.Editor editor = - context.getSharedPreferences(MapboxConstants.MAPBOX_SHARED_PREFERENCES, Context.MODE_PRIVATE).edit(); + context.getSharedPreferences(MapLibreConstants.MAPLIBRE_SHARED_PREFERENCES, Context.MODE_PRIVATE).edit(); editor.remove(MAPBOX_SHARED_PREFERENCE_RESOURCES_CACHE_PATH).apply(); } @@ -142,7 +142,7 @@ public class FileSource { private static boolean isExternalStorageConfiguration(@NonNull Context context) { // Default value - boolean isExternalStorageConfiguration = MapboxConstants.DEFAULT_SET_STORAGE_EXTERNAL; + boolean isExternalStorageConfiguration = MapLibreConstants.DEFAULT_SET_STORAGE_EXTERNAL; try { // Try getting a custom value from the app Manifest @@ -150,8 +150,8 @@ public class FileSource { PackageManager.GET_META_DATA); if (appInfo.metaData != null) { isExternalStorageConfiguration = appInfo.metaData.getBoolean( - MapboxConstants.KEY_META_DATA_SET_STORAGE_EXTERNAL, - MapboxConstants.DEFAULT_SET_STORAGE_EXTERNAL + MapLibreConstants.KEY_META_DATA_SET_STORAGE_EXTERNAL, + MapLibreConstants.DEFAULT_SET_STORAGE_EXTERNAL ); } } catch (PackageManager.NameNotFoundException exception) { @@ -293,7 +293,7 @@ public class FileSource { */ public static void setResourcesCachePath(@NonNull final String path, @NonNull final ResourcesCachePathChangeCallback callback) { - final Context applicationContext = Mapbox.getApplicationContext(); + final Context applicationContext = MapLibre.getApplicationContext(); final FileSource fileSource = FileSource.getInstance(applicationContext); if (path.equals(getResourcesCachePath(applicationContext))) { @@ -304,7 +304,7 @@ public class FileSource { @Override public void onWritePermissionGranted() { final SharedPreferences.Editor editor = - applicationContext.getSharedPreferences(MapboxConstants.MAPBOX_SHARED_PREFERENCES, + applicationContext.getSharedPreferences(MapLibreConstants.MAPLIBRE_SHARED_PREFERENCES, Context.MODE_PRIVATE).edit(); editor.putString(MAPBOX_SHARED_PREFERENCE_RESOURCES_CACHE_PATH, path); editor.apply(); @@ -372,8 +372,8 @@ public class FileSource { private long nativePtr; private FileSource(String cachePath) { - TileServerOptions options = Mapbox.getTileServerOptions(); - initialize(Mapbox.getApiKey(), cachePath, options); + TileServerOptions options = MapLibre.getTileServerOptions(); + initialize(MapLibre.getApiKey(), cachePath, options); } @Keep diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/Resource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/Resource.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/Resource.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/Resource.java index 0e00a9164..63f7c5218 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/Resource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/Resource.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.storage; +package org.maplibre.android.storage; import androidx.annotation.IntDef; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/package-info.java new file mode 100644 index 000000000..49aa0c6c2 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/storage/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Storage API classes. + */ +package org.maplibre.android.storage; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/expressions/Expression.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/expressions/Expression.java index 048cb0af5..ee57d8021 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/expressions/Expression.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/expressions/Expression.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.expressions; +package org.maplibre.android.style.expressions; import android.annotation.SuppressLint; @@ -16,8 +16,8 @@ import com.google.gson.JsonPrimitive; import com.mapbox.geojson.GeoJson; import com.mapbox.geojson.Polygon; import com.mapbox.geojson.gson.GeometryGeoJson; -import com.mapbox.mapboxsdk.style.layers.PropertyFactory; -import com.mapbox.mapboxsdk.style.layers.PropertyValue; +import org.maplibre.android.style.layers.PropertyFactory; +import org.maplibre.android.style.layers.PropertyValue; import java.util.ArrayList; import java.util.Arrays; @@ -26,12 +26,12 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import static com.mapbox.mapboxsdk.utils.ColorUtils.colorToRgbaArray; +import static org.maplibre.android.utils.ColorUtils.colorToRgbaArray; /** * The value for any layout property, paint property, or filter may be specified as an expression. * An expression defines a formula for computing the value of the property using the operators described below. - * The set of expression operators provided by Mapbox GL includes: + * The set of expression operators provided by MapLibre GL includes: *
    *
  • Element
  • *
  • Mathematical operators for performing arithmetic and other operations on numeric values
  • @@ -2975,7 +2975,7 @@ public class Expression { * Returns true if the input string is expected to render legibly. * Returns false if the input string contains sections that cannot be rendered without potential loss of meaning * (e.g. Indic scripts that require complex text shaping, - * or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in Mapbox GL JS). + * or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in MapLibre GL JS). *

    * Example usage: *

    @@ -3006,7 +3006,7 @@ public class Expression { * Returns true if the input string is expected to render legibly. * Returns false if the input string contains sections that cannot be rendered without potential loss of meaning * (e.g. Indic scripts that require complex text shaping, - * or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in Mapbox GL JS). + * or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in MapLibre GL JS). *

    * Example usage: *

    diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/expressions/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/expressions/package-info.java new file mode 100644 index 000000000..83ce64218 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/expressions/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Expression API classes. + */ +package org.maplibre.android.style.expressions; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/BackgroundLayer.java similarity index 94% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/BackgroundLayer.java index ea8924c92..8151dbc4b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/BackgroundLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/BackgroundLayer.java @@ -1,13 +1,19 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.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 static org.maplibre.android.utils.ColorUtils.rgbaToColor; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; /** * The background color or pattern of the map. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CannotAddLayerException.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CannotAddLayerException.java similarity index 84% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CannotAddLayerException.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CannotAddLayerException.java index b85158ce6..fb7f0e599 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CannotAddLayerException.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CannotAddLayerException.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.Keep; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CircleLayer.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CircleLayer.java index 15360ad1e..0e4fe58a2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CircleLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CircleLayer.java @@ -1,6 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.ColorInt; import androidx.annotation.Keep; @@ -8,10 +8,12 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.google.gson.JsonElement; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; -import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; /** * A filled circle. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CustomLayer.java similarity index 93% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CustomLayer.java index 1e5669f59..e76bd0253 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/CustomLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/CustomLayer.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.Keep; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/FillExtrusionLayer.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/FillExtrusionLayer.java index dffc4e37a..4c63fecf5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillExtrusionLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/FillExtrusionLayer.java @@ -1,6 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.ColorInt; import androidx.annotation.Keep; @@ -8,10 +8,12 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.google.gson.JsonElement; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; -import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; /** * An extruded (3D) polygon. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/FillLayer.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/FillLayer.java index 6d94d17f0..fc8baaf71 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/FillLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/FillLayer.java @@ -1,6 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.ColorInt; import androidx.annotation.Keep; @@ -8,10 +8,12 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.google.gson.JsonElement; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; -import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; /** * A filled polygon with an optional stroked border. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/HeatmapLayer.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/HeatmapLayer.java index 1d2c543cd..885a8e2f9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HeatmapLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/HeatmapLayer.java @@ -1,6 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.ColorInt; import androidx.annotation.Keep; @@ -8,10 +8,12 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.google.gson.JsonElement; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; -import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; /** * A heatmap. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/HillshadeLayer.java similarity index 95% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/HillshadeLayer.java index 2f31f2088..b01e35349 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/HillshadeLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/HillshadeLayer.java @@ -1,16 +1,22 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.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 static org.maplibre.android.utils.ColorUtils.rgbaToColor; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; /** - * Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles. + * Client-side hillshading visualization based on DEM data. Currently, the implementation only supports MapLibre Terrain RGB and Mapzen Terrarium tiles. * * @see The online documentation */ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/Layer.java similarity index 91% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/Layer.java index 9ca8e8a1b..20f34471f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Layer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/Layer.java @@ -1,14 +1,15 @@ -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.gson.JsonElement; -import com.mapbox.mapboxsdk.LibraryLoader; -import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.types.Formatted; -import com.mapbox.mapboxsdk.utils.ThreadUtils; +import org.maplibre.android.LibraryLoader; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.types.Formatted; +import org.maplibre.android.utils.ThreadUtils; +import org.maplibre.android.style.types.Formatted; /** * Base class for the different Layer types diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LayoutPropertyValue.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/LayoutPropertyValue.java similarity index 81% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LayoutPropertyValue.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/LayoutPropertyValue.java index 630a4239a..33dffe13e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LayoutPropertyValue.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/LayoutPropertyValue.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.NonNull; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/LineLayer.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/LineLayer.java index d2f0d9e48..3a53390fe 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/LineLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/LineLayer.java @@ -1,6 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.ColorInt; import androidx.annotation.Keep; @@ -8,10 +8,12 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.google.gson.JsonElement; -import com.mapbox.mapboxsdk.style.expressions.Expression; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; -import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; /** * A stroked line. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PaintPropertyValue.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PaintPropertyValue.java similarity index 81% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PaintPropertyValue.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PaintPropertyValue.java index bd5eaa81a..57ca24ee5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PaintPropertyValue.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PaintPropertyValue.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.NonNull; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/Property.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/Property.java index d5f1daa82..490ea6bfd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/Property.java @@ -1,6 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.StringDef; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PropertyFactory.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PropertyFactory.java index 447e0cc6f..b60eab575 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PropertyFactory.java @@ -1,13 +1,12 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.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; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.types.Formatted; +import static org.maplibre.android.utils.ColorUtils.colorToRgbaString; /** * Constructs paint/layout properties for Layers @@ -1807,7 +1806,7 @@ public class PropertyFactory { } /** - * If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries. + * If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries. * * @param value a Boolean value * @return property wrapper around Boolean @@ -1817,7 +1816,7 @@ public class PropertyFactory { } /** - * If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries. + * If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries. * * @param value a Boolean value * @return property wrapper around Boolean diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PropertyValue.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PropertyValue.java index b56ab86c9..478ac4476 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyValue.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PropertyValue.java @@ -1,15 +1,15 @@ -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.gson.JsonArray; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.exceptions.ConversionException; -import com.mapbox.mapboxsdk.log.Logger; -import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.utils.ColorUtils; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.exceptions.ConversionException; +import org.maplibre.android.log.Logger; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.utils.ColorUtils; import java.util.Arrays; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/RasterLayer.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/RasterLayer.java index 45ab14b6f..6611f1d1d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/RasterLayer.java @@ -1,11 +1,20 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; +import androidx.annotation.ColorInt; import androidx.annotation.Keep; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.UiThread; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; + /** * Raster map textures such as satellite imagery. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/SymbolLayer.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/SymbolLayer.java index 767dd2cc9..cb9a3b9a6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/SymbolLayer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/SymbolLayer.java @@ -1,6 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.ColorInt; import androidx.annotation.Keep; @@ -8,11 +8,14 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.google.gson.JsonElement; -import com.mapbox.mapboxsdk.style.expressions.Expression; -import com.mapbox.mapboxsdk.style.types.Formatted; +import static org.maplibre.android.utils.ColorUtils.rgbaToColor; -import static com.mapbox.mapboxsdk.utils.ColorUtils.rgbaToColor; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import org.maplibre.android.style.expressions.Expression; +import org.maplibre.android.style.layers.TransitionOptions; +import org.maplibre.android.style.types.Formatted; +import org.maplibre.android.style.types.FormattedSection; /** * An icon or a text label. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/TransitionOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/TransitionOptions.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/TransitionOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/TransitionOptions.java index 8ac99c0ad..3d9ec013d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/TransitionOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/TransitionOptions.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.Keep; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/layer.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/layer.java.ejs new file mode 100644 index 000000000..9c421a583 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/layer.java.ejs @@ -0,0 +1,87 @@ +<% 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 +org.maplibre.android.location; <% } else { -%> package +org.maplibre.android.style.layers; <% } -%> import androidx.annotation.ColorInt; +import androidx.annotation.Keep; import androidx.annotation.NonNull; import +androidx.annotation.Nullable; import androidx.annotation.UiThread; import static +org.maplibre.android.utils.ColorUtils.rgbaToColor; import +com.google.gson.JsonArray; import com.google.gson.JsonElement; import +org.maplibre.android.style.expressions.Expression; import +org.maplibre.android.style.layers.TransitionOptions; <% if (type === 'symbol') { +-%> import org.maplibre.android.style.types.Formatted; import +org.maplibre.android.style.types.FormattedSection; <% } -%> <% if (type === +'location-indicator') { -%> import org.maplibre.android.style.layers.Layer; +import org.maplibre.android.style.layers.PropertyValue; <% } -%> /** * <%- doc +%> * * @see +The online documentation +*/ @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; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/package-info.java new file mode 100644 index 000000000..3004d22d6 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Style Layer API classes. + */ +package org.maplibre.android.style.layers; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property.java.ejs similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property.java.ejs index 06481fa4d..ec27653c1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property.java.ejs @@ -3,7 +3,7 @@ -%> // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.layers; +package org.maplibre.android.style.layers; import androidx.annotation.StringDef; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property_factory.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property_factory.java.ejs new file mode 100644 index 000000000..b55d39162 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property_factory.java.ejs @@ -0,0 +1,70 @@ +<% 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 +org.maplibre.android.location; <% } else { -%> package +org.maplibre.android.style.layers; <% } -%> import androidx.annotation.ColorInt; +import org.maplibre.android.style.expressions.Expression; import +org.maplibre.android.style.types.Formatted; import static +org.maplibre.android.utils.ColorUtils.colorToRgbaString; <% if +(locationIndicator) { -%> import +org.maplibre.android.style.layers.LayoutPropertyValue; import +org.maplibre.android.style.layers.PaintPropertyValue; import +org.maplibre.android.style.layers.Property; import +org.maplibre.android.style.layers.PropertyValue; <% } -%> /** * Constructs +paint/layout properties for Layers * * @see +Layer style documentation +*/ <% 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 + 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 + <%- 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 + <%- 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 + <%- 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 + <%- camelizeWithLeadingLowercase(property.name) %>(Expression value) { + return new LayoutPropertyValue<>("<%- property.name %>", value); } <% + } -%> } + diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/Light.java similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/Light.java index 0ca914d09..b3350a476 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/Light.java @@ -1,16 +1,16 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. -package com.mapbox.mapboxsdk.style.light; +package org.maplibre.android.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; +import org.maplibre.android.style.layers.Property; +import org.maplibre.android.style.layers.TransitionOptions; +import org.maplibre.android.utils.ColorUtils; +import org.maplibre.android.utils.ThreadUtils; /** * The global light source. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/Position.java similarity index 94% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/Position.java index 0bb5be53b..e911c9420 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/Position.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.light; +package org.maplibre.android.style.light; import androidx.annotation.Keep; import androidx.annotation.NonNull; @@ -10,8 +10,8 @@ import androidx.annotation.Nullable; * The position is constructed out of a radial coordinate, an azimuthal angle and a polar angle. * where the radial coordinate indicates the distance from the center of the base of an object to its light, the * azimuthal angle indicates the position of the light relative to 0° (0° when - * {@link com.mapbox.mapboxsdk.style.layers.Property.ANCHOR} is set to viewport corresponds to the top of the - * viewport, or 0° when {@link com.mapbox.mapboxsdk.style.layers.Property.ANCHOR} is set to map corresponds to due + * {@link org.maplibre.android.style.layers.Property.ANCHOR} is set to viewport corresponds to the top of the + * viewport, or 0° when {@link org.maplibre.android.style.layers.Property.ANCHOR} is set to map corresponds to due * north, and degrees proceed clockwise), and polar indicates the height of the light * (from 0°, directly above, to 180°, directly below). */ diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/light.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/light.java.ejs new file mode 100644 index 000000000..e82fd6c96 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/light.java.ejs @@ -0,0 +1,61 @@ +<% const properties = locals.properties; const doc = locals.doc; -%> // This +file is generated. Edit scripts/generate-style-code.js, then run `make +style-code`. package org.maplibre.android.style.light; import +androidx.annotation.ColorInt; import androidx.annotation.Keep; import +androidx.annotation.NonNull; import androidx.annotation.UiThread; import +org.maplibre.android.style.layers.Property; import +org.maplibre.android.style.layers.TransitionOptions; import +org.maplibre.android.utils.ColorUtils; import +org.maplibre.android.utils.ThreadUtils; /** * The global light source. * * @see +The online documentation +*/ @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); <% } -%> <% } +-%> } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/package-info.java new file mode 100644 index 000000000..d8ecca654 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Style Light API classes. + */ +package org.maplibre.android.style.light; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CannotAddSourceException.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CannotAddSourceException.kt similarity index 79% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CannotAddSourceException.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CannotAddSourceException.kt index 7d677ca96..07c8dd0ac 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CannotAddSourceException.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CannotAddSourceException.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.Keep diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CustomGeometrySource.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CustomGeometrySource.kt index e5f2cbecb..529a66127 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CustomGeometrySource.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.Keep import androidx.annotation.UiThread import androidx.annotation.WorkerThread import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.geometry.LatLngBounds.Companion.from -import com.mapbox.mapboxsdk.style.expressions.Expression +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.geometry.LatLngBounds.Companion.from +import org.maplibre.android.style.expressions.Expression import java.lang.ref.WeakReference import java.util.Arrays import java.util.Locale diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySourceOptions.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CustomGeometrySourceOptions.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySourceOptions.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CustomGeometrySourceOptions.kt index 494c2ca16..33e354a04 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySourceOptions.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/CustomGeometrySourceOptions.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources /** * Builder class for composing CustomGeometrySource objects. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeoJsonOptions.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeoJsonOptions.kt index 2c5d0a1d2..bbe8466fd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeoJsonOptions.kt @@ -1,7 +1,7 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.expressions.Expression.ExpressionLiteral +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.expressions.Expression.ExpressionLiteral /** * Builder class for composing GeoJsonSource objects. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeoJsonSource.kt similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeoJsonSource.kt index 44d1c4681..89f5c239f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeoJsonSource.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.Keep import androidx.annotation.UiThread import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Geometry -import com.mapbox.mapboxsdk.style.expressions.Expression +import org.maplibre.android.style.expressions.Expression import java.net.URI import java.net.URL import java.util.* diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeometryTileProvider.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeometryTileProvider.kt similarity index 86% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeometryTileProvider.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeometryTileProvider.kt index 4ad98095f..37a420cd7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeometryTileProvider.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/GeometryTileProvider.kt @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.WorkerThread import com.mapbox.geojson.FeatureCollection -import com.mapbox.mapboxsdk.geometry.LatLngBounds +import org.maplibre.android.geometry.LatLngBounds /** * Interface that defines methods for working with [CustomGeometrySource]. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/ImageSource.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/ImageSource.kt index 59eaf4f5d..5f2e6314b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/ImageSource.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import android.graphics.Bitmap import android.graphics.drawable.BitmapDrawable import androidx.annotation.DrawableRes import androidx.annotation.Keep import androidx.annotation.UiThread -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.geometry.LatLngQuad -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.MapLibre +import org.maplibre.android.geometry.LatLngQuad +import org.maplibre.android.utils.BitmapUtils import java.net.URI import java.net.URL /** @@ -196,7 +196,7 @@ class ImageSource : Source { @Throws(IllegalArgumentException::class) fun setImage(@DrawableRes resourceId: Int) { checkThread() - val context = Mapbox.getApplicationContext() + val context = MapLibre.getApplicationContext() val drawable = BitmapUtils.getDrawableFromRes(context, resourceId) if (drawable is BitmapDrawable) { nativeSetImage(drawable.bitmap) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/PackageInfo.kt new file mode 100644 index 000000000..e686d248e --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/PackageInfo.kt @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Style Sources API classes. + */ +package org.maplibre.android.style.sources diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/RasterDemSource.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/RasterDemSource.kt index a7f9aa7e9..f6e3bd1fa 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/RasterDemSource.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.Keep import androidx.annotation.UiThread diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterSource.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/RasterSource.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterSource.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/RasterSource.kt index f2dbb3a04..f8c7464cb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterSource.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/RasterSource.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.Keep import java.net.URI diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/Source.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/Source.java similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/Source.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/Source.java index 42dd4f288..57dc186a5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/Source.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/Source.java @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.style.sources; +package org.maplibre.android.style.sources; import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.LibraryLoader; -import com.mapbox.mapboxsdk.utils.ThreadUtils; +import org.maplibre.android.LibraryLoader; +import org.maplibre.android.utils.ThreadUtils; /** * Base Peer class for sources. see source.hpp for the other half of the peer. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/TileSet.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/TileSet.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/TileSet.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/TileSet.kt index 8c4f24c5d..d2c9b45df 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/TileSet.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/TileSet.kt @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.Size -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds /** * Tile set, allows using TileJson specification as source. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/UnknownSource.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/UnknownSource.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/UnknownSource.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/UnknownSource.kt index 3b3b5206e..1164b90ee 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/UnknownSource.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/UnknownSource.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import androidx.annotation.Keep import androidx.annotation.UiThread diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/VectorSource.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/VectorSource.kt similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/VectorSource.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/VectorSource.kt index 05d2eeca6..d989dab05 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/VectorSource.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/sources/VectorSource.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.style.sources +package org.maplibre.android.style.sources import android.net.Uri import androidx.annotation.Keep import androidx.annotation.Size import androidx.annotation.UiThread import com.mapbox.geojson.Feature -import com.mapbox.mapboxsdk.style.expressions.Expression +import org.maplibre.android.style.expressions.Expression import java.net.URL import java.util.* import kotlin.collections.ArrayList diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/Formatted.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/Formatted.kt similarity index 97% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/Formatted.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/Formatted.kt index d5d34fa1e..27940d36f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/Formatted.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/Formatted.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.style.types +package org.maplibre.android.style.types import androidx.annotation.Keep import java.util.* diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/FormattedSection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/FormattedSection.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/FormattedSection.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/FormattedSection.java index 52d95f906..9a3032f02 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/types/FormattedSection.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/FormattedSection.java @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.style.types; +package org.maplibre.android.style.types; import androidx.annotation.ColorInt; import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.utils.ColorUtils; +import org.maplibre.android.utils.ColorUtils; import java.util.Arrays; import java.util.HashMap; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/PackageInfo.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/PackageInfo.kt new file mode 100644 index 000000000..75c4fac7e --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/types/PackageInfo.kt @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Formatted Expression Types API classes. + */ +package org.maplibre.android.style.types diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/LocalGlyphRasterizer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/text/LocalGlyphRasterizer.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/LocalGlyphRasterizer.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/text/LocalGlyphRasterizer.java index dca6c6e8d..e0fd02d13 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/LocalGlyphRasterizer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/text/LocalGlyphRasterizer.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.text; +package org.maplibre.android.text; import android.graphics.Bitmap; import android.graphics.Canvas; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/text/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/text/package-info.java new file mode 100644 index 000000000..5b1c09367 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/text/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Text API classes. + */ +package org.maplibre.android.text; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/util/DefaultStyle.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/util/DefaultStyle.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/util/DefaultStyle.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/util/DefaultStyle.java index 69cb89c14..e3067c7ec 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/util/DefaultStyle.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/util/DefaultStyle.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.util; +package org.maplibre.android.util; import android.os.Parcel; import android.os.Parcelable; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/util/TileServerOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/util/TileServerOptions.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/util/TileServerOptions.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/util/TileServerOptions.java index 27af635d3..c144bf4db 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/util/TileServerOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/util/TileServerOptions.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.util; +package org.maplibre.android.util; import android.os.Parcel; import android.os.Parcelable; @@ -7,8 +7,8 @@ import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.mapbox.mapboxsdk.WellKnownTileServer; -import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException; +import org.maplibre.android.WellKnownTileServer; +import org.maplibre.android.exceptions.MapLibreConfigurationException; /** * Tile server options - baseUrl and similar properties @@ -395,7 +395,7 @@ public class TileServerOptions implements Parcelable { case MapLibre: return mapLibreConfiguration(); default: - throw new MapboxConfigurationException("Unknown tile server"); + throw new MapLibreConfigurationException("Unknown tile server"); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/AnimatorUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/AnimatorUtils.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/AnimatorUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/AnimatorUtils.java index 2fe4a419b..106f8f3fd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/AnimatorUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/AnimatorUtils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; import android.animation.Animator; import android.animation.AnimatorInflater; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/BitmapUtils.java similarity index 99% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/BitmapUtils.java index 034388d13..f6643875a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/BitmapUtils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; import android.content.Context; import android.graphics.Bitmap; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ColorUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/ColorUtils.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ColorUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/ColorUtils.java index e771dec26..af5c6358f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ColorUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/ColorUtils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; import android.content.Context; import android.content.res.ColorStateList; @@ -12,8 +12,8 @@ import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.core.widget.ImageViewCompat; -import com.mapbox.mapboxsdk.R; -import com.mapbox.mapboxsdk.exceptions.ConversionException; +import org.maplibre.android.R; +import org.maplibre.android.exceptions.ConversionException; import java.text.DecimalFormat; import java.text.NumberFormat; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/Compare.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/Compare.java similarity index 94% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/Compare.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/Compare.java index f17d4574d..da66167b7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/Compare.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/Compare.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; /** * Comparisons from std sdk, which aren't available in API level 15 and below diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/Extensions.kt b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/Extensions.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/Extensions.kt rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/Extensions.kt index 52143cb71..3b68f3956 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/Extensions.kt +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/Extensions.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils +package org.maplibre.android.utils // Make converting from Java to Kotlin easier fun Double.Companion.isNaN(d: Double) = d.isNaN() diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FileUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/FileUtils.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FileUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/FileUtils.java index 972c9c0bf..939167da9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FileUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/FileUtils.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; import android.os.AsyncTask; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.log.Logger; import java.io.File; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FontUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/FontUtils.java similarity index 92% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FontUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/FontUtils.java index 42f36da30..94f52badd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FontUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/FontUtils.java @@ -1,19 +1,19 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; import android.graphics.Typeface; import android.os.Build; import androidx.annotation.RequiresApi; -import com.mapbox.mapboxsdk.MapStrictMode; -import com.mapbox.mapboxsdk.log.Logger; +import org.maplibre.android.MapStrictMode; +import org.maplibre.android.log.Logger; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import java.util.Map; -import static com.mapbox.mapboxsdk.constants.MapboxConstants.DEFAULT_FONT; +import static org.maplibre.android.constants.MapLibreConstants.DEFAULT_FONT; /** * Utility class to select a font from a range of font names based on the availability of fonts on the device. diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/MapFragmentUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/MapFragmentUtils.java new file mode 100644 index 000000000..e5bbca938 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/MapFragmentUtils.java @@ -0,0 +1,54 @@ +package org.maplibre.android.utils; + +import android.content.Context; +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.maplibre.android.constants.MapLibreConstants; +import org.maplibre.android.maps.MapFragment; +import org.maplibre.android.maps.SupportMapFragment; +import org.maplibre.android.maps.MapLibreMapOptions; + +/** + * MapFragment utility class. + *

    + * Used to extract duplicate code between {@link MapFragment} and + * {@link SupportMapFragment}. + *

    + */ +public class MapFragmentUtils { + + /** + * Convert MapboxMapOptions to a bundle of fragment arguments. + * + * @param options The MapboxMapOptions to convert + * @return a bundle of converted fragment arguments + */ + @NonNull + public static Bundle createFragmentArgs(MapLibreMapOptions options) { + Bundle bundle = new Bundle(); + bundle.putParcelable(MapLibreConstants.FRAG_ARG_MAPLIBREMAPOPTIONS, options); + return bundle; + } + + /** + * Convert a bundle of fragment arguments to MapboxMapOptions. + * + * @param context The context of the activity hosting the fragment + * @param args The fragment arguments + * @return converted MapboxMapOptions + */ + @Nullable + public static MapLibreMapOptions resolveArgs(@NonNull Context context, @Nullable Bundle args) { + MapLibreMapOptions options; + if (args != null && args.containsKey(MapLibreConstants.FRAG_ARG_MAPLIBREMAPOPTIONS)) { + options = args.getParcelable(MapLibreConstants.FRAG_ARG_MAPLIBREMAPOPTIONS); + } else { + // load default options + options = MapLibreMapOptions.createFromAttributes(context); + } + return options; + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MathUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/MathUtils.java similarity index 98% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MathUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/MathUtils.java index 7ec3262c5..d5f244dd6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MathUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/MathUtils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; // TODO Remove this class if we finally include it within MAS 3.x (GeoJSON) public class MathUtils { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/StringUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/StringUtils.java similarity index 94% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/StringUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/StringUtils.java index 2686d4e53..4c50d9306 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/StringUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/StringUtils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; import androidx.annotation.Keep; import androidx.annotation.NonNull; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ThreadUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/ThreadUtils.java similarity index 87% rename from platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ThreadUtils.java rename to platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/ThreadUtils.java index 99e543a1a..db4d552fc 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/ThreadUtils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/ThreadUtils.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.utils; +package org.maplibre.android.utils; import android.content.Context; import android.content.pm.ApplicationInfo; @@ -6,7 +6,7 @@ import android.os.Looper; import androidx.annotation.NonNull; -import com.mapbox.mapboxsdk.exceptions.CalledFromWorkerThreadException; +import org.maplibre.android.exceptions.CalledFromWorkerThreadException; /** * Utility class to verify if execution is running on the main thread. @@ -21,7 +21,7 @@ public class ThreadUtils { /** * Initialises the thread utils, verifies debug state of the consuming app. * - * @param context Context hosting the Mapbox Maps SDK for Android + * @param context Context hosting the MapLibre Maps SDK for Android * @return this */ public static ThreadUtils init(@NonNull Context context) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/package-info.java b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/package-info.java new file mode 100644 index 000000000..f4caf1c16 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/org/maplibre/android/utils/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the MapLibre Maps Android Utility API classes. + */ +package org.maplibre.android.utils; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/overview.html b/platform/android/MapboxGLAndroidSDK/src/main/java/overview.html index f218b3ccf..c2d656782 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/overview.html +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/overview.html @@ -4,10 +4,10 @@ An open source OpenGL-based vector map solution for Android with full styling capabilities.

    -For more information, check out our online overview. +For more information, check out our online overview.

    - + - + diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CountryMarker.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CountryMarker.kt deleted file mode 100644 index c6e7074a6..000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CountryMarker.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.mapbox.mapboxsdk.testapp.model.annotations - -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions -import com.mapbox.mapboxsdk.annotations.Marker - -class CountryMarker( - baseMarkerOptions: BaseMarkerOptions<*, *>?, - val abbrevName: String, - val flagRes: Int -) : Marker(baseMarkerOptions) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/IdleZoomListener.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/IdleZoomListener.kt deleted file mode 100644 index f045cd9cd..000000000 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/IdleZoomListener.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.mapbox.mapboxsdk.testapp.utils - -import android.widget.TextView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraIdleListener -import com.mapbox.mapboxsdk.testapp.R - -class IdleZoomListener(private val mapboxMap: MapboxMap, private val textView: TextView) : - OnCameraIdleListener { - override fun onCameraIdle() { - val context = textView.context - val position = mapboxMap.cameraPosition - textView.text = String.format(context.getString(R.string.debug_zoom), position.zoom) - } -} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapLibreApplication.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/MapLibreApplication.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapLibreApplication.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/MapLibreApplication.kt index bf7c68c10..5aa20b21e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapLibreApplication.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/MapLibreApplication.kt @@ -1,17 +1,17 @@ -package com.mapbox.mapboxsdk.testapp +package org.maplibre.android.testapp import android.os.StrictMode import android.os.StrictMode.ThreadPolicy import android.os.StrictMode.VmPolicy import android.text.TextUtils import androidx.multidex.MultiDexApplication -import com.mapbox.mapboxsdk.MapStrictMode -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.WellKnownTileServer -import com.mapbox.mapboxsdk.log.Logger -import com.mapbox.mapboxsdk.testapp.utils.ApiKeyUtils -import com.mapbox.mapboxsdk.testapp.utils.TileLoadingMeasurementUtils -import com.mapbox.mapboxsdk.testapp.utils.TimberLogger +import org.maplibre.android.MapStrictMode +import org.maplibre.android.MapLibre +import org.maplibre.android.WellKnownTileServer +import org.maplibre.android.log.Logger +import org.maplibre.android.testapp.utils.ApiKeyUtils +import org.maplibre.android.testapp.utils.TileLoadingMeasurementUtils +import org.maplibre.android.testapp.utils.TimberLogger import timber.log.Timber import timber.log.Timber.DebugTree @@ -19,7 +19,7 @@ import timber.log.Timber.DebugTree * Application class of the test application. * * - * Initialises components as LeakCanary, Strictmode, Timber and Mapbox + * Initialises components as LeakCanary, Strictmode, Timber and MapLibre * */ open class MapLibreApplication : MultiDexApplication() { @@ -60,7 +60,7 @@ open class MapLibreApplication : MultiDexApplication() { if (apiKey != null) { validateApiKey(apiKey) } - Mapbox.getInstance(applicationContext, apiKey, TILE_SERVER) + MapLibre.getInstance(applicationContext, apiKey, TILE_SERVER) TileLoadingMeasurementUtils.setUpTileLoadingMeasurement() MapStrictMode.setStrictModeEnabled(true) } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/FeatureOverviewActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/FeatureOverviewActivity.kt similarity index 93% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/FeatureOverviewActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/FeatureOverviewActivity.kt index 792bac7a6..eb1d63f0d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/FeatureOverviewActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/FeatureOverviewActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity +package org.maplibre.android.testapp.activity import android.content.ComponentName import android.content.Intent @@ -8,6 +8,7 @@ import android.content.res.Resources.NotFoundException import android.os.AsyncTask import android.os.Build import android.os.Bundle +import android.util.Log import android.view.View import androidx.annotation.RequiresApi import androidx.annotation.StringRes @@ -15,11 +16,11 @@ import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView.SimpleOnItemTouchListener -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.adapter.FeatureAdapter -import com.mapbox.mapboxsdk.testapp.adapter.FeatureSectionAdapter -import com.mapbox.mapboxsdk.testapp.model.activity.Feature -import com.mapbox.mapboxsdk.testapp.utils.ItemClickSupport +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.adapter.FeatureAdapter +import org.maplibre.android.testapp.adapter.FeatureSectionAdapter +import org.maplibre.android.testapp.model.activity.Feature +import org.maplibre.android.testapp.utils.ItemClickSupport import timber.log.Timber import java.util.* @@ -114,7 +115,7 @@ class FeatureOverviewActivity : AppCompatActivity() { protected override fun doInBackground(vararg p0: PackageInfo?): List? { val features: MutableList = ArrayList() val app = p0[0] - val packageName = applicationContext.packageName + val packageName = FeatureOverviewActivity.javaClass.`package`.name val metaDataKey = getString(R.string.category) if (app != null) { for (info in app.activities) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/BulkMarkerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/BulkMarkerActivity.kt similarity index 85% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/BulkMarkerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/BulkMarkerActivity.kt index 527df5006..8f4d80ff3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/BulkMarkerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/BulkMarkerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.annotation +package org.maplibre.android.testapp.activity.annotation import android.app.ProgressDialog import android.os.AsyncTask @@ -11,14 +11,14 @@ import android.widget.ArrayAdapter import android.widget.Spinner import androidx.appcompat.app.AppCompatActivity import androidx.core.view.MenuItemCompat -import com.mapbox.mapboxsdk.annotations.MarkerOptions -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.GeoParseUtil +import org.maplibre.android.annotations.MarkerOptions +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.GeoParseUtil import timber.log.Timber import java.io.IOException import java.lang.ref.WeakReference @@ -29,7 +29,7 @@ import java.util.* * Test activity showcasing adding a large amount of Markers. */ class BulkMarkerActivity : AppCompatActivity(), OnItemSelectedListener { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private var locations: List? = null private var progressDialog: ProgressDialog? = null @@ -38,12 +38,12 @@ class BulkMarkerActivity : AppCompatActivity(), OnItemSelectedListener { setContentView(R.layout.activity_marker_bulk) mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) - mapView.getMapAsync(OnMapReadyCallback { mapboxMap: MapboxMap -> initMap(mapboxMap) }) + mapView.getMapAsync(OnMapReadyCallback { maplibreMap: MapLibreMap -> initMap(maplibreMap) }) } - private fun initMap(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + private fun initMap(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) } override fun onCreateOptionsMenu(menu: Menu): Boolean { @@ -79,10 +79,10 @@ class BulkMarkerActivity : AppCompatActivity(), OnItemSelectedListener { private fun showMarkers(amount: Int) { var amount = amount - if (mapboxMap == null || locations == null || mapView.isDestroyed) { + if (maplibreMap == null || locations == null || mapView.isDestroyed) { return } - mapboxMap.clear() + maplibreMap.clear() if (locations!!.size < amount) { amount = locations!!.size } @@ -104,7 +104,7 @@ class BulkMarkerActivity : AppCompatActivity(), OnItemSelectedListener { .snippet(formatter.format(latLng.latitude) + "`, " + formatter.format(latLng.longitude)) ) } - mapboxMap.addMarkers(markerOptionsList) + maplibreMap.addMarkers(markerOptionsList) } override fun onNothingSelected(parent: AdapterView<*>?) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/DynamicMarkerChangeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/DynamicMarkerChangeActivity.kt similarity index 81% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/DynamicMarkerChangeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/DynamicMarkerChangeActivity.kt index 1704f6c7a..a5a0a3c58 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/DynamicMarkerChangeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/DynamicMarkerChangeActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.annotation +package org.maplibre.android.testapp.activity.annotation import android.os.Bundle import android.view.View @@ -6,22 +6,22 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.annotations.Marker -import com.mapbox.mapboxsdk.annotations.MarkerOptions -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.IconUtils +import org.maplibre.android.annotations.Marker +import org.maplibre.android.annotations.MarkerOptions +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.IconUtils /** * Test activity showcasing updating a Marker position, title, icon and snippet. */ class DynamicMarkerChangeActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var marker: Marker? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -30,9 +30,9 @@ class DynamicMarkerChangeActivity : AppCompatActivity() { mapView.setTag(false) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) - this@DynamicMarkerChangeActivity.mapboxMap = mapboxMap + OnMapReadyCallback { maplibreMap: MapLibreMap -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) + this@DynamicMarkerChangeActivity.maplibreMap = maplibreMap // Create marker val markerOptions = MarkerOptions() .position(LAT_LNG_CHELSEA) @@ -45,7 +45,7 @@ class DynamicMarkerChangeActivity : AppCompatActivity() { ) .title(getString(R.string.dynamic_marker_chelsea_title)) .snippet(getString(R.string.dynamic_marker_chelsea_snippet)) - marker = mapboxMap.addMarker(markerOptions) + marker = maplibreMap.addMarker(markerOptions) } ) val fab = findViewById(R.id.fab) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PolygonActivity.kt similarity index 91% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PolygonActivity.kt index bc0f45654..e08a74a13 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolygonActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PolygonActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.annotation +package org.maplibre.android.testapp.activity.annotation import android.graphics.Color import android.os.Bundle @@ -6,12 +6,12 @@ import android.view.Menu import android.view.MenuItem import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.annotations.Polygon -import com.mapbox.mapboxsdk.annotations.PolygonOptions -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* // ktlint-disable no-wildcard-imports -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.annotations.Polygon +import org.maplibre.android.annotations.PolygonOptions +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* // ktlint-disable no-wildcard-imports +import org.maplibre.android.testapp.R import java.util.ArrayList /** @@ -23,7 +23,7 @@ import java.util.ArrayList */ class PolygonActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var polygon: Polygon? = null private var fullAlpha = true private var polygonIsVisible = true @@ -34,7 +34,7 @@ class PolygonActivity : AppCompatActivity(), OnMapReadyCallback { super.onCreate(savedInstanceState) // configure inital map state - val options = MapboxMapOptions.createFromAttributes(this, null) + val options = MapLibreMapOptions.createFromAttributes(this, null) .attributionTintColor(Config.RED_COLOR) .compassFadesWhenFacingNorth(false) .camera( @@ -53,8 +53,8 @@ class PolygonActivity : AppCompatActivity(), OnMapReadyCallback { setContentView(mapView) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Streets")) map.setOnPolygonClickListener { polygon: Polygon -> Toast.makeText( @@ -63,7 +63,7 @@ class PolygonActivity : AppCompatActivity(), OnMapReadyCallback { Toast.LENGTH_SHORT ).show() } - polygon = mapboxMap.addPolygon( + polygon = maplibreMap.addPolygon( PolygonOptions() .addAll(Config.STAR_SHAPE_POINTS) .fillColor(Config.BLUE_COLOR) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolylineActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PolylineActivity.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolylineActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PolylineActivity.kt index 246f74355..1ce158774 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PolylineActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PolylineActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.annotation +package org.maplibre.android.testapp.activity.annotation import android.graphics.Color import android.os.Bundle @@ -7,14 +7,14 @@ import android.view.MenuItem import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.annotations.Polyline -import com.mapbox.mapboxsdk.annotations.PolylineOptions -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.annotations.Polyline +import org.maplibre.android.annotations.PolylineOptions +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R import java.util.* /** @@ -28,7 +28,7 @@ class PolylineActivity : AppCompatActivity() { private var polylines: MutableList? = null private var polylineOptions: ArrayList? = ArrayList() private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var fullAlpha = true private var showPolylines = true private var width = true @@ -44,34 +44,34 @@ class PolylineActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - this@PolylineActivity.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) - mapboxMap.setOnPolylineClickListener { polyline: Polyline -> + OnMapReadyCallback { maplibreMap: MapLibreMap -> + this@PolylineActivity.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) + maplibreMap.setOnPolylineClickListener { polyline: Polyline -> Toast.makeText( this@PolylineActivity, "You clicked on polyline with id = " + polyline.id, Toast.LENGTH_SHORT ).show() } - polylines = mapboxMap.addPolylines(polylineOptions!!) + polylines = maplibreMap.addPolylines(polylineOptions!!) } ) val fab = findViewById(R.id.fab) fab?.setOnClickListener { view: View? -> - if (mapboxMap != null) { + if (maplibreMap != null) { if (polylines != null && polylines!!.size > 0) { if (polylines!!.size == 1) { // test for removing annotation - mapboxMap.removeAnnotation(polylines!![0]) + maplibreMap.removeAnnotation(polylines!![0]) } else { // test for removing annotations - mapboxMap.removeAnnotations(polylines!!) + maplibreMap.removeAnnotations(polylines!!) } } polylineOptions!!.clear() polylineOptions!!.addAll(randomLine) - polylines = mapboxMap.addPolylines(polylineOptions!!) + polylines = maplibreMap.addPolylines(polylineOptions!!) } } } @@ -157,7 +157,7 @@ class PolylineActivity : AppCompatActivity() { R.id.action_id_remove -> { // test to remove all annotations polylineOptions!!.clear() - mapboxMap.clear() + maplibreMap.clear() polylines!!.clear() true } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PressForMarkerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PressForMarkerActivity.kt similarity index 77% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PressForMarkerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PressForMarkerActivity.kt index b9d5bc417..47a763ab4 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/annotation/PressForMarkerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/annotation/PressForMarkerActivity.kt @@ -1,16 +1,16 @@ -package com.mapbox.mapboxsdk.testapp.activity.annotation +package org.maplibre.android.testapp.activity.annotation import android.os.Bundle import android.view.Menu import android.view.MenuItem import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.annotations.MarkerOptions -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.annotations.MarkerOptions +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R import java.text.DecimalFormat import java.util.ArrayList @@ -23,38 +23,38 @@ import java.util.ArrayList */ class PressForMarkerActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var markerList: ArrayList? = ArrayList() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_press_for_marker) mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { map: MapboxMap? -> + mapView.getMapAsync { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } resetMap() - mapboxMap.addOnMapLongClickListener { point: LatLng -> + maplibreMap.addOnMapLongClickListener { point: LatLng -> addMarker(point) false } - mapboxMap.addOnMapClickListener { point: LatLng -> + maplibreMap.addOnMapClickListener { point: LatLng -> addMarker(point) false } - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) if (savedInstanceState != null) { markerList = savedInstanceState.getParcelableArrayList(STATE_MARKER_LIST) if (markerList != null) { - mapboxMap.addMarkers(markerList!!) + maplibreMap.addMarkers(markerList!!) } } } } private fun addMarker(point: LatLng) { - val pixel = mapboxMap.projection.toScreenLocation(point) + val pixel = maplibreMap.projection.toScreenLocation(point) val title = ( LAT_LON_FORMATTER.format(point.latitude) + ", " + LAT_LON_FORMATTER.format(point.longitude) @@ -65,15 +65,15 @@ class PressForMarkerActivity : AppCompatActivity() { .title(title) .snippet(snippet) markerList!!.add(marker) - mapboxMap.addMarker(marker) + maplibreMap.addMarker(marker) } private fun resetMap() { - if (mapboxMap == null) { + if (maplibreMap == null) { return } markerList!!.clear() - mapboxMap.removeAnnotations() + maplibreMap.removeAnnotations() } override fun onCreateOptionsMenu(menu: Menu): Boolean { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraAnimationTypeActivity.kt similarity index 76% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraAnimationTypeActivity.kt index ca5774b84..5873126cf 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraAnimationTypeActivity.kt @@ -1,19 +1,19 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.os.Bundle import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.CancelableCallback -import com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraIdleListener -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.CancelableCallback +import org.maplibre.android.maps.MapLibreMap.OnCameraIdleListener +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R import timber.log.Timber /** @@ -45,12 +45,12 @@ class CameraAnimationTypeActivity : AppCompatActivity(), OnMapReadyCallback { .show() } } - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private var cameraState = false private val cameraIdleListener = OnCameraIdleListener { - if (mapboxMap != null) { - Timber.w(mapboxMap.cameraPosition.toString()) + if (maplibreMap != null) { + Timber.w(maplibreMap.cameraPosition.toString()) } } @@ -62,12 +62,12 @@ class CameraAnimationTypeActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Streets"))) - mapboxMap.uiSettings.isAttributionEnabled = false - mapboxMap.uiSettings.isLogoEnabled = false - mapboxMap.addOnCameraIdleListener(cameraIdleListener) + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Streets"))) + maplibreMap.uiSettings.isAttributionEnabled = false + maplibreMap.uiSettings.isLogoEnabled = false + maplibreMap.addOnCameraIdleListener(cameraIdleListener) // handle move button clicks val moveButton = findViewById(R.id.cameraMoveButton) @@ -79,7 +79,7 @@ class CameraAnimationTypeActivity : AppCompatActivity(), OnMapReadyCallback { .tilt(30.0) .tilt(0.0) .build() - mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) + maplibreMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) } // handle ease button clicks @@ -92,7 +92,7 @@ class CameraAnimationTypeActivity : AppCompatActivity(), OnMapReadyCallback { .bearing(180.0) .tilt(30.0) .build() - mapboxMap.easeCamera( + maplibreMap.easeCamera( CameraUpdateFactory.newCameraPosition(cameraPosition), 7500, callback @@ -104,7 +104,7 @@ class CameraAnimationTypeActivity : AppCompatActivity(), OnMapReadyCallback { animateButton?.setOnClickListener { view: View? -> val cameraPosition = CameraPosition.Builder().target(nextLatLng).bearing(270.0).tilt(20.0).build() - mapboxMap.animateCamera( + maplibreMap.animateCamera( CameraUpdateFactory.newCameraPosition(cameraPosition), 7500, callback @@ -145,8 +145,8 @@ class CameraAnimationTypeActivity : AppCompatActivity(), OnMapReadyCallback { override fun onDestroy() { super.onDestroy() - if (mapboxMap != null) { - mapboxMap.removeOnCameraIdleListener(cameraIdleListener) + if (maplibreMap != null) { + maplibreMap.removeOnCameraIdleListener(cameraIdleListener) } mapView.onDestroy() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimatorActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraAnimatorActivity.kt similarity index 92% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimatorActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraAnimatorActivity.kt index 2306786da..22c9a2618 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimatorActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraAnimatorActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.animation.Animator import android.animation.AnimatorSet @@ -16,18 +16,18 @@ import androidx.collection.LongSparseArray import androidx.core.view.animation.PathInterpolatorCompat import androidx.interpolator.view.animation.FastOutLinearInInterpolator import androidx.interpolator.view.animation.FastOutSlowInInterpolator -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R /** Test activity showcasing using Android SDK animators to animate camera position changes. */ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { private val animators = LongSparseArray() private lateinit var set: Animator private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_camera_animator) @@ -38,8 +38,8 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { } } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Streets")) initFab() } @@ -54,7 +54,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { .zoom(14.5) .bearing(135.0) .build() - set = createExampleAnimator(mapboxMap.cameraPosition, animatedPosition) + set = createExampleAnimator(maplibreMap.cameraPosition, animatedPosition) set.start() } } @@ -80,7 +80,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { latLngAnimator.duration = (1000 * ANIMATION_DELAY_FACTOR).toLong() latLngAnimator.interpolator = FastOutSlowInInterpolator() latLngAnimator.addUpdateListener { animation: ValueAnimator -> - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.newLatLng((animation.animatedValue as LatLng)) ) } @@ -93,7 +93,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { zoomAnimator.startDelay = (600 * ANIMATION_DELAY_FACTOR).toLong() zoomAnimator.interpolator = AnticipateOvershootInterpolator() zoomAnimator.addUpdateListener { animation: ValueAnimator -> - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.zoomTo((animation.animatedValue as Float).toDouble()) ) } @@ -107,7 +107,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { bearingAnimator.startDelay = (1000 * ANIMATION_DELAY_FACTOR).toLong() bearingAnimator.interpolator = FastOutLinearInInterpolator() bearingAnimator.addUpdateListener { animation: ValueAnimator -> - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.bearingTo((animation.animatedValue as Float).toDouble()) ) } @@ -119,7 +119,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { tiltAnimator.duration = (1000 * ANIMATION_DELAY_FACTOR).toLong() tiltAnimator.startDelay = (1500 * ANIMATION_DELAY_FACTOR).toLong() tiltAnimator.addUpdateListener { animation: ValueAnimator -> - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.tiltTo((animation.animatedValue as Float).toDouble()) ) } @@ -139,7 +139,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { } override fun onOptionsItemSelected(item: MenuItem): Boolean { - if (!::mapboxMap.isInitialized) { + if (!::maplibreMap.isInitialized) { return false } if (item.itemId != android.R.id.home) { @@ -151,7 +151,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { } private fun resetCameraPosition() { - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.newCameraPosition( CameraPosition.Builder() .target(START_LAT_LNG) @@ -176,7 +176,7 @@ class CameraAnimatorActivity : AppCompatActivity(), OnMapReadyCallback { zoomAnimator.duration = (duration * ANIMATION_DELAY_FACTOR).toLong() zoomAnimator.interpolator = interpolator zoomAnimator.addUpdateListener { animation: ValueAnimator -> - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.zoomTo((animation.animatedValue as Float).toDouble()) ) } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraPositionActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraPositionActivity.kt index 58a23a867..8318333ec 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/CameraPositionActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.annotation.SuppressLint import android.content.DialogInterface @@ -15,22 +15,22 @@ import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.constants.GeometryConstants -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.* -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.constants.GeometryConstants +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.* +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R import timber.log.Timber /** Test activity showcasing how to listen to camera change events. */ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnClickListener, OnMapLongClickListener { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var fab: FloatingActionButton private var logCameraChanges = false override fun onCreate(savedInstanceState: Bundle?) { @@ -45,8 +45,8 @@ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnCl mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) { style: Style? -> // add a listener to FAB fab = findViewById(R.id.fab) @@ -55,7 +55,7 @@ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnCl toggleLogCameraChanges() // listen to long click events to toggle logging camera changes - mapboxMap.addOnMapLongClickListener(this) + maplibreMap.addOnMapLongClickListener(this) } } @@ -71,7 +71,7 @@ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnCl val builder = AlertDialog.Builder(context) builder.setTitle(R.string.dialog_camera_position) builder.setView(onInflateDialogContent(dialogContent)) - builder.setPositiveButton("Animate", DialogClickListener(mapboxMap, dialogContent)) + builder.setPositiveButton("Animate", DialogClickListener(maplibreMap, dialogContent)) builder.setNegativeButton("Cancel", null) builder.setCancelable(false) builder.show() @@ -80,15 +80,15 @@ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnCl private fun toggleLogCameraChanges() { logCameraChanges = !logCameraChanges if (logCameraChanges) { - mapboxMap.addOnCameraIdleListener(idleListener) - mapboxMap.addOnCameraMoveCancelListener(moveCanceledListener) - mapboxMap.addOnCameraMoveListener(moveListener) - mapboxMap.addOnCameraMoveStartedListener(moveStartedListener) + maplibreMap.addOnCameraIdleListener(idleListener) + maplibreMap.addOnCameraMoveCancelListener(moveCanceledListener) + maplibreMap.addOnCameraMoveListener(moveListener) + maplibreMap.addOnCameraMoveStartedListener(moveStartedListener) } else { - mapboxMap.removeOnCameraIdleListener(idleListener) - mapboxMap.removeOnCameraMoveCancelListener(moveCanceledListener) - mapboxMap.removeOnCameraMoveListener(moveListener) - mapboxMap.removeOnCameraMoveStartedListener(moveStartedListener) + maplibreMap.removeOnCameraIdleListener(idleListener) + maplibreMap.removeOnCameraMoveCancelListener(moveCanceledListener) + maplibreMap.removeOnCameraMoveListener(moveListener) + maplibreMap.removeOnCameraMoveStartedListener(moveStartedListener) } } @@ -114,8 +114,8 @@ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnCl override fun onDestroy() { super.onDestroy() - if (::mapboxMap.isInitialized) { - mapboxMap.removeOnMapLongClickListener(this) + if (::maplibreMap.isInitialized) { + maplibreMap.removeOnMapLongClickListener(this) } if (::mapView.isInitialized) { mapView.onDestroy() @@ -190,7 +190,7 @@ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnCl } } - private class DialogClickListener(private val mapboxMap: MapboxMap?, private val dialogContent: View) : DialogInterface.OnClickListener { + private class DialogClickListener(private val maplibreMap: MapLibreMap?, private val dialogContent: View) : DialogInterface.OnClickListener { override fun onClick(dialog: DialogInterface, which: Int) { val latitude = (dialogContent.findViewById(R.id.value_lat) as TextView).text.toString().toDouble() val longitude = (dialogContent.findViewById(R.id.value_lon) as TextView).text.toString().toDouble() @@ -204,7 +204,7 @@ class CameraPositionActivity : FragmentActivity(), OnMapReadyCallback, View.OnCl val cameraPosition = CameraPosition.Builder().target(LatLng(latitude, longitude)).zoom(zoom).bearing(bearing).tilt(tilt).build() - mapboxMap?.animateCamera( + maplibreMap?.animateCamera( CameraUpdateFactory.newCameraPosition(cameraPosition), 5000, object : CancelableCallback { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/GestureDetectorActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/GestureDetectorActivity.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/GestureDetectorActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/GestureDetectorActivity.kt index 37eea9c3c..2076bf7e5 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/GestureDetectorActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/GestureDetectorActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.annotation.SuppressLint import android.os.Bundle @@ -13,25 +13,25 @@ import androidx.core.content.ContextCompat import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.mapbox.android.gestures.* -import com.mapbox.mapboxsdk.annotations.Marker -import com.mapbox.mapboxsdk.annotations.MarkerOptions -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.* -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.FontCache -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.annotations.Marker +import org.maplibre.android.annotations.MarkerOptions +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.* +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.FontCache +import org.maplibre.android.testapp.utils.ResourceUtils import java.lang.annotation.Retention import java.lang.annotation.RetentionPolicy /** Test activity showcasing APIs around gestures implementation. */ class GestureDetectorActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var recyclerView: RecyclerView private var gestureAlertsAdapter: GestureAlertsAdapter? = null private var gesturesManager: AndroidGesturesManager? = null @@ -43,9 +43,9 @@ class GestureDetectorActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - this@GestureDetectorActivity.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + OnMapReadyCallback { maplibreMap: MapLibreMap -> + this@GestureDetectorActivity.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) initializeMap() } ) @@ -92,17 +92,17 @@ class GestureDetectorActivity : AppCompatActivity() { } private fun initializeMap() { - gesturesManager = mapboxMap.gesturesManager + gesturesManager = maplibreMap.gesturesManager val layoutParams = recyclerView!!.layoutParams as RelativeLayout.LayoutParams layoutParams.height = (mapView.height / 1.75).toInt() layoutParams.width = mapView.width / 3 recyclerView!!.layoutParams = layoutParams attachListeners() - fixedFocalPointEnabled(mapboxMap.uiSettings.focalPoint != null) + fixedFocalPointEnabled(maplibreMap.uiSettings.focalPoint != null) } fun attachListeners() { - mapboxMap.addOnMoveListener( + maplibreMap.addOnMoveListener( object : OnMoveListener { override fun onMoveBegin(detector: MoveGestureDetector) { gestureAlertsAdapter!!.addAlert( @@ -124,7 +124,7 @@ class GestureDetectorActivity : AppCompatActivity() { } } ) - mapboxMap.addOnRotateListener( + maplibreMap.addOnRotateListener( object : OnRotateListener { override fun onRotateBegin(detector: RotateGestureDetector) { gestureAlertsAdapter!!.addAlert( @@ -146,7 +146,7 @@ class GestureDetectorActivity : AppCompatActivity() { } } ) - mapboxMap.addOnScaleListener( + maplibreMap.addOnScaleListener( object : OnScaleListener { override fun onScaleBegin(detector: StandardScaleGestureDetector) { gestureAlertsAdapter!!.addAlert( @@ -194,7 +194,7 @@ class GestureDetectorActivity : AppCompatActivity() { } } ) - mapboxMap.addOnShoveListener( + maplibreMap.addOnShoveListener( object : OnShoveListener { override fun onShoveBegin(detector: ShoveGestureDetector) { gestureAlertsAdapter!!.addAlert( @@ -223,7 +223,7 @@ class GestureDetectorActivity : AppCompatActivity() { } override fun onOptionsItemSelected(item: MenuItem): Boolean { - val uiSettings = mapboxMap.uiSettings + val uiSettings = maplibreMap.uiSettings when (item.itemId) { R.id.menu_gesture_focus_point -> { fixedFocalPointEnabled(focalPointLatLng == null) @@ -274,8 +274,8 @@ class GestureDetectorActivity : AppCompatActivity() { private fun fixedFocalPointEnabled(enabled: Boolean) { if (enabled) { focalPointLatLng = LatLng(51.50325, -0.12968) - marker = mapboxMap.addMarker(MarkerOptions().position(focalPointLatLng)) - mapboxMap.easeCamera( + marker = maplibreMap.addMarker(MarkerOptions().position(focalPointLatLng)) + maplibreMap.easeCamera( CameraUpdateFactory.newLatLngZoom(focalPointLatLng!!, 16.0), object : CancelableCallback { override fun onCancel() { @@ -289,18 +289,18 @@ class GestureDetectorActivity : AppCompatActivity() { ) } else { if (marker != null) { - mapboxMap.removeMarker(marker!!) + maplibreMap.removeMarker(marker!!) marker = null } focalPointLatLng = null - mapboxMap.uiSettings.focalPoint = null + maplibreMap.uiSettings.focalPoint = null } } private fun recalculateFocalPoint() { if (focalPointLatLng != null) { - mapboxMap.uiSettings.focalPoint = - mapboxMap.projection.toScreenLocation(focalPointLatLng!!) + maplibreMap.uiSettings.focalPoint = + maplibreMap.projection.toScreenLocation(focalPointLatLng!!) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/LatLngBoundsActivity.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/LatLngBoundsActivity.kt index aa08b72dd..7d30a15d1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/LatLngBoundsActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/LatLngBoundsActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.content.Context import android.os.Bundle @@ -8,24 +8,24 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.FeatureCollection.fromJson import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.Property.ICON_ANCHOR_CENTER -import com.mapbox.mapboxsdk.style.layers.PropertyFactory.* -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityLatlngboundsBinding -import com.mapbox.mapboxsdk.testapp.utils.GeoParseUtil -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.Property.ICON_ANCHOR_CENTER +import org.maplibre.android.style.layers.PropertyFactory.* +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityLatlngboundsBinding +import org.maplibre.android.testapp.utils.GeoParseUtil +import org.maplibre.android.utils.BitmapUtils import java.net.URISyntaxException /** Test activity showcasing using the LatLngBounds camera API. */ class LatLngBoundsActivity : AppCompatActivity() { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var bottomSheetBehavior: BottomSheetBehavior<*> private lateinit var bounds: LatLngBounds private lateinit var binding: ActivityLatlngboundsBinding @@ -49,7 +49,7 @@ class LatLngBoundsActivity : AppCompatActivity() { private fun initMapView(savedInstanceState: Bundle?) { binding.mapView.onCreate(savedInstanceState) binding.mapView.getMapAsync { map -> - mapboxMap = map + maplibreMap = map val featureCollection: FeatureCollection = fromJson(GeoParseUtil.loadStringFromAssets(this, "points-sf.geojson")) @@ -68,7 +68,7 @@ class LatLngBoundsActivity : AppCompatActivity() { } private fun loadStyle(featureCollection: FeatureCollection) { - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Streets")) .withLayer( @@ -104,8 +104,8 @@ class LatLngBoundsActivity : AppCompatActivity() { val offset = convertSlideOffset(slideOffset) val bottomPadding = (peekHeight * offset).toInt() - mapboxMap.getCameraForLatLngBounds(bounds, createPadding(bottomPadding)) - ?.let { mapboxMap.cameraPosition = it } + maplibreMap.getCameraForLatLngBounds(bounds, createPadding(bottomPadding)) + ?.let { maplibreMap.cameraPosition = it } } override fun onStateChanged(bottomSheet: View, newState: Int) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/ManualZoomActivity.kt similarity index 73% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/ManualZoomActivity.kt index 767a3d7cf..835644e82 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/ManualZoomActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.graphics.Point import android.os.Bundle @@ -6,11 +6,11 @@ import android.view.Menu import android.view.MenuItem import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R /** * Test activity showcasing the zoom Camera API. @@ -18,19 +18,19 @@ import com.mapbox.mapboxsdk.testapp.R * This includes zoomIn, zoomOut, zoomTo, zoomBy (center and custom focal point). */ class ManualZoomActivity : AppCompatActivity() { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_manual_zoom) mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - this@ManualZoomActivity.mapboxMap = mapboxMap - mapboxMap.setStyle( + mapView.getMapAsync { maplibreMap: MapLibreMap -> + this@ManualZoomActivity.maplibreMap = maplibreMap + maplibreMap.setStyle( Style.Builder().fromUri(Style.getPredefinedStyle("Satellite Hybrid")) ) - val uiSettings = this@ManualZoomActivity.mapboxMap.uiSettings + val uiSettings = this@ManualZoomActivity.maplibreMap.uiSettings uiSettings.setAllGesturesEnabled(false) } } @@ -43,24 +43,24 @@ class ManualZoomActivity : AppCompatActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { R.id.action_zoom_in -> { - mapboxMap.animateCamera(CameraUpdateFactory.zoomIn()) + maplibreMap.animateCamera(CameraUpdateFactory.zoomIn()) true } R.id.action_zoom_out -> { - mapboxMap.animateCamera(CameraUpdateFactory.zoomOut()) + maplibreMap.animateCamera(CameraUpdateFactory.zoomOut()) true } R.id.action_zoom_by -> { - mapboxMap.animateCamera(CameraUpdateFactory.zoomBy(2.0)) + maplibreMap.animateCamera(CameraUpdateFactory.zoomBy(2.0)) true } R.id.action_zoom_to -> { - mapboxMap.animateCamera(CameraUpdateFactory.zoomTo(2.0)) + maplibreMap.animateCamera(CameraUpdateFactory.zoomTo(2.0)) true } R.id.action_zoom_to_point -> { val view = window.decorView - mapboxMap.animateCamera( + maplibreMap.animateCamera( CameraUpdateFactory.zoomBy( 1.0, Point(view.measuredWidth / 4, view.measuredHeight / 4) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/MaxMinZoomActivity.kt similarity index 61% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/MaxMinZoomActivity.kt index db1167655..2363088bf 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/MaxMinZoomActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/MaxMinZoomActivity.kt @@ -1,23 +1,23 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishLoadingStyleListener -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapView.OnDidFinishLoadingStyleListener +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.OnMapClickListener +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R import timber.log.Timber /** Test activity showcasing using maximum and minimum zoom levels to restrict camera movement. */ class MaxMinZoomActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private val clickListener = OnMapClickListener { - if (mapboxMap != null) { - mapboxMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Outdoor"))) + if (maplibreMap != null) { + maplibreMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Outdoor"))) } true } @@ -33,12 +33,12 @@ class MaxMinZoomActivity : AppCompatActivity(), OnMapReadyCallback { ) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) - mapboxMap.setMinZoomPreference(3.0) - mapboxMap.setMaxZoomPreference(5.0) - mapboxMap.addOnMapClickListener(clickListener) + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) + maplibreMap.setMinZoomPreference(3.0) + maplibreMap.setMaxZoomPreference(5.0) + maplibreMap.addOnMapClickListener(clickListener) } override fun onStart() { @@ -68,8 +68,8 @@ class MaxMinZoomActivity : AppCompatActivity(), OnMapReadyCallback { override fun onDestroy() { super.onDestroy() - if (mapboxMap != null) { - mapboxMap.removeOnMapClickListener(clickListener) + if (maplibreMap != null) { + maplibreMap.removeOnMapClickListener(clickListener) } mapView.onDestroy() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ScrollByActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/ScrollByActivity.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ScrollByActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/ScrollByActivity.kt index 6a3cb969e..ba697abd1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ScrollByActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/ScrollByActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.camera +package org.maplibre.android.testapp.activity.camera import android.os.Bundle import android.view.MenuItem @@ -11,18 +11,18 @@ import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R /** * Test activity showcasing using the scrollBy Camera API by moving x,y pixels above Grenada, Spain. */ class ScrollByActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var seekBarX: SeekBar private lateinit var seekBarY: SeekBar override fun onCreate(savedInstanceState: Bundle?) { @@ -51,16 +51,16 @@ class ScrollByActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.getPredefinedStyle("Pastel")) - val uiSettings = mapboxMap.uiSettings + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.getPredefinedStyle("Pastel")) + val uiSettings = maplibreMap.uiSettings uiSettings.isLogoEnabled = false uiSettings.isAttributionEnabled = false val fab = findViewById(R.id.fab) fab.setColorFilter(ContextCompat.getColor(this@ScrollByActivity, R.color.primary)) fab.setOnClickListener { view: View? -> - mapboxMap.scrollBy( + maplibreMap.scrollBy( (seekBarX!!.progress * MULTIPLIER_PER_PIXEL).toFloat(), (seekBarY!!.progress * MULTIPLIER_PER_PIXEL).toFloat() ) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/customlayer/CustomLayerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/customlayer/CustomLayerActivity.kt similarity index 78% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/customlayer/CustomLayerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/customlayer/CustomLayerActivity.kt index 5b8d813fc..98faed587 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/customlayer/CustomLayerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/customlayer/CustomLayerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.customlayer +package org.maplibre.android.testapp.activity.customlayer import android.os.Bundle import android.view.Menu @@ -7,15 +7,15 @@ import android.view.View import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.CustomLayer -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.model.customlayer.ExampleCustomLayer +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.CustomLayer +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.model.customlayer.ExampleCustomLayer /** * Test activity showcasing the Custom Layer API @@ -25,7 +25,7 @@ import com.mapbox.mapboxsdk.testapp.model.customlayer.ExampleCustomLayer * */ class CustomLayerActivity : AppCompatActivity() { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private var customLayer: CustomLayer? = null private lateinit var fab: FloatingActionButton @@ -35,15 +35,15 @@ class CustomLayerActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> - mapboxMap = map!! - mapboxMap.moveCamera( + OnMapReadyCallback { map: MapLibreMap? -> + maplibreMap = map!! + maplibreMap.moveCamera( CameraUpdateFactory.newLatLngZoom( LatLng(39.91448, -243.60947), 10.0 ) ) - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> initFab() } + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> initFab() } } ) } @@ -53,7 +53,7 @@ class CustomLayerActivity : AppCompatActivity() { fab.setColorFilter(ContextCompat.getColor(this, R.color.primary)) fab.setOnClickListener( View.OnClickListener { view: View? -> - if (mapboxMap != null) { + if (maplibreMap != null) { swapCustomLayer() } } @@ -61,7 +61,7 @@ class CustomLayerActivity : AppCompatActivity() { } private fun swapCustomLayer() { - val style = mapboxMap.style + val style = maplibreMap.style if (customLayer != null) { style!!.removeLayer(customLayer!!) customLayer = null @@ -77,8 +77,8 @@ class CustomLayerActivity : AppCompatActivity() { } private fun updateLayer() { - if (mapboxMap != null) { - mapboxMap.triggerRepaint() + if (maplibreMap != null) { + maplibreMap.triggerRepaint() } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/DeviceIndependentTestActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/DeviceIndependentTestActivity.kt similarity index 73% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/DeviceIndependentTestActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/DeviceIndependentTestActivity.kt index f230efe36..f6851afe1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/DeviceIndependentTestActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/DeviceIndependentTestActivity.kt @@ -1,16 +1,16 @@ -package com.mapbox.mapboxsdk.testapp.activity.espresso +package org.maplibre.android.testapp.activity.espresso import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R class DeviceIndependentTestActivity : AppCompatActivity(), OnMapReadyCallback { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap protected set override fun onCreate(savedInstanceState: Bundle?) { @@ -23,9 +23,9 @@ class DeviceIndependentTestActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) } public override fun onResume() { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/EspressoTestActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/EspressoTestActivity.kt index 067e3caa4..1d2c6e9f9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/EspressoTestActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/EspressoTestActivity.kt @@ -1,17 +1,17 @@ -package com.mapbox.mapboxsdk.testapp.activity.espresso +package org.maplibre.android.testapp.activity.espresso import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.testapp.R /** * Base activity for instrumentation testing. */ class EspressoTestActivity : AppCompatActivity() { lateinit var mapView: MapView - protected lateinit var mapboxMap: MapboxMap + protected lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_espresso_test) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/PixelTestActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/PixelTestActivity.kt similarity index 73% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/PixelTestActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/PixelTestActivity.kt index 9db78a7f0..608b9b032 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/espresso/PixelTestActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/espresso/PixelTestActivity.kt @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.testapp.activity.espresso +package org.maplibre.android.testapp.activity.espresso import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R /** * Test activity used for instrumentation tests that require a specific device size. @@ -14,7 +14,7 @@ import com.mapbox.mapboxsdk.testapp.R class PixelTestActivity : AppCompatActivity(), OnMapReadyCallback { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -24,9 +24,9 @@ class PixelTestActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) } public override fun onResume() { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.kt index 663f5845a..dc3b37b0f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxCountActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.feature +package org.maplibre.android.testapp.activity.feature import android.graphics.PointF import android.graphics.RectF @@ -8,11 +8,11 @@ import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.Feature -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.NavUtils +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.NavUtils import timber.log.Timber /** @@ -20,7 +20,7 @@ import timber.log.Timber */ class QueryRenderedFeaturesBoxCountActivity : AppCompatActivity() { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap private set override fun onCreate(savedInstanceState: Bundle?) { @@ -31,9 +31,9 @@ class QueryRenderedFeaturesBoxCountActivity : AppCompatActivity() { // Initialize map as normal mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - this@QueryRenderedFeaturesBoxCountActivity.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Streets"))) + mapView.getMapAsync { maplibreMap: MapLibreMap -> + this@QueryRenderedFeaturesBoxCountActivity.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Streets"))) selectionBox.setOnClickListener { view: View? -> // Query val top = selectionBox.top - mapView.top @@ -45,7 +45,7 @@ class QueryRenderedFeaturesBoxCountActivity : AppCompatActivity() { (top + selectionBox.height).toFloat() ) Timber.i("Querying box %s", box) - val features = mapboxMap.queryRenderedFeatures(box) + val features = maplibreMap.queryRenderedFeatures(box) // Show count Toast.makeText( @@ -90,9 +90,9 @@ class QueryRenderedFeaturesBoxCountActivity : AppCompatActivity() { super.onStart() mapView.onStart() - if (::mapboxMap.isInitialized) { + if (::maplibreMap.isInitialized) { // Regression test for #14394 - mapboxMap.queryRenderedFeatures(PointF(0F, 0F)) + maplibreMap.queryRenderedFeatures(PointF(0F, 0F)) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.kt similarity index 79% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.kt index a6500def9..5a135ce43 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxHighlightActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.feature +package org.maplibre.android.testapp.activity.feature import android.graphics.Color import android.graphics.RectF @@ -7,15 +7,15 @@ import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.FeatureCollection -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.FillLayer -import com.mapbox.mapboxsdk.style.layers.Layer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.FillLayer +import org.maplibre.android.style.layers.Layer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import timber.log.Timber /** @@ -23,7 +23,7 @@ import timber.log.Timber */ class QueryRenderedFeaturesBoxHighlightActivity : AppCompatActivity() { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap private set override fun onCreate(savedInstanceState: Bundle?) { @@ -34,8 +34,8 @@ class QueryRenderedFeaturesBoxHighlightActivity : AppCompatActivity() { // Initialize map as normal mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - this@QueryRenderedFeaturesBoxHighlightActivity.mapboxMap = mapboxMap + mapView.getMapAsync { maplibreMap: MapLibreMap -> + this@QueryRenderedFeaturesBoxHighlightActivity.maplibreMap = maplibreMap // Add layer / source val source = GeoJsonSource("highlighted-shapes-source") @@ -56,7 +56,7 @@ class QueryRenderedFeaturesBoxHighlightActivity : AppCompatActivity() { Expression.toNumber(Expression.get("height")), Expression.literal(10) ) - val features = mapboxMap.queryRenderedFeatures(box, filter, "building") + val features = maplibreMap.queryRenderedFeatures(box, filter, "building") // Show count Toast.makeText( @@ -68,7 +68,7 @@ class QueryRenderedFeaturesBoxHighlightActivity : AppCompatActivity() { // Update source data source.setGeoJson(FeatureCollection.fromFeatures(features)) } - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Streets")) .withSource(source) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.kt index 69e2da923..e18e400fd 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesBoxSymbolCountActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.feature +package org.maplibre.android.testapp.activity.feature import android.graphics.BitmapFactory import android.graphics.RectF @@ -6,16 +6,16 @@ import android.os.Bundle import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.BackgroundLayer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.BackgroundLayer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.ResourceUtils import timber.log.Timber import java.io.IOException @@ -24,7 +24,7 @@ import java.io.IOException */ class QueryRenderedFeaturesBoxSymbolCountActivity : AppCompatActivity() { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap private set private lateinit var toast: Toast override fun onCreate(savedInstanceState: Bundle?) { @@ -35,8 +35,8 @@ class QueryRenderedFeaturesBoxSymbolCountActivity : AppCompatActivity() { // Initialize map as normal mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - this@QueryRenderedFeaturesBoxSymbolCountActivity.mapboxMap = mapboxMap + mapView.getMapAsync { maplibreMap: MapLibreMap -> + this@QueryRenderedFeaturesBoxSymbolCountActivity.maplibreMap = maplibreMap try { val testPoints = ResourceUtils.readRawResource( mapView.context, @@ -44,7 +44,7 @@ class QueryRenderedFeaturesBoxSymbolCountActivity : AppCompatActivity() { ) val markerImage = BitmapFactory.decodeResource(resources, R.drawable.maplibre_marker_icon_default) - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .withLayer( BackgroundLayer("bg") @@ -77,7 +77,7 @@ class QueryRenderedFeaturesBoxSymbolCountActivity : AppCompatActivity() { (top + selectionBox.height).toFloat() ) Timber.i("Querying box %s", box) - val features = mapboxMap.queryRenderedFeatures(box, "symbols-layer") + val features = maplibreMap.queryRenderedFeatures(box, "symbols-layer") // Show count if (toast != null) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.kt similarity index 81% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.kt index 4c194aab9..a8d40cc00 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QueryRenderedFeaturesPropertiesActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.feature +package org.maplibre.android.testapp.activity.feature import android.graphics.Color import android.os.Bundle @@ -9,14 +9,14 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.Feature -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions -import com.mapbox.mapboxsdk.annotations.Marker -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.InfoWindowAdapter -import com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.annotations.BaseMarkerOptions +import org.maplibre.android.annotations.Marker +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.InfoWindowAdapter +import org.maplibre.android.maps.MapLibreMap.OnMapClickListener +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R import timber.log.Timber /** @@ -24,12 +24,12 @@ import timber.log.Timber */ class QueryRenderedFeaturesPropertiesActivity : AppCompatActivity() { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap private set private var marker: Marker? = null private val mapClickListener = OnMapClickListener { point -> val density = resources.displayMetrics.density - val pixel = mapboxMap.projection.toScreenLocation(point) + val pixel = maplibreMap.projection.toScreenLocation(point) Timber.i( "Requesting features for %sx%s (%sx%s adjusted for density)", pixel.x, @@ -37,19 +37,19 @@ class QueryRenderedFeaturesPropertiesActivity : AppCompatActivity() { pixel.x / density, pixel.y / density ) - val features = mapboxMap.queryRenderedFeatures(pixel) + val features = maplibreMap.queryRenderedFeatures(pixel) // Debug output debugOutput(features) // Remove any previous markers if (marker != null) { - mapboxMap.removeMarker(marker!!) + maplibreMap.removeMarker(marker!!) } // Add a marker on the clicked point - marker = mapboxMap.addMarker(CustomMarkerOptions().position(point)!!.features(features)) - mapboxMap.selectMarker(marker!!) + marker = maplibreMap.addMarker(CustomMarkerOptions().position(point)!!.features(features)) + maplibreMap.selectMarker(marker!!) true } @@ -60,15 +60,15 @@ class QueryRenderedFeaturesPropertiesActivity : AppCompatActivity() { // Initialize map as normal mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> - this@QueryRenderedFeaturesPropertiesActivity.mapboxMap = mapboxMap + mapView.getMapAsync { maplibreMap: MapLibreMap -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> + this@QueryRenderedFeaturesPropertiesActivity.maplibreMap = maplibreMap // Add custom window adapter - addCustomInfoWindowAdapter(mapboxMap) + addCustomInfoWindowAdapter(maplibreMap) // Add a click listener - mapboxMap.addOnMapClickListener(mapClickListener) + maplibreMap.addOnMapClickListener(mapClickListener) } } } @@ -99,8 +99,8 @@ class QueryRenderedFeaturesPropertiesActivity : AppCompatActivity() { } } - private fun addCustomInfoWindowAdapter(mapboxMap: MapboxMap) { - mapboxMap.infoWindowAdapter = object : InfoWindowAdapter { + private fun addCustomInfoWindowAdapter(maplibreMap: MapLibreMap) { + maplibreMap.infoWindowAdapter = object : InfoWindowAdapter { private fun row(text: String): TextView { val view = TextView(this@QueryRenderedFeaturesPropertiesActivity) view.text = text @@ -160,8 +160,8 @@ class QueryRenderedFeaturesPropertiesActivity : AppCompatActivity() { override fun onDestroy() { super.onDestroy() - if (mapboxMap != null) { - mapboxMap.removeOnMapClickListener(mapClickListener) + if (maplibreMap != null) { + maplibreMap.removeOnMapClickListener(mapClickListener) } mapView.onDestroy() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QuerySourceFeaturesActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QuerySourceFeaturesActivity.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QuerySourceFeaturesActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QuerySourceFeaturesActivity.kt index ffd9eac04..f0e7264a4 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/feature/QuerySourceFeaturesActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/feature/QuerySourceFeaturesActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.feature +package org.maplibre.android.testapp.activity.feature import android.os.Bundle import android.view.View @@ -10,21 +10,21 @@ import com.google.gson.JsonObject import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.CircleLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.CircleLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R /** * Test activity showcasing using the query source features API to query feature counts */ class QuerySourceFeaturesActivity : AppCompatActivity() { lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_query_source_features) @@ -32,12 +32,12 @@ class QuerySourceFeaturesActivity : AppCompatActivity() { // Initialize map as normal mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { map: MapboxMap? -> + mapView.getMapAsync { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } - mapboxMap.getStyle { style: Style -> initStyle(style) } - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + maplibreMap.getStyle { style: Style -> initStyle(style) } + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) } } @@ -63,7 +63,7 @@ class QuerySourceFeaturesActivity : AppCompatActivity() { style.addLayer(layer) // Add a click listener - mapboxMap.addOnMapClickListener { point: LatLng? -> + maplibreMap.addOnMapClickListener { point: LatLng? -> // Query val features = source.querySourceFeatures( Expression.eq( diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/FragmentBackStackActivity.kt similarity index 78% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/FragmentBackStackActivity.kt index b3b79447f..5a86f827f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/FragmentBackStackActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/FragmentBackStackActivity.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.testapp.activity.fragment +package org.maplibre.android.testapp.activity.fragment import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.maps.SupportMapFragment -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityBackstackFragmentBinding -import com.mapbox.mapboxsdk.testapp.utils.NavUtils +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.maps.SupportMapFragment +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityBackstackFragmentBinding +import org.maplibre.android.testapp.utils.NavUtils /** * Test activity showcasing using the MapFragment API as part of a backstacked fragment. @@ -44,9 +44,9 @@ class FragmentBackStackActivity : AppCompatActivity() { binding.button.setOnClickListener { handleClick() } } - private fun initMap(mapboxMap: MapboxMap) { - mapboxMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) { - mapboxMap.setPadding(300, 300, 300, 300) + private fun initMap(maplibreMap: MapLibreMap) { + maplibreMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) { + maplibreMap.setPadding(300, 300, 300, 300) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/MapFragmentActivity.kt similarity index 72% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/MapFragmentActivity.kt index 232cca8a8..4a7f7f7a6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MapFragmentActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/MapFragmentActivity.kt @@ -1,14 +1,14 @@ -package com.mapbox.mapboxsdk.testapp.activity.fragment +package org.maplibre.android.testapp.activity.fragment import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* // ktlint-disable no-wildcard-imports -import com.mapbox.mapboxsdk.maps.MapFragment.OnMapViewReadyCallback -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishRenderingFrameListener -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* // ktlint-disable no-wildcard-imports +import org.maplibre.android.maps.MapFragment.OnMapViewReadyCallback +import org.maplibre.android.maps.MapView.OnDidFinishRenderingFrameListener +import org.maplibre.android.testapp.R /** * Test activity showcasing using the MapFragment API using SDK Fragments. @@ -22,7 +22,7 @@ class MapFragmentActivity : OnMapViewReadyCallback, OnMapReadyCallback, OnDidFinishRenderingFrameListener { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private var initialCameraAnimation = true override fun onCreate(savedInstanceState: Bundle?) { @@ -41,8 +41,8 @@ class MapFragmentActivity : mapFragment.getMapAsync(this) } - private fun createFragmentOptions(): MapboxMapOptions { - val options = MapboxMapOptions.createFromAttributes(this, null) + private fun createFragmentOptions(): MapLibreMapOptions { + val options = MapLibreMapOptions.createFromAttributes(this, null) options.scrollGesturesEnabled(false) options.zoomGesturesEnabled(false) options.tiltGesturesEnabled(false) @@ -65,9 +65,9 @@ class MapFragmentActivity : mapView.addOnDidFinishRenderingFrameListener(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.getPredefinedStyle("Outdoor")) + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.getPredefinedStyle("Outdoor")) } override fun onDestroy() { @@ -78,8 +78,8 @@ class MapFragmentActivity : } override fun onDidFinishRenderingFrame(fully: Boolean) { - if (initialCameraAnimation && fully && mapboxMap != null) { - mapboxMap.animateCamera( + if (initialCameraAnimation && fully && maplibreMap != null) { + maplibreMap.animateCamera( CameraUpdateFactory.newCameraPosition(CameraPosition.Builder().tilt(45.0).build()), 5000 ) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MultiMapActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/MultiMapActivity.kt similarity index 73% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MultiMapActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/MultiMapActivity.kt index f9838b9da..05c989d94 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/MultiMapActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/MultiMapActivity.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.testapp.activity.fragment +package org.maplibre.android.testapp.activity.fragment import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.maps.SupportMapFragment -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.maps.SupportMapFragment +import org.maplibre.android.testapp.R /** * Test Activity showcasing using multiple static map fragments in one layout. @@ -29,6 +29,6 @@ class MultiMapActivity : AppCompatActivity() { styleId: String ) { (fragmentManager.findFragmentById(fragmentId) as SupportMapFragment?) - ?.getMapAsync(OnMapReadyCallback { mapboxMap: MapboxMap -> mapboxMap.setStyle(styleId) }) + ?.getMapAsync(OnMapReadyCallback { maplibreMap: MapLibreMap -> maplibreMap.setStyle(styleId) }) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/NestedViewPagerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/NestedViewPagerActivity.kt similarity index 93% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/NestedViewPagerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/NestedViewPagerActivity.kt index 1149e5d9e..cbb5582ad 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/NestedViewPagerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/NestedViewPagerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.fragment +package org.maplibre.android.testapp.activity.fragment import android.annotation.SuppressLint import android.content.Context @@ -8,13 +8,13 @@ import android.view.View import android.view.ViewGroup import android.widget.TextView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapboxMapOptions -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.maps.SupportMapFragment -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityRecyclerviewBinding +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapLibreMapOptions +import org.maplibre.android.maps.Style +import org.maplibre.android.maps.SupportMapFragment +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityRecyclerviewBinding /** * TestActivity showcasing how to integrate a MapView in a RecyclerView. @@ -102,7 +102,7 @@ class NestedViewPagerActivity : AppCompatActivity() { class MapPagerAdapter(private val context: Context, fm: androidx.fragment.app.FragmentManager) : androidx.fragment.app.FragmentStatePagerAdapter(fm) { override fun getItem(position: Int): androidx.fragment.app.Fragment { - val options = MapboxMapOptions.createFromAttributes(context) + val options = MapLibreMapOptions.createFromAttributes(context) options.textureMode(true) options.doubleTapGesturesEnabled(false) options.rotateGesturesEnabled(false) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/SupportMapFragmentActivity.kt similarity index 72% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/SupportMapFragmentActivity.kt index 71c3f0e6c..876617a7b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/SupportMapFragmentActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/SupportMapFragmentActivity.kt @@ -1,14 +1,14 @@ -package com.mapbox.mapboxsdk.testapp.activity.fragment +package org.maplibre.android.testapp.activity.fragment import android.os.Bundle // ktlint-disable import-ordering import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* // ktlint-disable no-wildcard-imports -import com.mapbox.mapboxsdk.maps.MapFragment.OnMapViewReadyCallback -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishRenderingFrameListener -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* // ktlint-disable no-wildcard-imports +import org.maplibre.android.maps.MapFragment.OnMapViewReadyCallback +import org.maplibre.android.maps.MapView.OnDidFinishRenderingFrameListener +import org.maplibre.android.testapp.R /** * Test activity showcasing using the MapFragment API using Support Library Fragments. @@ -22,7 +22,7 @@ class SupportMapFragmentActivity : OnMapViewReadyCallback, OnMapReadyCallback, OnDidFinishRenderingFrameListener { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private var initialCameraAnimation = true override fun onCreate(savedInstanceState: Bundle?) { @@ -41,8 +41,8 @@ class SupportMapFragmentActivity : mapFragment!!.getMapAsync(this) } - private fun createFragmentOptions(): MapboxMapOptions { - val options = MapboxMapOptions.createFromAttributes(this, null) + private fun createFragmentOptions(): MapLibreMapOptions { + val options = MapLibreMapOptions.createFromAttributes(this, null) options.scrollGesturesEnabled(false) options.zoomGesturesEnabled(false) options.tiltGesturesEnabled(false) @@ -65,9 +65,9 @@ class SupportMapFragmentActivity : mapView.addOnDidFinishRenderingFrameListener(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) } override fun onDestroy() { @@ -76,8 +76,8 @@ class SupportMapFragmentActivity : } override fun onDidFinishRenderingFrame(fully: Boolean) { - if (initialCameraAnimation && fully && mapboxMap != null) { - mapboxMap.animateCamera( + if (initialCameraAnimation && fully && maplibreMap != null) { + maplibreMap.animateCamera( CameraUpdateFactory.newCameraPosition(CameraPosition.Builder().tilt(45.0).build()), 5000 ) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/ViewPagerActivity.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/ViewPagerActivity.kt index 4862ae6c5..523d2fedb 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/fragment/ViewPagerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/fragment/ViewPagerActivity.kt @@ -1,14 +1,14 @@ -package com.mapbox.mapboxsdk.testapp.activity.fragment +package org.maplibre.android.testapp.activity.fragment import android.content.Context import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapboxMapOptions -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.maps.SupportMapFragment -import com.mapbox.mapboxsdk.testapp.databinding.ActivityViewpagerBinding +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapLibreMapOptions +import org.maplibre.android.maps.Style +import org.maplibre.android.maps.SupportMapFragment +import org.maplibre.android.testapp.databinding.ActivityViewpagerBinding /** * Test activity showcasing using the Android SDK ViewPager API to show MapFragments. @@ -45,7 +45,7 @@ class ViewPagerActivity : AppCompatActivity() { } override fun getItem(position: Int): androidx.fragment.app.Fragment { - val options = MapboxMapOptions.createFromAttributes(context) + val options = MapLibreMapOptions.createFromAttributes(context) options.textureMode(true) options.camera( CameraPosition.Builder() diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/PrintActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/imagegenerator/PrintActivity.kt similarity index 66% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/PrintActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/imagegenerator/PrintActivity.kt index 9569dfdcd..0a9d6550b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/PrintActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/imagegenerator/PrintActivity.kt @@ -1,39 +1,39 @@ -package com.mapbox.mapboxsdk.testapp.activity.imagegenerator +package org.maplibre.android.testapp.activity.imagegenerator import android.graphics.Bitmap import android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity import androidx.print.PrintHelper -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R /** * Test activity showcasing using the Snaphot API to print a Map. */ -class PrintActivity : AppCompatActivity(), MapboxMap.SnapshotReadyCallback { +class PrintActivity : AppCompatActivity(), MapLibreMap.SnapshotReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_print) mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) - mapView.getMapAsync(OnMapReadyCallback { mapboxMap: MapboxMap -> initMap(mapboxMap) }) + mapView.getMapAsync(OnMapReadyCallback { maplibreMap: MapLibreMap -> initMap(maplibreMap) }) val fab = findViewById(R.id.fab) fab?.setOnClickListener { view: View? -> - if (mapboxMap != null && mapboxMap.style != null) { - mapboxMap.snapshot(this@PrintActivity) + if (maplibreMap != null && maplibreMap.style != null) { + maplibreMap.snapshot(this@PrintActivity) } } } - private fun initMap(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + private fun initMap(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) } override fun onSnapshotReady(snapshot: Bitmap) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/imagegenerator/SnapshotActivity.kt similarity index 75% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/imagegenerator/SnapshotActivity.kt index 21e5fc502..cd062541b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/imagegenerator/SnapshotActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/imagegenerator/SnapshotActivity.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.testapp.activity.imagegenerator +package org.maplibre.android.testapp.activity.imagegenerator import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.log.Logger -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.databinding.ActivitySnapshotBinding +import org.maplibre.android.log.Logger +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.databinding.ActivitySnapshotBinding import timber.log.Timber /** @@ -17,14 +17,14 @@ class SnapshotActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var binding: ActivitySnapshotBinding - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private val idleListener = object : MapView.OnDidFinishRenderingFrameListener { override fun onDidFinishRenderingFrame(fully: Boolean) { if (fully) { binding.mapView.removeOnDidFinishRenderingFrameListener(this) Logger.v(TAG, LOG_MESSAGE) - mapboxMap.snapshot { snapshot -> + maplibreMap.snapshot { snapshot -> binding.imageView.setImageBitmap(snapshot) binding.mapView.addOnDidFinishRenderingFrameListener(this) } @@ -40,9 +40,9 @@ class SnapshotActivity : AppCompatActivity(), OnMapReadyCallback { binding.mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Outdoor"))) { binding.mapView.addOnDidFinishRenderingFrameListener(idleListener) } + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Outdoor"))) { binding.mapView.addOnDidFinishRenderingFrameListener(idleListener) } } override fun onStart() { @@ -57,7 +57,7 @@ class SnapshotActivity : AppCompatActivity(), OnMapReadyCallback { override fun onPause() { super.onPause() - mapboxMap.snapshot { + maplibreMap.snapshot { Timber.e("Regression test for https://github.com/mapbox/mapbox-gl-native/pull/11358") } binding.mapView.onPause() diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.kt similarity index 70% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.kt index 68234482d..a9a33f620 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/DynamicInfoWindowAdapterActivity.kt @@ -1,29 +1,29 @@ -package com.mapbox.mapboxsdk.testapp.activity.infowindow +package org.maplibre.android.testapp.activity.infowindow import android.graphics.Color import android.os.Bundle import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.core.content.res.ResourcesCompat -import com.mapbox.mapboxsdk.annotations.Marker -import com.mapbox.mapboxsdk.annotations.MarkerOptions -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.InfoWindowAdapter -import com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.IconUtils +import org.maplibre.android.annotations.Marker +import org.maplibre.android.annotations.MarkerOptions +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.InfoWindowAdapter +import org.maplibre.android.maps.MapLibreMap.OnMapClickListener +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.IconUtils import java.util.* /** * Test activity showcasing how to dynamically update InfoWindow when Using an MapboxMap.InfoWindowAdapter. */ class DynamicInfoWindowAdapterActivity : AppCompatActivity(), OnMapReadyCallback { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private var marker: Marker? = null private val mapClickListener = OnMapClickListener { point -> @@ -56,29 +56,29 @@ class DynamicInfoWindowAdapterActivity : AppCompatActivity(), OnMapReadyCallback mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Streets")) // Add info window adapter - addCustomInfoWindowAdapter(mapboxMap!!) + addCustomInfoWindowAdapter(maplibreMap!!) // Keep info windows open on click - mapboxMap.uiSettings.isDeselectMarkersOnTap = false + maplibreMap.uiSettings.isDeselectMarkersOnTap = false // Add a marker - marker = addMarker(mapboxMap!!) - mapboxMap.selectMarker(marker!!) + marker = addMarker(maplibreMap!!) + maplibreMap.selectMarker(marker!!) // On map click, change the info window contents - mapboxMap.addOnMapClickListener(mapClickListener) + maplibreMap.addOnMapClickListener(mapClickListener) // Focus on Paris - mapboxMap.animateCamera(CameraUpdateFactory.newLatLng(PARIS)) + maplibreMap.animateCamera(CameraUpdateFactory.newLatLng(PARIS)) } - private fun addMarker(mapboxMap: MapboxMap): Marker { - return mapboxMap.addMarker( + private fun addMarker(maplibreMap: MapLibreMap): Marker { + return maplibreMap.addMarker( MarkerOptions() .position(PARIS) .icon( @@ -91,9 +91,9 @@ class DynamicInfoWindowAdapterActivity : AppCompatActivity(), OnMapReadyCallback ) } - private fun addCustomInfoWindowAdapter(mapboxMap: MapboxMap) { + private fun addCustomInfoWindowAdapter(maplibreMap: MapLibreMap) { val padding = resources.getDimension(R.dimen.attr_margin).toInt() - mapboxMap.infoWindowAdapter = InfoWindowAdapter { marker: Marker -> + maplibreMap.infoWindowAdapter = InfoWindowAdapter { marker: Marker -> val textView = TextView(this@DynamicInfoWindowAdapterActivity) textView.text = marker.title textView.setBackgroundColor(Color.WHITE) @@ -130,8 +130,8 @@ class DynamicInfoWindowAdapterActivity : AppCompatActivity(), OnMapReadyCallback override fun onDestroy() { super.onDestroy() - if (mapboxMap != null) { - mapboxMap.removeOnMapClickListener(mapClickListener) + if (maplibreMap != null) { + maplibreMap.removeOnMapClickListener(mapClickListener) } mapView.onDestroy() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/InfoWindowActivity.kt similarity index 72% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/InfoWindowActivity.kt index 3a2f7e169..f9c68514d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/InfoWindowActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.infowindow +package org.maplibre.android.testapp.activity.infowindow import android.os.Bundle import android.view.Menu @@ -6,18 +6,18 @@ import android.view.MenuItem import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.annotations.Marker -import com.mapbox.mapboxsdk.annotations.MarkerOptions -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.OnInfoWindowClickListener -import com.mapbox.mapboxsdk.maps.MapboxMap.OnInfoWindowCloseListener -import com.mapbox.mapboxsdk.maps.MapboxMap.OnInfoWindowLongClickListener -import com.mapbox.mapboxsdk.maps.MapboxMap.OnMapLongClickListener -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.annotations.Marker +import org.maplibre.android.annotations.MarkerOptions +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.OnInfoWindowClickListener +import org.maplibre.android.maps.MapLibreMap.OnInfoWindowCloseListener +import org.maplibre.android.maps.MapLibreMap.OnInfoWindowLongClickListener +import org.maplibre.android.maps.MapLibreMap.OnMapLongClickListener +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R import java.text.DecimalFormat /** @@ -33,18 +33,18 @@ class InfoWindowActivity : OnInfoWindowCloseListener, OnInfoWindowClickListener, OnInfoWindowLongClickListener { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private var customMarker: Marker? = null private val mapLongClickListener = OnMapLongClickListener { point -> if (customMarker != null) { // Remove previous added marker - mapboxMap.removeAnnotation(customMarker!!) + maplibreMap.removeAnnotation(customMarker!!) customMarker = null } // Add marker on long click location with default marker image - customMarker = mapboxMap.addMarker( + customMarker = maplibreMap.addMarker( MarkerOptions() .title("Custom Marker") .snippet( @@ -64,34 +64,34 @@ class InfoWindowActivity : mapView.getMapAsync(this) } - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> addMarkers() addInfoWindowListeners() } } private fun addMarkers() { - mapboxMap.addMarker( + maplibreMap.addMarker( MarkerOptions() .title("Intersection") .snippet("H St NW with 15th St NW") .position(LatLng(38.9002073, -77.03364419)) ) - mapboxMap.addMarker( + maplibreMap.addMarker( MarkerOptions().title("Intersection") .snippet("E St NW with 17th St NW") .position(LatLng(38.8954236, -77.0394623)) ) - mapboxMap.addMarker( + maplibreMap.addMarker( MarkerOptions().title("The Ellipse").position(LatLng(38.89393, -77.03654)) ) - mapboxMap.addMarker(MarkerOptions().position(LatLng(38.89596, -77.03434))) - mapboxMap.addMarker( + maplibreMap.addMarker(MarkerOptions().position(LatLng(38.89596, -77.03434))) + maplibreMap.addMarker( MarkerOptions().snippet("Lafayette Square").position(LatLng(38.89949, -77.03656)) ) - val marker = mapboxMap.addMarker( + val marker = maplibreMap.addMarker( MarkerOptions() .title("White House") .snippet( @@ -103,23 +103,23 @@ class InfoWindowActivity : ) // open InfoWindow at startup - mapboxMap.selectMarker(marker) + maplibreMap.selectMarker(marker) } private fun addInfoWindowListeners() { - mapboxMap.onInfoWindowCloseListener = this - mapboxMap.addOnMapLongClickListener(mapLongClickListener) - mapboxMap.onInfoWindowClickListener = this - mapboxMap.onInfoWindowLongClickListener = this + maplibreMap.onInfoWindowCloseListener = this + maplibreMap.addOnMapLongClickListener(mapLongClickListener) + maplibreMap.onInfoWindowClickListener = this + maplibreMap.onInfoWindowLongClickListener = this } private fun toggleConcurrentInfoWindow(allowConcurrentInfoWindow: Boolean) { - mapboxMap.deselectMarkers() - mapboxMap.isAllowConcurrentMultipleOpenInfoWindows = allowConcurrentInfoWindow + maplibreMap.deselectMarkers() + maplibreMap.isAllowConcurrentMultipleOpenInfoWindows = allowConcurrentInfoWindow } private fun toggleDeselectMarkersOnTap(deselectMarkersOnTap: Boolean) { - mapboxMap.uiSettings.isDeselectMarkersOnTap = deselectMarkersOnTap + maplibreMap.uiSettings.isDeselectMarkersOnTap = deselectMarkersOnTap } override fun onInfoWindowClick(marker: Marker): Boolean { @@ -163,8 +163,8 @@ class InfoWindowActivity : override fun onDestroy() { super.onDestroy() - if (mapboxMap != null) { - mapboxMap.removeOnMapLongClickListener(mapLongClickListener) + if (maplibreMap != null) { + maplibreMap.removeOnMapLongClickListener(mapLongClickListener) } mapView.onDestroy() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowAdapterActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/InfoWindowAdapterActivity.kt similarity index 73% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowAdapterActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/InfoWindowAdapterActivity.kt index bc1edc028..a628dc7f5 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/infowindow/InfoWindowAdapterActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/infowindow/InfoWindowAdapterActivity.kt @@ -1,36 +1,36 @@ -package com.mapbox.mapboxsdk.testapp.activity.infowindow +package org.maplibre.android.testapp.activity.infowindow import android.graphics.Color import android.os.Bundle import android.view.View import android.widget.TextView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.annotations.Marker -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.InfoWindowAdapter -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.model.annotations.CityStateMarker -import com.mapbox.mapboxsdk.testapp.model.annotations.CityStateMarkerOptions -import com.mapbox.mapboxsdk.testapp.utils.IconUtils +import org.maplibre.android.annotations.Marker +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.InfoWindowAdapter +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.model.annotations.CityStateMarker +import org.maplibre.android.testapp.model.annotations.CityStateMarkerOptions +import org.maplibre.android.testapp.utils.IconUtils /** * Test activity showcasing using an InfoWindowAdapter to provide a custom InfoWindow content. */ class InfoWindowAdapterActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_infowindow_adapter) mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap -> - mapboxMap = map + OnMapReadyCallback { map: MapLibreMap -> + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> addMarkers() addCustomInfoWindowAdapter() @@ -40,10 +40,10 @@ class InfoWindowAdapterActivity : AppCompatActivity() { } private fun addMarkers() { - mapboxMap.addMarker(generateCityStateMarker("Andorra", 42.505777, 1.52529, "#F44336")) - mapboxMap.addMarker(generateCityStateMarker("Luxembourg", 49.815273, 6.129583, "#3F51B5")) - mapboxMap.addMarker(generateCityStateMarker("Monaco", 43.738418, 7.424616, "#673AB7")) - mapboxMap.addMarker( + maplibreMap.addMarker(generateCityStateMarker("Andorra", 42.505777, 1.52529, "#F44336")) + maplibreMap.addMarker(generateCityStateMarker("Luxembourg", 49.815273, 6.129583, "#3F51B5")) + maplibreMap.addMarker(generateCityStateMarker("Monaco", 43.738418, 7.424616, "#673AB7")) + maplibreMap.addMarker( generateCityStateMarker( "Vatican City", 41.902916, @@ -51,7 +51,7 @@ class InfoWindowAdapterActivity : AppCompatActivity() { "#009688" ) ) - mapboxMap.addMarker( + maplibreMap.addMarker( generateCityStateMarker( "San Marino", 43.942360, @@ -59,7 +59,7 @@ class InfoWindowAdapterActivity : AppCompatActivity() { "#795548" ) ) - mapboxMap.addMarker( + maplibreMap.addMarker( generateCityStateMarker( "Liechtenstein", 47.166000, @@ -86,7 +86,7 @@ class InfoWindowAdapterActivity : AppCompatActivity() { } private fun addCustomInfoWindowAdapter() { - mapboxMap.infoWindowAdapter = object : InfoWindowAdapter { + maplibreMap.infoWindowAdapter = object : InfoWindowAdapter { private val tenDp = resources.getDimension(R.dimen.attr_margin).toInt() override fun getInfoWindow(marker: Marker): View? { val textView = TextView(this@InfoWindowAdapterActivity) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/BasicLocationPulsingCircleActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt similarity index 85% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/BasicLocationPulsingCircleActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt index 7b1d9b365..1daec5b80 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/BasicLocationPulsingCircleActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/BasicLocationPulsingCircleActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.annotation.SuppressLint import android.location.Location @@ -7,18 +7,18 @@ import android.view.Menu import android.view.MenuItem import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.location.LocationComponent -import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions -import com.mapbox.mapboxsdk.location.LocationComponentOptions -import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest -import com.mapbox.mapboxsdk.location.modes.CameraMode -import com.mapbox.mapboxsdk.location.permissions.PermissionsListener -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.location.LocationComponent +import org.maplibre.android.location.LocationComponentActivationOptions +import org.maplibre.android.location.LocationComponentOptions +import org.maplibre.android.location.engine.LocationEngineRequest +import org.maplibre.android.location.modes.CameraMode +import org.maplibre.android.location.permissions.PermissionsListener +import org.maplibre.android.location.permissions.PermissionsManager +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R /** * This activity shows a basic usage of the LocationComponent's pulsing circle. There's no @@ -29,7 +29,7 @@ class BasicLocationPulsingCircleActivity : AppCompatActivity(), OnMapReadyCallba private lateinit var mapView: MapView private var permissionsManager: PermissionsManager? = null private var locationComponent: LocationComponent? = null - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_location_layer_basic_pulsing_circle) @@ -42,10 +42,10 @@ class BasicLocationPulsingCircleActivity : AppCompatActivity(), OnMapReadyCallba } @SuppressLint("MissingPermission") - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> - locationComponent = mapboxMap.locationComponent + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> + locationComponent = maplibreMap.locationComponent val locationComponentOptions = LocationComponentOptions.builder(this@BasicLocationPulsingCircleActivity) .pulseEnabled(true) @@ -119,7 +119,7 @@ class BasicLocationPulsingCircleActivity : AppCompatActivity(), OnMapReadyCallba } private fun loadNewStyle() { - mapboxMap.setStyle(Style.Builder().fromUri(Utils.nextStyle())) + maplibreMap.setStyle(Style.Builder().fromUri(Utils.nextStyle())) } private fun checkPermissions() { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/CustomizedLocationPulsingCircleActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/CustomizedLocationPulsingCircleActivity.kt similarity index 93% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/CustomizedLocationPulsingCircleActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/CustomizedLocationPulsingCircleActivity.kt index 28b53e1cf..d2758450c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/CustomizedLocationPulsingCircleActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/CustomizedLocationPulsingCircleActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.annotation.SuppressLint import android.graphics.Color @@ -15,18 +15,18 @@ import android.widget.Button import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.ListPopupWindow -import com.mapbox.mapboxsdk.location.LocationComponent -import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions -import com.mapbox.mapboxsdk.location.LocationComponentOptions -import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest -import com.mapbox.mapboxsdk.location.modes.CameraMode -import com.mapbox.mapboxsdk.location.permissions.PermissionsListener -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.location.LocationComponent +import org.maplibre.android.location.LocationComponentActivationOptions +import org.maplibre.android.location.LocationComponentOptions +import org.maplibre.android.location.engine.LocationEngineRequest +import org.maplibre.android.location.modes.CameraMode +import org.maplibre.android.location.permissions.PermissionsListener +import org.maplibre.android.location.permissions.PermissionsManager +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R /** * This activity shows how to customize the LocationComponent's pulsing circle. @@ -38,7 +38,7 @@ class CustomizedLocationPulsingCircleActivity : AppCompatActivity(), OnMapReadyC private lateinit var pulsingCircleColorButton: Button private var permissionsManager: PermissionsManager? = null private var locationComponent: LocationComponent? = null - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var currentPulseDuration = 0f //endregion @@ -85,10 +85,10 @@ class CustomizedLocationPulsingCircleActivity : AppCompatActivity(), OnMapReadyC } @SuppressLint("MissingPermission") - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> - locationComponent = mapboxMap.locationComponent + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> + locationComponent = maplibreMap.locationComponent val locationComponentOptions = buildLocationComponentOptions( LOCATION_CIRCLE_PULSE_COLOR, LOCATION_CIRCLE_PULSE_DURATION @@ -124,7 +124,7 @@ class CustomizedLocationPulsingCircleActivity : AppCompatActivity(), OnMapReadyC newPulsingDuration: Float, newPulsingColor: Int ) { - mapboxMap.getStyle { style: Style? -> + maplibreMap.getStyle { style: Style? -> locationComponent!!.applyStyle( buildLocationComponentOptions( newPulsingColor, @@ -197,7 +197,7 @@ class CustomizedLocationPulsingCircleActivity : AppCompatActivity(), OnMapReadyC } private fun loadNewStyle() { - mapboxMap.setStyle(Style.Builder().fromUri(Utils.nextStyle())) + maplibreMap.setStyle(Style.Builder().fromUri(Utils.nextStyle())) } private fun checkPermissions() { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationComponentActivationActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationComponentActivationActivity.kt similarity index 80% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationComponentActivationActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationComponentActivationActivity.kt index 58a7881c5..ccf022518 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationComponentActivationActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationComponentActivationActivity.kt @@ -1,25 +1,25 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.annotation.SuppressLint import android.graphics.Color import android.os.Bundle import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions -import com.mapbox.mapboxsdk.location.LocationComponentOptions -import com.mapbox.mapboxsdk.location.modes.CameraMode -import com.mapbox.mapboxsdk.location.modes.RenderMode -import com.mapbox.mapboxsdk.location.permissions.PermissionsListener -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.location.LocationComponentActivationOptions +import org.maplibre.android.location.LocationComponentOptions +import org.maplibre.android.location.modes.CameraMode +import org.maplibre.android.location.modes.RenderMode +import org.maplibre.android.location.permissions.PermissionsListener +import org.maplibre.android.location.permissions.PermissionsManager +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R class LocationComponentActivationActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var permissionsManager: PermissionsManager? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -59,16 +59,16 @@ class LocationComponentActivationActivity : AppCompatActivity(), OnMapReadyCallb permissionsManager!!.onRequestPermissionsResult(requestCode, permissions, grantResults) } - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle( + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle( Style.getPredefinedStyle("Bright") ) { style: Style -> activateLocationComponent(style) } } @SuppressLint("MissingPermission") private fun activateLocationComponent(style: Style) { - val locationComponent = mapboxMap.locationComponent + val locationComponent = maplibreMap.locationComponent val locationComponentOptions = LocationComponentOptions.builder(this) .elevation(5f) .accuracyAlpha(.6f) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationFragmentActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationFragmentActivity.kt similarity index 85% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationFragmentActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationFragmentActivity.kt index c3e30a316..2fce5e8ce 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationFragmentActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationFragmentActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.annotation.SuppressLint import android.os.Bundle @@ -8,18 +8,18 @@ import android.view.ViewGroup import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions -import com.mapbox.mapboxsdk.location.engine.LocationEngineCallback -import com.mapbox.mapboxsdk.location.engine.LocationEngineResult -import com.mapbox.mapboxsdk.location.permissions.PermissionsListener -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityLocationLayerFragmentBinding +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.location.LocationComponentActivationOptions +import org.maplibre.android.location.engine.LocationEngineCallback +import org.maplibre.android.location.engine.LocationEngineResult +import org.maplibre.android.location.permissions.PermissionsListener +import org.maplibre.android.location.permissions.PermissionsManager +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityLocationLayerFragmentBinding class LocationFragmentActivity : AppCompatActivity() { @@ -94,7 +94,7 @@ class LocationFragmentActivity : AppCompatActivity() { } private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { mapView = MapView(inflater.context) @@ -106,9 +106,9 @@ class LocationFragmentActivity : AppCompatActivity() { super.onViewCreated(view, savedInstanceState) mapView.onCreate(savedInstanceState) mapView.getMapAsync { - mapboxMap = it + maplibreMap = it it.setStyle(Style.getPredefinedStyle("Streets")) { style -> - val component = mapboxMap.locationComponent + val component = maplibreMap.locationComponent component.activateLocationComponent( LocationComponentActivationOptions @@ -124,7 +124,7 @@ class LocationFragmentActivity : AppCompatActivity() { } override fun onSuccess(result: LocationEngineResult?) { - if (!mapView.isDestroyed) mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(result?.lastLocation!!), 12.0)) + if (!mapView.isDestroyed) maplibreMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(result?.lastLocation!!), 12.0)) } override fun onFailure(exception: Exception) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationMapChangeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationMapChangeActivity.kt similarity index 81% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationMapChangeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationMapChangeActivity.kt index f7dfbed78..1aca985dd 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationMapChangeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationMapChangeActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.annotation.SuppressLint import android.os.Bundle @@ -6,19 +6,19 @@ import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions -import com.mapbox.mapboxsdk.location.modes.RenderMode -import com.mapbox.mapboxsdk.location.permissions.PermissionsListener -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.location.LocationComponentActivationOptions +import org.maplibre.android.location.modes.RenderMode +import org.maplibre.android.location.permissions.PermissionsListener +import org.maplibre.android.location.permissions.PermissionsManager +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R class LocationMapChangeActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var permissionsManager: PermissionsManager? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -26,8 +26,8 @@ class LocationMapChangeActivity : AppCompatActivity(), OnMapReadyCallback { mapView = findViewById(R.id.mapView) val stylesFab = findViewById(R.id.fabStyles) stylesFab.setOnClickListener { v: View? -> - if (mapboxMap != null) { - mapboxMap.setStyle(Style.Builder().fromUri(Utils.nextStyle())) + if (maplibreMap != null) { + maplibreMap.setStyle(Style.Builder().fromUri(Utils.nextStyle())) } } mapView.onCreate(savedInstanceState) @@ -64,16 +64,16 @@ class LocationMapChangeActivity : AppCompatActivity(), OnMapReadyCallback { permissionsManager!!.onRequestPermissionsResult(requestCode, permissions, grantResults) } - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle( + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle( Style.Builder().fromUri(Utils.nextStyle()) ) { style: Style -> activateLocationComponent(style) } } @SuppressLint("MissingPermission") private fun activateLocationComponent(style: Style) { - val locationComponent = mapboxMap.locationComponent + val locationComponent = maplibreMap.locationComponent locationComponent.activateLocationComponent( LocationComponentActivationOptions .builder(this, style) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationModesActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationModesActivity.kt similarity index 91% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationModesActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationModesActivity.kt index 650008183..9505f3bcc 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/LocationModesActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/LocationModesActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.annotation.SuppressLint import android.content.res.Configuration @@ -14,23 +14,23 @@ import android.widget.Button import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.ListPopupWindow -import com.mapbox.mapboxsdk.location.LocationComponent -import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions -import com.mapbox.mapboxsdk.location.LocationComponentOptions -import com.mapbox.mapboxsdk.location.OnCameraTrackingChangedListener -import com.mapbox.mapboxsdk.location.OnLocationCameraTransitionListener -import com.mapbox.mapboxsdk.location.OnLocationClickListener -import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest -import com.mapbox.mapboxsdk.location.modes.CameraMode -import com.mapbox.mapboxsdk.location.modes.RenderMode -import com.mapbox.mapboxsdk.location.permissions.PermissionsListener -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.CancelableCallback -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.location.LocationComponent +import org.maplibre.android.location.LocationComponentActivationOptions +import org.maplibre.android.location.LocationComponentOptions +import org.maplibre.android.location.OnCameraTrackingChangedListener +import org.maplibre.android.location.OnLocationCameraTransitionListener +import org.maplibre.android.location.OnLocationClickListener +import org.maplibre.android.location.engine.LocationEngineRequest +import org.maplibre.android.location.modes.CameraMode +import org.maplibre.android.location.modes.RenderMode +import org.maplibre.android.location.permissions.PermissionsListener +import org.maplibre.android.location.permissions.PermissionsManager +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.CancelableCallback +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R class LocationModesActivity : AppCompatActivity(), @@ -43,7 +43,7 @@ class LocationModesActivity : private var protectedGestureArea: View? = null private var permissionsManager: PermissionsManager? = null private var locationComponent: LocationComponent? = null - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var defaultStyle = false @CameraMode.Mode @@ -115,10 +115,10 @@ class LocationModesActivity : } @SuppressLint("MissingPermission") - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> - locationComponent = mapboxMap.locationComponent + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> + locationComponent = maplibreMap.locationComponent locationComponent!!.activateLocationComponent( LocationComponentActivationOptions .builder(this, style!!) @@ -225,7 +225,7 @@ class LocationModesActivity : if (locationComponent == null) { return } - mapboxMap.getStyle { style: Style -> + maplibreMap.getStyle { style: Style -> val styleUrl = Style.getPredefinedStyle( if (Style.getPredefinedStyle("Bright") == style.uri) { @@ -235,7 +235,7 @@ class LocationModesActivity : } ) - mapboxMap.setStyle(Style.Builder().fromUri(styleUrl)) + maplibreMap.setStyle(Style.Builder().fromUri(styleUrl)) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/ManualLocationUpdatesActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/ManualLocationUpdatesActivity.kt similarity index 85% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/ManualLocationUpdatesActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/ManualLocationUpdatesActivity.kt index 439418a0c..363615cac 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/ManualLocationUpdatesActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/ManualLocationUpdatesActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.annotation.SuppressLint import android.os.Bundle @@ -6,20 +6,20 @@ import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.location.LocationComponent -import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions -import com.mapbox.mapboxsdk.location.engine.LocationEngine -import com.mapbox.mapboxsdk.location.engine.LocationEngineDefault -import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest -import com.mapbox.mapboxsdk.location.modes.RenderMode -import com.mapbox.mapboxsdk.location.permissions.PermissionsListener -import com.mapbox.mapboxsdk.location.permissions.PermissionsManager -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.location.LocationComponent +import org.maplibre.android.location.LocationComponentActivationOptions +import org.maplibre.android.location.engine.LocationEngine +import org.maplibre.android.location.engine.LocationEngineDefault +import org.maplibre.android.location.engine.LocationEngineRequest +import org.maplibre.android.location.modes.RenderMode +import org.maplibre.android.location.permissions.PermissionsListener +import org.maplibre.android.location.permissions.PermissionsManager +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R class ManualLocationUpdatesActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView @@ -101,11 +101,11 @@ class ManualLocationUpdatesActivity : AppCompatActivity(), OnMapReadyCallback { } @SuppressLint("MissingPermission") - override fun onMapReady(mapboxMap: MapboxMap) { - mapboxMap.setStyle( + override fun onMapReady(maplibreMap: MapLibreMap) { + maplibreMap.setStyle( Style.Builder().fromUri(Style.getPredefinedStyle("Streets")) ) { style: Style? -> - locationComponent = mapboxMap.locationComponent + locationComponent = maplibreMap.locationComponent locationComponent!!.activateLocationComponent( LocationComponentActivationOptions .builder(this, style!!) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/Utils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/Utils.kt similarity index 91% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/Utils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/Utils.kt index 609a16568..e0638f85b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/location/Utils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/location/Utils.kt @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.testapp.activity.location +package org.maplibre.android.testapp.activity.location import android.location.Location -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.Style +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.Style import timber.log.Timber import java.util.* diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/BottomSheetActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/BottomSheetActivity.kt similarity index 89% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/BottomSheetActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/BottomSheetActivity.kt index b5ed8071a..a9c0a7c4b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/BottomSheetActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/BottomSheetActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.content.Context import android.os.Bundle @@ -7,13 +7,11 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import com.google.android.material.bottomsheet.BottomSheetBehavior -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.activity.maplayout.BottomSheetActivity.BottomSheetFragment -import com.mapbox.mapboxsdk.testapp.activity.maplayout.BottomSheetActivity.MainMapFragment -import com.mapbox.mapboxsdk.utils.MapFragmentUtils +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.MapFragmentUtils /** * Test activity showcasing using a bottomView with a MapView and stacking map fragments below. @@ -115,14 +113,14 @@ class BottomSheetActivity : AppCompatActivity() { map!!.getMapAsync(this) } - override fun onMapReady(mapboxMap: MapboxMap) { - mapboxMap.moveCamera( + override fun onMapReady(maplibreMap: MapLibreMap) { + maplibreMap.moveCamera( CameraUpdateFactory.newLatLngZoom( LatLng(37.760545, -122.436055), 15.0 ) ) - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder().fromUri( STYLES[ Math.min( @@ -184,8 +182,8 @@ class BottomSheetActivity : AppCompatActivity() { val bundle = Bundle() bundle.putInt("mapcounter", mapCounter) mapFragment.arguments = bundle - val mapboxMapOptions = MapboxMapOptions.createFromAttributes(context!!) - mapFragment.arguments = MapFragmentUtils.createFragmentArgs(mapboxMapOptions) + val maplibreMapOptions = MapLibreMapOptions.createFromAttributes(context!!) + mapFragment.arguments = MapFragmentUtils.createFragmentArgs(maplibreMapOptions) return mapFragment } } @@ -211,14 +209,14 @@ class BottomSheetActivity : AppCompatActivity() { map!!.getMapAsync(this) } - override fun onMapReady(mapboxMap: MapboxMap) { - mapboxMap.moveCamera( + override fun onMapReady(maplibreMap: MapLibreMap) { + maplibreMap.moveCamera( CameraUpdateFactory.newLatLngZoom( LatLng(37.760545, -122.436055), 15.0 ) ) - mapboxMap.setStyle(Style.getPredefinedStyle("Bright")) + maplibreMap.setStyle(Style.getPredefinedStyle("Bright")) } override fun onStart() { @@ -259,9 +257,9 @@ class BottomSheetActivity : AppCompatActivity() { companion object { fun newInstance(context: Context?): BottomSheetFragment { val mapFragment = BottomSheetFragment() - val mapboxMapOptions = MapboxMapOptions.createFromAttributes(context!!) - mapboxMapOptions.renderSurfaceOnTop(true) - mapFragment.arguments = MapFragmentUtils.createFragmentArgs(mapboxMapOptions) + val maplibreMapOptions = MapLibreMapOptions.createFromAttributes(context!!) + maplibreMapOptions.renderSurfaceOnTop(true) + mapFragment.arguments = MapFragmentUtils.createFragmentArgs(maplibreMapOptions) return mapFragment } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/DebugModeActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/DebugModeActivity.kt index 1222b3742..ee8b0e1d8 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/DebugModeActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.content.Context import android.os.Bundle @@ -8,13 +8,13 @@ import androidx.appcompat.app.ActionBarDrawerToggle import androidx.appcompat.app.AppCompatActivity import androidx.drawerlayout.widget.DrawerLayout import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.maps.MapboxMap.OnCameraMoveListener -import com.mapbox.mapboxsdk.maps.MapboxMap.OnFpsChangedListener -import com.mapbox.mapboxsdk.style.layers.Layer -import com.mapbox.mapboxsdk.style.layers.Property -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.* +import org.maplibre.android.maps.MapLibreMap.OnCameraMoveListener +import org.maplibre.android.maps.MapLibreMap.OnFpsChangedListener +import org.maplibre.android.style.layers.Layer +import org.maplibre.android.style.layers.Property +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.testapp.R import timber.log.Timber import java.util.* @@ -23,7 +23,7 @@ import java.util.* */ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsChangedListener { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var cameraMoveListener: OnCameraMoveListener? = null private var actionBarDrawerToggle: ActionBarDrawerToggle? = null private var currentStyleIndex = 0 @@ -60,8 +60,8 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha mapView = MapView(this, mapboxMapOptions) (findViewById(R.id.coordinator_layout) as ViewGroup).addView(mapView, 0) mapView.addOnDidFinishLoadingStyleListener { - if (mapboxMap != null) { - setupNavigationView(mapboxMap.style!!.layers) + if (maplibreMap != null) { + setupNavigationView(maplibreMap.style!!.layers) } } mapView.tag = true @@ -70,13 +70,13 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha mapView.addOnDidFinishLoadingStyleListener { Timber.d("Style loaded") } } - protected open fun setupMapboxMapOptions(): MapboxMapOptions { - return MapboxMapOptions.createFromAttributes(this, null) + protected open fun setupMapboxMapOptions(): MapLibreMapOptions { + return MapLibreMapOptions.createFromAttributes(this, null) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle( + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle( Style.Builder().fromUri(STYLES[currentStyleIndex]) ) { style: Style -> setupNavigationView(style.layers) } setupZoomView() @@ -85,7 +85,7 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha private fun setFpsView() { fpsView = findViewById(R.id.fpsView) - mapboxMap.setOnFpsChangedListener(this) + maplibreMap.setOnFpsChangedListener(this) } override fun onFpsChanged(fps: Double) { @@ -93,7 +93,7 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha } private fun setupNavigationView(layerList: List) { - Timber.v("New style loaded with JSON: %s", mapboxMap.style!!.json) + Timber.v("New style loaded with JSON: %s", maplibreMap.style!!.json) val adapter = LayerListAdapter(this, layerList) val listView = findViewById(R.id.listView) listView.adapter = adapter @@ -121,13 +121,13 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha private fun setupZoomView() { val textView = findViewById(R.id.textZoom) - mapboxMap.addOnCameraMoveListener( + maplibreMap.addOnCameraMoveListener( OnCameraMoveListener { textView.text = String.format( this@DebugModeActivity.getString( R.string.debug_zoom ), - mapboxMap.cameraPosition.zoom + maplibreMap.cameraPosition.zoom ) }.also { cameraMoveListener = it } ) @@ -136,9 +136,9 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha private fun setupDebugChangeView() { val fabDebug = findViewById(R.id.fabDebug) fabDebug.setOnClickListener { view: View? -> - if (mapboxMap != null) { - mapboxMap.isDebugActive = !mapboxMap.isDebugActive - Timber.d("Debug FAB: isDebug Active? %s", mapboxMap.isDebugActive) + if (maplibreMap != null) { + maplibreMap.isDebugActive = !maplibreMap.isDebugActive + Timber.d("Debug FAB: isDebug Active? %s", maplibreMap.isDebugActive) } } } @@ -146,12 +146,12 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha private fun setupStyleChangeView() { val fabStyles = findViewById(R.id.fabStyles) fabStyles.setOnClickListener { view: View? -> - if (mapboxMap != null) { + if (maplibreMap != null) { currentStyleIndex++ if (currentStyleIndex == STYLES.size) { currentStyleIndex = 0 } - mapboxMap.setStyle(Style.Builder().fromUri(STYLES[currentStyleIndex])) + maplibreMap.setStyle(Style.Builder().fromUri(STYLES[currentStyleIndex])) } } } @@ -161,7 +161,7 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha if (itemId == R.id.menu_action_toggle_report_fps) { isReportFps = !isReportFps fpsView!!.visibility = if (isReportFps) View.VISIBLE else View.GONE - mapboxMap.setOnFpsChangedListener(if (isReportFps) this else null) + maplibreMap.setOnFpsChangedListener(if (isReportFps) this else null) } else if (itemId == R.id.menu_action_limit_to_30_fps) { mapView.setMaximumFps(30) } else if (itemId == R.id.menu_action_limit_to_60_fps) { @@ -204,8 +204,8 @@ open class DebugModeActivity : AppCompatActivity(), OnMapReadyCallback, OnFpsCha override fun onDestroy() { super.onDestroy() - if (mapboxMap != null) { - mapboxMap.removeOnCameraMoveListener(cameraMoveListener!!) + if (maplibreMap != null) { + maplibreMap.removeOnCameraMoveListener(cameraMoveListener!!) } mapView.onDestroy() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/DoubleMapActivity.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/DoubleMapActivity.kt index 7629832d8..d97cf0dcf 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DoubleMapActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/DoubleMapActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.content.Intent import android.os.Bundle @@ -8,13 +8,12 @@ import android.view.ViewGroup import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.activity.maplayout.DoubleMapActivity.DoubleMapFragment -import com.mapbox.mapboxsdk.utils.MapFragmentUtils +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.MapFragmentUtils /** * Test activity showcasing having 2 maps on top of each other. @@ -28,7 +27,7 @@ class DoubleMapActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_map_fragment) if (savedInstanceState == null) { - val options = MapboxMapOptions.createFromAttributes(this, null) + val options = MapLibreMapOptions.createFromAttributes(this, null) options.camera( CameraPosition.Builder() .target(MACHU_PICCHU) @@ -63,8 +62,8 @@ class DoubleMapActivity : AppCompatActivity() { // MapView large mapView = MapView(view.context, MapFragmentUtils.resolveArgs(view.context, arguments)) mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - mapboxMap.setStyle( + mapView.getMapAsync { maplibreMap: MapLibreMap -> + maplibreMap.setStyle( Style.getPredefinedStyle( "Streets" ) @@ -76,21 +75,21 @@ class DoubleMapActivity : AppCompatActivity() { mapViewMini = view.findViewById(R.id.mini_map) mapViewMini.onCreate(savedInstanceState) mapViewMini.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - mapboxMap.moveCamera( + OnMapReadyCallback { maplibreMap: MapLibreMap -> + maplibreMap.moveCamera( CameraUpdateFactory.newCameraPosition( CameraPosition.Builder().target(MACHU_PICCHU) .zoom(ZOOM_OUT) .build() ) ) - mapboxMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Bright"))) - val uiSettings = mapboxMap.uiSettings + maplibreMap.setStyle(Style.Builder().fromUri(Style.getPredefinedStyle("Bright"))) + val uiSettings = maplibreMap.uiSettings uiSettings.setAllGesturesEnabled(false) uiSettings.isCompassEnabled = false uiSettings.isAttributionEnabled = false uiSettings.isLogoEnabled = false - mapboxMap.addOnMapClickListener { point: LatLng? -> + maplibreMap.addOnMapClickListener { point: LatLng? -> // test if we can open 2 activities after each other Toast.makeText( mapViewMini.getContext(), diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/GLSurfaceRecyclerViewActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/GLSurfaceRecyclerViewActivity.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/GLSurfaceRecyclerViewActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/GLSurfaceRecyclerViewActivity.kt index 5610ccfbc..ebeb4050e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/GLSurfaceRecyclerViewActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/GLSurfaceRecyclerViewActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.annotation.SuppressLint import android.os.Bundle @@ -6,10 +6,10 @@ import android.view.LayoutInflater import android.view.ViewGroup import android.widget.TextView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityRecyclerviewBinding +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityRecyclerviewBinding /** * TestActivity showcasing how to integrate multiple GLSurfaceView MapViews in a RecyclerView. diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LatLngBoundsForCameraActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/LatLngBoundsForCameraActivity.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LatLngBoundsForCameraActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/LatLngBoundsForCameraActivity.kt index 1d4607dde..add49e5b3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LatLngBoundsForCameraActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/LatLngBoundsForCameraActivity.kt @@ -1,22 +1,22 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.graphics.Color import android.os.Bundle import android.view.* import android.widget.FrameLayout import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.annotations.PolygonOptions -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.annotations.PolygonOptions +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R /** * Test activity showcasing restricting user gestures to a bounds around Iceland, almost worldview and IDL. */ class LatLngBoundsForCameraActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_restricted_bounds) @@ -25,11 +25,11 @@ class LatLngBoundsForCameraActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) - mapboxMap.setMinZoomPreference(2.0) - mapboxMap.uiSettings.isFlingVelocityAnimationEnabled = false + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) + maplibreMap.setMinZoomPreference(2.0) + maplibreMap.uiSettings.isFlingVelocityAnimationEnabled = false showCrosshair() setupBounds(ICELAND_BOUNDS) } @@ -58,12 +58,12 @@ class LatLngBoundsForCameraActivity : AppCompatActivity(), OnMapReadyCallback { } private fun setupBounds(bounds: LatLngBounds?) { - mapboxMap.setLatLngBoundsForCameraTarget(bounds) + maplibreMap.setLatLngBoundsForCameraTarget(bounds) showBoundsArea(bounds) } private fun showBoundsArea(bounds: LatLngBounds?) { - mapboxMap.clear() + maplibreMap.clear() if (bounds != null) { val boundsArea = PolygonOptions() .add(bounds.northWest) @@ -72,7 +72,7 @@ class LatLngBoundsForCameraActivity : AppCompatActivity(), OnMapReadyCallback { .add(bounds.southWest) boundsArea.alpha(0.25f) boundsArea.fillColor(Color.RED) - mapboxMap.addPolygon(boundsArea) + maplibreMap.addPolygon(boundsArea) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/LocalGlyphActivity.kt similarity index 79% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/LocalGlyphActivity.kt index e2ef8d5cb..7555af37b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/LocalGlyphActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/LocalGlyphActivity.kt @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R /** * Test activity that displays the city of Suzhou with a mixture of server-generated @@ -20,10 +20,10 @@ class LocalGlyphActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + OnMapReadyCallback { maplibreMap: MapLibreMap -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) // Set initial position to Suzhou - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.newCameraPosition( CameraPosition.Builder() .target(LatLng(31.3003, 120.7457)) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapChangeActivity.kt similarity index 76% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapChangeActivity.kt index 9fb5e117e..5f40e1bf8 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapChangeActivity.kt @@ -1,24 +1,24 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.maps.MapView.OnCameraDidChangeListener -import com.mapbox.mapboxsdk.maps.MapView.OnCameraIsChangingListener -import com.mapbox.mapboxsdk.maps.MapView.OnCameraWillChangeListener -import com.mapbox.mapboxsdk.maps.MapView.OnDidBecomeIdleListener -import com.mapbox.mapboxsdk.maps.MapView.OnDidFailLoadingMapListener -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishLoadingMapListener -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishLoadingStyleListener -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishRenderingFrameListener -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishRenderingMapListener -import com.mapbox.mapboxsdk.maps.MapView.OnSourceChangedListener -import com.mapbox.mapboxsdk.maps.MapView.OnWillStartLoadingMapListener -import com.mapbox.mapboxsdk.maps.MapView.OnWillStartRenderingFrameListener -import com.mapbox.mapboxsdk.maps.MapView.OnWillStartRenderingMapListener -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.maps.MapView.OnCameraDidChangeListener +import org.maplibre.android.maps.MapView.OnCameraIsChangingListener +import org.maplibre.android.maps.MapView.OnCameraWillChangeListener +import org.maplibre.android.maps.MapView.OnDidBecomeIdleListener +import org.maplibre.android.maps.MapView.OnDidFailLoadingMapListener +import org.maplibre.android.maps.MapView.OnDidFinishLoadingMapListener +import org.maplibre.android.maps.MapView.OnDidFinishLoadingStyleListener +import org.maplibre.android.maps.MapView.OnDidFinishRenderingFrameListener +import org.maplibre.android.maps.MapView.OnDidFinishRenderingMapListener +import org.maplibre.android.maps.MapView.OnSourceChangedListener +import org.maplibre.android.maps.MapView.OnWillStartLoadingMapListener +import org.maplibre.android.maps.MapView.OnWillStartRenderingFrameListener +import org.maplibre.android.maps.MapView.OnWillStartRenderingMapListener +import org.maplibre.android.testapp.R import timber.log.Timber /** @@ -87,9 +87,9 @@ class MapChangeActivity : AppCompatActivity() { mapView.addOnWillStartRenderingMapListener(OnWillStartRenderingMapListener { Timber.v("OnWillStartRenderingMap") }) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) - mapboxMap.animateCamera( + OnMapReadyCallback { maplibreMap: MapLibreMap -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) + maplibreMap.animateCamera( CameraUpdateFactory.newLatLngZoom( LatLng(55.754020, 37.620948), 12.0 diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapInDialogActivity.kt similarity index 89% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapInDialogActivity.kt index b6d1c9a9f..4904f0f1f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapInDialogActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.os.Bundle import android.view.LayoutInflater @@ -7,9 +7,8 @@ import android.view.ViewGroup import android.widget.* import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.DialogFragment -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.activity.maplayout.MapInDialogActivity.MapDialogFragment +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R /** * Test activity showcasing showing a Map inside of a DialogFragment. @@ -41,8 +40,8 @@ class MapInDialogActivity : AppCompatActivity() { mapView = view.findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - mapboxMap.setStyle( + OnMapReadyCallback { maplibreMap: MapLibreMap -> + maplibreMap.setStyle( Style.getPredefinedStyle("Outdoor") ) } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapPaddingActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapPaddingActivity.kt similarity index 73% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapPaddingActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapPaddingActivity.kt index 01117c0db..77287932f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapPaddingActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/MapPaddingActivity.kt @@ -1,22 +1,22 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.os.Bundle import android.view.Menu import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.annotations.MarkerOptions -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.annotations.MarkerOptions +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R /** * Test activity showcasing using the map padding API. */ class MapPaddingActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_map_padding) @@ -24,15 +24,15 @@ class MapPaddingActivity : AppCompatActivity() { mapView.setTag(true) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - this@MapPaddingActivity.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + OnMapReadyCallback { maplibreMap: MapLibreMap -> + this@MapPaddingActivity.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) val paddingLeft = resources.getDimension(R.dimen.map_padding_left).toInt() val paddingBottom = resources.getDimension(R.dimen.map_padding_bottom).toInt() val paddingRight = resources.getDimension(R.dimen.map_padding_right).toInt() val paddingTop = resources.getDimension(R.dimen.map_padding_top).toInt() - mapboxMap.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom) - val settings = mapboxMap.uiSettings + maplibreMap.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom) + val settings = maplibreMap.uiSettings settings.setLogoMargins(paddingLeft, 0, 0, paddingBottom) settings.setCompassMargins(0, paddingTop, paddingRight, 0) settings.isAttributionEnabled = false @@ -89,14 +89,14 @@ class MapPaddingActivity : AppCompatActivity() { .bearing(40.0) .tilt(45.0) .build() - mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) - mapboxMap.addMarker(MarkerOptions().title("Center map").position(bangalore)) + maplibreMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) + maplibreMap.addMarker(MarkerOptions().title("Center map").position(bangalore)) } override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { R.id.action_bangalore -> { - if (mapboxMap != null) { + if (maplibreMap != null) { moveToBangalore() } true diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/OverlayMapActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/OverlayMapActivity.kt similarity index 94% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/OverlayMapActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/OverlayMapActivity.kt index eab2cf372..f3c506649 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/OverlayMapActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/OverlayMapActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.annotation.SuppressLint import android.content.Context @@ -7,8 +7,8 @@ import android.os.Bundle import android.os.PersistableBundle import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.databinding.ActivityOverlayBinding +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.databinding.ActivityOverlayBinding /** * Test overlaying a Map with a View that uses a radial gradient shader. diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/SimpleMapActivity.kt similarity index 86% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/SimpleMapActivity.kt index 819527ab3..55f4265c6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/SimpleMapActivity.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.os.Bundle import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.NavUtils +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.NavUtils /** * Test activity showcasing a simple MapView without any MapboxMap interaction. @@ -18,11 +18,11 @@ class SimpleMapActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> + OnMapReadyCallback { maplibreMap: MapLibreMap -> val styles = Style.getPredefinedStyles() if (styles != null && styles.size > 0) { val styleUrl = styles[0].url - mapboxMap.setStyle(Style.Builder().fromUri(styleUrl)) + maplibreMap.setStyle(Style.Builder().fromUri(styleUrl)) } } ) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/TextureRecyclerViewActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/TextureRecyclerViewActivity.kt similarity index 78% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/TextureRecyclerViewActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/TextureRecyclerViewActivity.kt index cf3c68f94..2db941fe1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/TextureRecyclerViewActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/TextureRecyclerViewActivity.kt @@ -1,7 +1,7 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.annotation.SuppressLint -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.testapp.R /** * TestActivity showcasing how to integrate multiple TexureView MapViews in a RecyclerView. diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/VisibilityChangeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/VisibilityChangeActivity.kt similarity index 85% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/VisibilityChangeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/VisibilityChangeActivity.kt index eb00d6f7f..da56fd56e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/VisibilityChangeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/maplayout/VisibilityChangeActivity.kt @@ -1,21 +1,20 @@ -package com.mapbox.mapboxsdk.testapp.activity.maplayout +package org.maplibre.android.testapp.activity.maplayout import android.os.Bundle import android.os.Handler import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.activity.maplayout.VisibilityChangeActivity.VisibilityRunner +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R /** * Test activity showcasing visibility changes to the mapview. */ class VisibilityChangeActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private val handler = Handler() private var runnable: Runnable? = null override fun onCreate(savedInstanceState: Bundle?) { @@ -24,12 +23,12 @@ class VisibilityChangeActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) - mapboxMap.animateCamera( + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) + maplibreMap.animateCamera( CameraUpdateFactory.newLatLngZoom( LatLng(55.754020, 37.620948), 12.0 diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/ChangeResourcesCachePathActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/ChangeResourcesCachePathActivity.kt similarity index 93% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/ChangeResourcesCachePathActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/ChangeResourcesCachePathActivity.kt index a8762c81c..e1b63b9f3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/ChangeResourcesCachePathActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/ChangeResourcesCachePathActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.offline +package org.maplibre.android.testapp.activity.offline import android.content.Context import android.os.Bundle @@ -10,12 +10,12 @@ import android.widget.BaseAdapter import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.log.Logger -import com.mapbox.mapboxsdk.offline.OfflineManager -import com.mapbox.mapboxsdk.offline.OfflineRegion -import com.mapbox.mapboxsdk.storage.FileSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityChangeResourcesCachePathBinding +import org.maplibre.android.log.Logger +import org.maplibre.android.offline.OfflineManager +import org.maplibre.android.offline.OfflineRegion +import org.maplibre.android.storage.FileSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityChangeResourcesCachePathBinding import java.io.File class ChangeResourcesCachePathActivity : diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/DeleteRegionActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/DeleteRegionActivity.kt similarity index 91% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/DeleteRegionActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/DeleteRegionActivity.kt index fe529912c..84d3d4822 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/DeleteRegionActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/DeleteRegionActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.offline +package org.maplibre.android.testapp.activity.offline import android.content.Context import android.content.DialogInterface @@ -9,14 +9,14 @@ import android.view.ViewGroup import android.widget.* import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.offline.OfflineManager -import com.mapbox.mapboxsdk.offline.OfflineManager.ListOfflineRegionsCallback -import com.mapbox.mapboxsdk.offline.OfflineRegion -import com.mapbox.mapboxsdk.offline.OfflineRegion.OfflineRegionDeleteCallback -import com.mapbox.mapboxsdk.offline.OfflineRegion.OfflineRegionInvalidateCallback -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.activity.offline.DeleteRegionActivity.OfflineRegionAdapter -import com.mapbox.mapboxsdk.testapp.utils.OfflineUtils +import org.maplibre.android.offline.OfflineManager +import org.maplibre.android.offline.OfflineManager.ListOfflineRegionsCallback +import org.maplibre.android.offline.OfflineRegion +import org.maplibre.android.offline.OfflineRegion.OfflineRegionDeleteCallback +import org.maplibre.android.offline.OfflineRegion.OfflineRegionInvalidateCallback +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.activity.offline.DeleteRegionActivity.OfflineRegionAdapter +import org.maplibre.android.testapp.utils.OfflineUtils import java.util.* /** diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/DownloadRegionActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/DownloadRegionActivity.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/DownloadRegionActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/DownloadRegionActivity.kt index d33b0a3e3..094e29ee3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/DownloadRegionActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/DownloadRegionActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.offline +package org.maplibre.android.testapp.activity.offline import android.annotation.SuppressLint import android.os.Bundle @@ -9,13 +9,13 @@ import android.widget.SeekBar import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.constants.MapboxConstants -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.offline.* -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityRegionDownloadBinding +import org.maplibre.android.constants.MapLibreConstants +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.Style +import org.maplibre.android.offline.* +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityRegionDownloadBinding import timber.log.Timber import java.util.* import java.util.concurrent.TimeUnit @@ -243,7 +243,7 @@ class DownloadRegionActivity : AppCompatActivity(), OfflineRegion.OfflineRegionO } private fun initSeekbars() { - val maxZoom = MapboxConstants.MAXIMUM_ZOOM.toInt() + val maxZoom = MapLibreConstants.MAXIMUM_ZOOM.toInt() binding.seekbarMinZoom.max = maxZoom binding.seekbarMinZoom.progress = 1 binding.seekbarMaxZoom.max = maxZoom diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/MergeOfflineRegionsActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/MergeOfflineRegionsActivity.kt similarity index 89% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/MergeOfflineRegionsActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/MergeOfflineRegionsActivity.kt index 63d319e9a..60c660924 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/MergeOfflineRegionsActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/MergeOfflineRegionsActivity.kt @@ -1,16 +1,16 @@ -package com.mapbox.mapboxsdk.testapp.activity.offline +package org.maplibre.android.testapp.activity.offline import android.os.Bundle import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.log.Logger -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.offline.OfflineManager -import com.mapbox.mapboxsdk.offline.OfflineRegion -import com.mapbox.mapboxsdk.storage.FileSource -import com.mapbox.mapboxsdk.testapp.databinding.ActivityMergeOfflineRegionsBinding -import com.mapbox.mapboxsdk.testapp.utils.FileUtils +import org.maplibre.android.MapLibre +import org.maplibre.android.log.Logger +import org.maplibre.android.maps.Style +import org.maplibre.android.offline.OfflineManager +import org.maplibre.android.offline.OfflineRegion +import org.maplibre.android.storage.FileSource +import org.maplibre.android.testapp.databinding.ActivityMergeOfflineRegionsBinding +import org.maplibre.android.testapp.utils.FileUtils class MergeOfflineRegionsActivity : AppCompatActivity() { @@ -90,7 +90,7 @@ class MergeOfflineRegionsActivity : AppCompatActivity() { setContentView(binding.root) // forcing offline state - Mapbox.setConnected(false) + MapLibre.setConnected(false) binding.mapView.onCreate(savedInstanceState) binding.loadRegionBtn.setOnClickListener { @@ -145,7 +145,7 @@ class MergeOfflineRegionsActivity : AppCompatActivity() { binding.mapView.onDestroy() // restoring connectivity state - Mapbox.setConnected(null) + MapLibre.setConnected(null) } override fun onSaveInstanceState(outState: Bundle) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/OfflineActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/OfflineActivity.kt index 53b57cdd0..8b45dc9e0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/OfflineActivity.kt @@ -1,30 +1,30 @@ -package com.mapbox.mapboxsdk.testapp.activity.offline +package org.maplibre.android.testapp.activity.offline import android.os.Bundle import android.text.TextUtils import android.view.View import android.widget.* import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.offline.OfflineManager -import com.mapbox.mapboxsdk.offline.OfflineManager.CreateOfflineRegionCallback -import com.mapbox.mapboxsdk.offline.OfflineManager.ListOfflineRegionsCallback -import com.mapbox.mapboxsdk.offline.OfflineRegion -import com.mapbox.mapboxsdk.offline.OfflineRegion.OfflineRegionObserver -import com.mapbox.mapboxsdk.offline.OfflineRegionError -import com.mapbox.mapboxsdk.offline.OfflineRegionStatus -import com.mapbox.mapboxsdk.offline.OfflineTilePyramidRegionDefinition -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.model.other.OfflineDownloadRegionDialog -import com.mapbox.mapboxsdk.testapp.model.other.OfflineDownloadRegionDialog.DownloadRegionDialogListener -import com.mapbox.mapboxsdk.testapp.model.other.OfflineListRegionsDialog -import com.mapbox.mapboxsdk.testapp.utils.OfflineUtils +import org.maplibre.android.MapLibre +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.offline.OfflineManager +import org.maplibre.android.offline.OfflineManager.CreateOfflineRegionCallback +import org.maplibre.android.offline.OfflineManager.ListOfflineRegionsCallback +import org.maplibre.android.offline.OfflineRegion +import org.maplibre.android.offline.OfflineRegion.OfflineRegionObserver +import org.maplibre.android.offline.OfflineRegionError +import org.maplibre.android.offline.OfflineRegionStatus +import org.maplibre.android.offline.OfflineTilePyramidRegionDefinition +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.model.other.OfflineDownloadRegionDialog +import org.maplibre.android.testapp.model.other.OfflineDownloadRegionDialog.DownloadRegionDialogListener +import org.maplibre.android.testapp.model.other.OfflineListRegionsDialog +import org.maplibre.android.testapp.utils.OfflineUtils import timber.log.Timber import java.util.ArrayList @@ -40,7 +40,7 @@ class OfflineActivity : AppCompatActivity(), DownloadRegionDialogListener { * UI elements */ private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var progressBar: ProgressBar? = null private var downloadRegion: Button? = null private var listRegions: Button? = null @@ -55,21 +55,21 @@ class OfflineActivity : AppCompatActivity(), DownloadRegionDialogListener { super.onCreate(savedInstanceState) setContentView(R.layout.activity_offline) - // You can use Mapbox.setConnected(Boolean) to manually set the connectivity + // You can use MapLibre.setConnected(Boolean) to manually set the connectivity // state of your app. This will override any checks performed via the ConnectivityManager. - // Mapbox.getInstance().setConnected(false); - val connected = Mapbox.isConnected() - Timber.d("Mapbox is connected: %s", connected) + // MapLibre.getInstance().setConnected(false); + val connected = MapLibre.isConnected() + Timber.d("MapLibre is connected: %s", connected) // Set up map mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> + mapView.getMapAsync { maplibreMap: MapLibreMap -> Timber.d("Map is ready") - this@OfflineActivity.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.Builder().fromUri(STYLE_URL)) + this@OfflineActivity.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.Builder().fromUri(STYLE_URL)) // Set initial position to UNHQ in NYC - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.newCameraPosition( CameraPosition.Builder() .target(LatLng(40.749851, -73.967966)) @@ -193,9 +193,9 @@ class OfflineActivity : AppCompatActivity(), DownloadRegionDialogListener { startProgress() // Definition - val bounds = mapboxMap.projection.visibleRegion.latLngBounds - val minZoom = mapboxMap.cameraPosition.zoom - val maxZoom = mapboxMap.maxZoomLevel + val bounds = maplibreMap.projection.visibleRegion.latLngBounds + val minZoom = maplibreMap.cameraPosition.zoom + val maxZoom = maplibreMap.maxZoomLevel val pixelRatio = this.resources.displayMetrics.density val definition = OfflineTilePyramidRegionDefinition( STYLE_URL, @@ -261,7 +261,7 @@ class OfflineActivity : AppCompatActivity(), DownloadRegionDialogListener { } override fun mapboxTileCountLimitExceeded(limit: Long) { - Timber.e("Mapbox tile count limit exceeded: %s", limit) + Timber.e("MapLibre tile count limit exceeded: %s", limit) offlineRegion!!.setDownloadState(OfflineRegion.STATE_INACTIVE) } }) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/UpdateMetadataActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/UpdateMetadataActivity.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/UpdateMetadataActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/UpdateMetadataActivity.kt index daa4796be..71b4670e3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/UpdateMetadataActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/offline/UpdateMetadataActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.offline +package org.maplibre.android.testapp.activity.offline import android.content.Context import android.content.DialogInterface @@ -10,15 +10,14 @@ import android.view.ViewGroup import android.widget.* import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.offline.OfflineManager -import com.mapbox.mapboxsdk.offline.OfflineManager.ListOfflineRegionsCallback -import com.mapbox.mapboxsdk.offline.OfflineRegion -import com.mapbox.mapboxsdk.offline.OfflineRegion.OfflineRegionUpdateMetadataCallback -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.activity.offline.UpdateMetadataActivity.OfflineRegionMetadataAdapter -import com.mapbox.mapboxsdk.testapp.utils.OfflineUtils +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.offline.OfflineManager +import org.maplibre.android.offline.OfflineManager.ListOfflineRegionsCallback +import org.maplibre.android.offline.OfflineRegion +import org.maplibre.android.offline.OfflineRegion.OfflineRegionUpdateMetadataCallback +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.OfflineUtils import java.util.* /** @@ -76,7 +75,7 @@ class UpdateMetadataActivity : container.removeAllViews() container.addView(MapView(view.context).also { mapView = it }) mapView.onCreate(null) - mapView.getMapAsync { map: MapboxMap -> + mapView.getMapAsync { map: MapLibreMap -> map.setOfflineRegionDefinition( adapter!!.getItem(position).definition ) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestActivity.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestActivity.kt index 6e35a0d88..d34c23314 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.render +package org.maplibre.android.testapp.activity.render import android.content.res.AssetManager import android.graphics.Bitmap @@ -12,8 +12,8 @@ import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity import com.google.gson.Gson import com.google.gson.JsonObject -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter import okio.buffer import okio.source import timber.log.Timber diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestDefinition.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestDefinition.kt similarity index 93% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestDefinition.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestDefinition.kt index a98789912..a0eb96753 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestDefinition.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestDefinition.kt @@ -1,7 +1,7 @@ -package com.mapbox.mapboxsdk.testapp.activity.render +package org.maplibre.android.testapp.activity.render -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter +import org.maplibre.android.maps.Style +import org.maplibre.android.snapshotter.MapSnapshotter class RenderTestDefinition internal constructor( // eg. background-color val category: String?, // eg. colorSpace-hcl diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestSnapshotter.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestSnapshotter.kt similarity index 61% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestSnapshotter.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestSnapshotter.kt index b75f31c9f..04c67d477 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestSnapshotter.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestSnapshotter.kt @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.testapp.activity.render +package org.maplibre.android.testapp.activity.render import android.content.Context -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter class RenderTestSnapshotter internal constructor(context: Context, options: Options) : MapSnapshotter(context, options) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestStyleDefinition.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestStyleDefinition.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestStyleDefinition.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestStyleDefinition.kt index 89c235aa6..34a3de84d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/render/RenderTestStyleDefinition.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/render/RenderTestStyleDefinition.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.render +package org.maplibre.android.testapp.activity.render import java.util.HashMap diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterActivity.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterActivity.kt index 404e61083..3cfeefc93 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.snapshot +package org.maplibre.android.testapp.activity.snapshot import android.graphics.Color import android.os.Bundle @@ -12,23 +12,23 @@ import com.google.gson.JsonPrimitive import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.constants.MapboxConstants -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.Property -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.RasterLayer -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.style.sources.RasterSource -import com.mapbox.mapboxsdk.style.sources.Source -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.constants.MapLibreConstants +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.Style +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.Property +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.RasterLayer +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.style.sources.RasterSource +import org.maplibre.android.style.sources.Source +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.BitmapUtils import timber.log.Timber import java.util.Objects import java.util.Random @@ -83,7 +83,7 @@ class MapSnapshotterActivity : AppCompatActivity() { grid.measuredHeight / grid.rowCount ) // Optionally the pixel ratio .withPixelRatio(1f) - .withLocalIdeographFontFamily(MapboxConstants.DEFAULT_FONT) + .withLocalIdeographFontFamily(MapLibreConstants.DEFAULT_FONT) // Optionally the visible region if (row % 2 == 0) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterBitMapOverlayActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterBitMapOverlayActivity.kt similarity index 91% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterBitMapOverlayActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterBitMapOverlayActivity.kt index caee05380..fcdaa56fb 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterBitMapOverlayActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterBitMapOverlayActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.snapshot +package org.maplibre.android.testapp.activity.snapshot import android.annotation.SuppressLint import android.graphics.Bitmap @@ -12,12 +12,12 @@ import android.view.ViewTreeObserver.OnGlobalLayoutListener import android.widget.ImageView import androidx.annotation.VisibleForTesting import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.Style +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter +import org.maplibre.android.testapp.R import timber.log.Timber /** diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterHeatMapActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterHeatMapActivity.kt similarity index 91% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterHeatMapActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterHeatMapActivity.kt index 36e0c2c53..503139dd1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterHeatMapActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterHeatMapActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.snapshot +package org.maplibre.android.testapp.activity.snapshot import android.annotation.SuppressLint import android.os.Bundle @@ -6,17 +6,17 @@ import android.view.View import android.view.ViewTreeObserver.OnGlobalLayoutListener import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.HeatmapLayer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.style.sources.Source -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.Style +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.HeatmapLayer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.style.sources.Source +import org.maplibre.android.testapp.R import timber.log.Timber import java.net.URI import java.net.URISyntaxException diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterLocalStyleActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterLocalStyleActivity.kt similarity index 87% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterLocalStyleActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterLocalStyleActivity.kt index b54a20fd2..478743ac5 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterLocalStyleActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterLocalStyleActivity.kt @@ -1,17 +1,17 @@ -package com.mapbox.mapboxsdk.testapp.activity.snapshot +package org.maplibre.android.testapp.activity.snapshot import android.os.Bundle import android.view.View import android.view.ViewTreeObserver.OnGlobalLayoutListener import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.Style +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.ResourceUtils import timber.log.Timber import java.io.IOException import java.lang.RuntimeException diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterReuseActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterReuseActivity.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterReuseActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterReuseActivity.kt index cb471a20f..742271f50 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterReuseActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/snapshot/MapSnapshotterReuseActivity.kt @@ -1,16 +1,16 @@ -package com.mapbox.mapboxsdk.testapp.activity.snapshot +package org.maplibre.android.testapp.activity.snapshot import android.os.Bundle import android.view.View import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.Style +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter +import org.maplibre.android.testapp.R import java.util.* /** diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/storage/CacheManagementActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/storage/CacheManagementActivity.kt similarity index 94% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/storage/CacheManagementActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/storage/CacheManagementActivity.kt index cee98f649..9cb15a3ec 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/storage/CacheManagementActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/storage/CacheManagementActivity.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.testapp.activity.storage +package org.maplibre.android.testapp.activity.storage import android.os.Bundle import android.os.Looper import androidx.appcompat.app.AppCompatActivity import com.google.android.material.snackbar.Snackbar -import com.mapbox.mapboxsdk.offline.OfflineManager -import com.mapbox.mapboxsdk.testapp.databinding.ActivityCacheManagementBinding +import org.maplibre.android.offline.OfflineManager +import org.maplibre.android.testapp.databinding.ActivityCacheManagementBinding /** * Test activity showcasing the cache management APIs diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/storage/UrlTransformActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/storage/UrlTransformActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/storage/UrlTransformActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/storage/UrlTransformActivity.kt index 227f4e617..e4b50971e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/storage/UrlTransformActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/storage/UrlTransformActivity.kt @@ -1,15 +1,15 @@ -package com.mapbox.mapboxsdk.testapp.activity.storage +package org.maplibre.android.testapp.activity.storage import android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.storage.FileSource -import com.mapbox.mapboxsdk.storage.FileSource.ResourceTransformCallback -import com.mapbox.mapboxsdk.storage.Resource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.storage.FileSource +import org.maplibre.android.storage.FileSource.ResourceTransformCallback +import org.maplibre.android.storage.Resource +import org.maplibre.android.testapp.R import timber.log.Timber /** @@ -42,7 +42,7 @@ class UrlTransformActivity : AppCompatActivity() { // Get a handle to the file source and set the resource transform FileSource.getInstance(this@UrlTransformActivity).setResourceTransform(Transform()) - mapView.getMapAsync { map: MapboxMap -> + mapView.getMapAsync { map: MapLibreMap -> Timber.i("Map loaded") map.setStyle(Style.getPredefinedStyle("Streets")) } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/AnimatedImageSourceActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/AnimatedImageSourceActivity.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/AnimatedImageSourceActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/AnimatedImageSourceActivity.kt index eb09d1b18..1053c2d8b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/AnimatedImageSourceActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/AnimatedImageSourceActivity.kt @@ -1,22 +1,21 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Bitmap import android.graphics.drawable.BitmapDrawable import android.os.Bundle import android.os.Handler import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngQuad -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.RasterLayer -import com.mapbox.mapboxsdk.style.sources.ImageSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.activity.style.AnimatedImageSourceActivity.RefreshImageRunnable -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.MapLibre +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngQuad +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.RasterLayer +import org.maplibre.android.style.sources.ImageSource +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.BitmapUtils /** * Test activity showing how to use a series of images to create an animation @@ -38,7 +37,7 @@ class AnimatedImageSourceActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { + override fun onMapReady(map: MapLibreMap) { val quad = LatLngQuad( LatLng(46.437, -80.425), LatLng(46.437, -71.516), @@ -100,7 +99,7 @@ class AnimatedImageSourceActivity : AppCompatActivity(), OnMapReadyCallback { private val drawables: Array private var drawableIndex: Int fun getBitmap(resourceId: Int): Bitmap? { - val context = Mapbox.getApplicationContext() + val context = MapLibre.getApplicationContext() val drawable = BitmapUtils.getDrawableFromRes(context, resourceId) if (drawable is BitmapDrawable) { return drawable.bitmap diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/AnimatedSymbolLayerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/AnimatedSymbolLayerActivity.kt similarity index 95% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/AnimatedSymbolLayerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/AnimatedSymbolLayerActivity.kt index 0147bae5c..6d278d8b5 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/AnimatedSymbolLayerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/AnimatedSymbolLayerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.animation.Animator import android.animation.AnimatorListenerAdapter @@ -15,16 +15,16 @@ import com.google.gson.JsonObject import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import com.mapbox.turf.TurfMeasurement import java.util.* @@ -34,7 +34,7 @@ import java.util.* class AnimatedSymbolLayerActivity : AppCompatActivity() { private val random = Random() private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var style: Style? = null private val randomCars: MutableList = ArrayList() private var randomCarSource: GeoJsonSource? = null @@ -48,8 +48,8 @@ class AnimatedSymbolLayerActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap -> - mapboxMap = map + OnMapReadyCallback { map: MapLibreMap -> + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> this.style = style setupCars() @@ -293,7 +293,7 @@ class AnimatedSymbolLayerActivity : AppCompatActivity() { private val latLngInBounds: LatLng get() { - val bounds = mapboxMap.projection.visibleRegion.latLngBounds + val bounds = maplibreMap.projection.visibleRegion.latLngBounds val generator = Random() val randomLat = bounds.latitudeSouth + generator.nextDouble() * bounds.latitudeNorth - bounds.latitudeSouth val randomLon = bounds.longitudeWest + generator.nextDouble() * bounds.longitudeEast - bounds.longitudeWest diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/BuildingFillExtrusionActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/BuildingFillExtrusionActivity.kt similarity index 80% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/BuildingFillExtrusionActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/BuildingFillExtrusionActivity.kt index f2e1bbc08..06923fe87 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/BuildingFillExtrusionActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/BuildingFillExtrusionActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -6,25 +6,25 @@ import android.view.Menu import android.view.MenuItem import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.FillExtrusionLayer -import com.mapbox.mapboxsdk.style.layers.Property -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.light.Light -import com.mapbox.mapboxsdk.style.light.Position -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.utils.ColorUtils +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.FillExtrusionLayer +import org.maplibre.android.style.layers.Property +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.light.Light +import org.maplibre.android.style.light.Position +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.ColorUtils /** * Test activity showing 3D buildings with a FillExtrusion Layer */ class BuildingFillExtrusionActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var light: Light? = null private var isMapAnchorLight = false private var isLowIntensityLight = false @@ -36,11 +36,11 @@ class BuildingFillExtrusionActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> setupBuildings(style) setupLight() } @@ -68,7 +68,7 @@ class BuildingFillExtrusionActivity : AppCompatActivity() { } private fun setupLight() { - light = mapboxMap.style!!.light + light = maplibreMap.style!!.light findViewById(R.id.fabLightPosition).setOnClickListener { v: View? -> isInitPosition = !isInitPosition if (isInitPosition) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CircleLayerActivity.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CircleLayerActivity.kt index 8afaa8862..c03860e42 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CircleLayerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CircleLayerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -7,18 +7,18 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapView.OnDidFinishLoadingStyleListener -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.CircleLayer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapView.OnDidFinishLoadingStyleListener +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.CircleLayer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonOptions +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import timber.log.Timber import java.net.URI import java.net.URISyntaxException @@ -32,7 +32,7 @@ import java.net.URISyntaxException */ class CircleLayerActivity : AppCompatActivity(), View.OnClickListener { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var styleFab: FloatingActionButton private lateinit var routeFab: FloatingActionButton private var layer: CircleLayer? = null @@ -45,14 +45,14 @@ class CircleLayerActivity : AppCompatActivity(), View.OnClickListener { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } - mapboxMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) + maplibreMap.setStyle(Style.getPredefinedStyle("Satellite Hybrid")) mapView.addOnDidFinishLoadingStyleListener( OnDidFinishLoadingStyleListener { - val style = mapboxMap.style + val style = maplibreMap.style addBusStopSource(style) addBusStopCircleLayer(style) initFloatingActionButtons() @@ -107,13 +107,13 @@ class CircleLayerActivity : AppCompatActivity(), View.OnClickListener { } private fun removeOldSource() { - mapboxMap.style!!.removeSource(SOURCE_ID) - mapboxMap.style!!.removeLayer(LAYER_ID) + maplibreMap.style!!.removeSource(SOURCE_ID) + maplibreMap.style!!.removeLayer(LAYER_ID) } private fun addClusteredSource() { try { - mapboxMap.style!!.addSource( + maplibreMap.style!!.addSource( GeoJsonSource( SOURCE_ID_CLUSTER, URI(URL_BUS_ROUTES), @@ -151,7 +151,7 @@ class CircleLayerActivity : AppCompatActivity(), View.OnClickListener { unclustered.setProperties( PropertyFactory.iconImage("bus-15") ) - mapboxMap.style!!.addLayer(unclustered) + maplibreMap.style!!.addLayer(unclustered) for (i in layers.indices) { // Add some nice circles val circles = CircleLayer("cluster-$i", SOURCE_ID_CLUSTER) @@ -190,7 +190,7 @@ class CircleLayerActivity : AppCompatActivity(), View.OnClickListener { ) } ) - mapboxMap.style!!.addLayer(circles) + maplibreMap.style!!.addLayer(circles) } // Add the count labels @@ -202,7 +202,7 @@ class CircleLayerActivity : AppCompatActivity(), View.OnClickListener { PropertyFactory.textIgnorePlacement(true), PropertyFactory.textAllowOverlap(true) ) - mapboxMap.style!!.addLayer(count) + maplibreMap.style!!.addLayer(count) } private fun removeFabs() { @@ -217,17 +217,17 @@ class CircleLayerActivity : AppCompatActivity(), View.OnClickListener { } private fun removeBusStop() { - mapboxMap.style!!.removeLayer(layer!!) - mapboxMap.style!!.removeSource(source!!) + maplibreMap.style!!.removeLayer(layer!!) + maplibreMap.style!!.removeSource(source!!) } private fun loadNewStyle() { - mapboxMap.setStyle(Style.Builder().fromUri(nextStyle)) + maplibreMap.setStyle(Style.Builder().fromUri(nextStyle)) } private fun addBusStop() { - mapboxMap.style!!.addLayer(layer!!) - mapboxMap.style!!.addSource(source!!) + maplibreMap.style!!.addLayer(layer!!) + maplibreMap.style!!.addSource(source!!) } private val nextStyle: String diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CollectionUpdateOnStyleChange.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CollectionUpdateOnStyleChange.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CollectionUpdateOnStyleChange.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CollectionUpdateOnStyleChange.kt index b815b084a..e7df00b3c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CollectionUpdateOnStyleChange.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CollectionUpdateOnStyleChange.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -9,16 +9,16 @@ import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.LineString import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.LineLayer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityCollectionUpdateOnStyleChangeBinding +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.LineLayer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityCollectionUpdateOnStyleChangeBinding import java.util.* /** @@ -27,7 +27,7 @@ import java.util.* class CollectionUpdateOnStyleChange : AppCompatActivity(), OnMapReadyCallback, Style.OnStyleLoaded { private lateinit var binding: ActivityCollectionUpdateOnStyleChangeBinding - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var currentStyleIndex: Int = 0 override fun onCreate(savedInstanceState: Bundle?) { @@ -45,9 +45,9 @@ class CollectionUpdateOnStyleChange : AppCompatActivity(), OnMapReadyCallback, S .show() } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.Builder().fromUri(STYLES[currentStyleIndex]), this) + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.Builder().fromUri(STYLES[currentStyleIndex]), this) } override fun onStyleLoaded(style: Style) { @@ -73,7 +73,7 @@ class CollectionUpdateOnStyleChange : AppCompatActivity(), OnMapReadyCallback, S if (currentStyleIndex == STYLES.size) { currentStyleIndex = 0 } - mapboxMap.setStyle(Style.Builder().fromUri(STYLES[currentStyleIndex]), this) + maplibreMap.setStyle(Style.Builder().fromUri(STYLES[currentStyleIndex]), this) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CustomSpriteActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CustomSpriteActivity.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CustomSpriteActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CustomSpriteActivity.kt index 1edeb6390..081a43cd9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/CustomSpriteActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/CustomSpriteActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.BitmapFactory import android.os.Bundle @@ -9,17 +9,17 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.Layer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.Layer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import timber.log.Timber /** @@ -27,7 +27,7 @@ import timber.log.Timber */ class CustomSpriteActivity : AppCompatActivity() { private var source: GeoJsonSource? = null - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView private lateinit var layer: Layer public override fun onCreate(savedInstanceState: Bundle?) { @@ -36,8 +36,8 @@ class CustomSpriteActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap -> - mapboxMap = map + OnMapReadyCallback { map: MapLibreMap -> + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> val fab = findViewById(R.id.fab) fab.setColorFilter( @@ -66,7 +66,7 @@ class CustomSpriteActivity : AppCompatActivity() { "point", FeatureCollection.fromFeatures(arrayOf(Feature.fromGeometry(point))) ) - mapboxMap.style!!.addSource(source!!) + maplibreMap.style!!.addSource(source!!) // Add a symbol layer that references that point source layer = SymbolLayer("layer", "point") @@ -77,7 +77,7 @@ class CustomSpriteActivity : AppCompatActivity() { ) // lets add a circle below labels! - mapboxMap.style!!.addLayerBelow(layer, "water_intermittent") + maplibreMap.style!!.addLayerBelow(layer, "water_intermittent") fab.setImageResource(R.drawable.ic_directions_car_black) } else { // Update point @@ -96,7 +96,7 @@ class CustomSpriteActivity : AppCompatActivity() { ) // Move the camera as well - mapboxMap.moveCamera( + maplibreMap.moveCamera( CameraUpdateFactory.newLatLng( LatLng( point.latitude(), diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DataDrivenStyleActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DataDrivenStyleActivity.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DataDrivenStyleActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DataDrivenStyleActivity.kt index ae66dfade..fdb080226 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DataDrivenStyleActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DataDrivenStyleActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -8,20 +8,20 @@ import android.view.View import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.FillLayer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.style.sources.Source -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.IdleZoomListener -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.FillLayer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.style.sources.Source +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.IdleZoomListener +import org.maplibre.android.testapp.utils.ResourceUtils import timber.log.Timber import java.io.IOException @@ -30,7 +30,7 @@ import java.io.IOException */ class DataDrivenStyleActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var idleListener: IdleZoomListener? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -40,12 +40,12 @@ class DataDrivenStyleActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> // Store for later if (map != null) { - mapboxMap = map + maplibreMap = map } - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> // Add a parks layer addParksLayer() @@ -54,7 +54,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { } // Center and Zoom (Amsterdam, zoomed to streets) - mapboxMap.animateCamera( + maplibreMap.animateCamera( CameraUpdateFactory.newLatLngZoom( LatLng(52.379189, 4.899431), 14.0 @@ -66,9 +66,9 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun setupDebugZoomView() { val textView = findViewById(R.id.textZoom) as TextView - mapboxMap.addOnCameraIdleListener( + maplibreMap.addOnCameraIdleListener( IdleZoomListener( - mapboxMap, + maplibreMap, textView ).also { idleListener = it } ) @@ -106,8 +106,8 @@ class DataDrivenStyleActivity : AppCompatActivity() { override fun onDestroy() { super.onDestroy() - if (mapboxMap != null && idleListener != null) { - mapboxMap.removeOnCameraIdleListener(idleListener!!) + if (maplibreMap != null && idleListener != null) { + maplibreMap.removeOnCameraIdleListener(idleListener!!) } mapView.onDestroy() } @@ -161,7 +161,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addExponentialZoomFunction() { Timber.i("Add exponential zoom function") - val layer = mapboxMap.style!!.getLayerAs("water")!! + val layer = maplibreMap.style!!.getLayerAs("water")!! layer.setProperties( PropertyFactory.fillColor( Expression.interpolate( @@ -178,7 +178,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addIntervalZoomFunction() { Timber.i("Add interval zoom function") - val layer = mapboxMap.style!!.getLayerAs("water")!! + val layer = maplibreMap.style!!.getLayerAs("water")!! layer.setProperties( PropertyFactory.fillColor( Expression.step( @@ -195,7 +195,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addExponentialSourceFunction() { Timber.i("Add exponential source function") - val layer = mapboxMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! + val layer = maplibreMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! layer.setProperties( PropertyFactory.fillColor( Expression.interpolate( @@ -212,7 +212,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addCategoricalSourceFunction() { Timber.i("Add categorical source function") - val layer = mapboxMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! + val layer = maplibreMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! layer.setProperties( PropertyFactory.fillColor( Expression.match( @@ -232,7 +232,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addIdentitySourceFunction() { Timber.i("Add identity source function") - val layer = mapboxMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! + val layer = maplibreMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! layer.setProperties( PropertyFactory.fillOpacity( Expression.get("fill-opacity") @@ -243,7 +243,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addIntervalSourceFunction() { Timber.i("Add interval source function") - val layer = mapboxMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! + val layer = maplibreMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! layer.setProperties( PropertyFactory.fillColor( Expression.step( @@ -260,7 +260,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addCompositeExponentialFunction() { Timber.i("Add composite exponential function") - val layer = mapboxMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! + val layer = maplibreMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! layer.setProperties( PropertyFactory.fillColor( Expression.interpolate( @@ -304,7 +304,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addCompositeIntervalFunction() { Timber.i("Add composite interval function") - val layer = mapboxMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! + val layer = maplibreMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! layer.setProperties( PropertyFactory.fillColor( Expression.interpolate( @@ -348,7 +348,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { private fun addCompositeCategoricalFunction() { Timber.i("Add composite categorical function") - val layer = mapboxMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! + val layer = maplibreMap.style!!.getLayerAs(AMSTERDAM_PARKS_LAYER)!! layer.setProperties( PropertyFactory.fillColor( Expression.step( @@ -518,7 +518,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { "amsterdam-parks-source", ResourceUtils.readRawResource(this, R.raw.amsterdam) ) - mapboxMap.style!!.addSource(source) + maplibreMap.style!!.addSource(source) } catch (ioException: IOException) { Toast.makeText( this@DataDrivenStyleActivity, @@ -529,7 +529,7 @@ class DataDrivenStyleActivity : AppCompatActivity() { } // Add a fill layer - mapboxMap.style!! + maplibreMap.style!! .addLayer( FillLayer(AMSTERDAM_PARKS_LAYER, source.id) .withProperties( diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DistanceExpressionActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DistanceExpressionActivity.kt similarity index 80% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DistanceExpressionActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DistanceExpressionActivity.kt index 3f6e1f8ae..c6196eeb9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DistanceExpressionActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DistanceExpressionActivity.kt @@ -1,22 +1,22 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle import android.os.PersistableBundle import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression.distance -import com.mapbox.mapboxsdk.style.expressions.Expression.lt -import com.mapbox.mapboxsdk.style.layers.FillLayer -import com.mapbox.mapboxsdk.style.layers.Property.NONE -import com.mapbox.mapboxsdk.style.layers.PropertyFactory.* -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.databinding.ActivityWithinExpressionBinding +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression.distance +import org.maplibre.android.style.expressions.Expression.lt +import org.maplibre.android.style.layers.FillLayer +import org.maplibre.android.style.layers.Property.NONE +import org.maplibre.android.style.layers.PropertyFactory.* +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.databinding.ActivityWithinExpressionBinding import com.mapbox.turf.TurfConstants import com.mapbox.turf.TurfTransformation @@ -26,7 +26,7 @@ import com.mapbox.turf.TurfTransformation class DistanceExpressionActivity : AppCompatActivity() { private lateinit var binding: ActivityWithinExpressionBinding - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private val lat = 37.78794572301525 private val lon = -122.40752220153807 @@ -38,10 +38,10 @@ class DistanceExpressionActivity : AppCompatActivity() { binding.mapView.onCreate(savedInstanceState) binding.mapView.getMapAsync { map -> - mapboxMap = map + maplibreMap = map // Setup camera position above Georgetown - mapboxMap.cameraPosition = CameraPosition.Builder() + maplibreMap.cameraPosition = CameraPosition.Builder() .target(LatLng(lat, lon)) .zoom(16.0) .build() @@ -54,7 +54,7 @@ class DistanceExpressionActivity : AppCompatActivity() { val circle = TurfTransformation.circle(center, 150.0, TurfConstants.UNIT_METRES) // Setup style with additional layers, // using Streets as a base style - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Streets")) .withSources( diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DraggableMarkerActivity.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DraggableMarkerActivity.kt index df7acea68..300877142 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/DraggableMarkerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/DraggableMarkerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.PointF import android.os.Bundle @@ -12,16 +12,16 @@ import com.mapbox.android.gestures.MoveGestureDetector import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.annotations.IconFactory -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.PropertyFactory.* -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.databinding.ActivityDraggableMarkerBinding +import org.maplibre.android.annotations.IconFactory +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.PropertyFactory.* +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.databinding.ActivityDraggableMarkerBinding /** * An Activity that showcases how to make symbols draggable. @@ -47,7 +47,7 @@ class DraggableMarkerActivity : AppCompatActivity() { private lateinit var binding: ActivityDraggableMarkerBinding private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private val featureCollection = FeatureCollection.fromFeatures(mutableListOf()) private val source = GeoJsonSource(sourceId, featureCollection) private val layer = SymbolLayer(layerId, sourceId) @@ -67,7 +67,7 @@ class DraggableMarkerActivity : AppCompatActivity() { mapView = binding.mapView mapView.onCreate(savedInstanceState) mapView.getMapAsync { mapboxMap -> - this.mapboxMap = mapboxMap + this.maplibreMap = mapboxMap mapboxMap.setStyle( Style.Builder() @@ -175,7 +175,7 @@ class DraggableMarkerActivity : AppCompatActivity() { * we still need to listen for move gesture events which map won't be able to provide anymore. * * @param mapView the mapView - * @param mapboxMap the mapboxMap + * @param maplibreMap the mapboxMap * @param symbolsCollection the collection that contains all the symbols that we want to be draggable * @param symbolsSource the source that contains the [symbolsCollection] * @param symbolsLayerId the ID of the layer that the symbols are displayed on @@ -188,7 +188,7 @@ class DraggableMarkerActivity : AppCompatActivity() { */ class DraggableSymbolsManager( mapView: MapView, - private val mapboxMap: MapboxMap, + private val maplibreMap: MapLibreMap, private val symbolsCollection: FeatureCollection, private val symbolsSource: GeoJsonSource, private val symbolsLayerId: String, @@ -203,11 +203,11 @@ class DraggableMarkerActivity : AppCompatActivity() { private val onSymbolDragListeners: MutableList = mutableListOf() init { - mapboxMap.addOnMapLongClickListener { + maplibreMap.addOnMapLongClickListener { // Starting the drag process on long click - draggedSymbolId = mapboxMap.queryRenderedSymbols(it, symbolsLayerId).firstOrNull()?.id()?.also { id -> - mapboxMap.uiSettings.setAllGesturesEnabled(false) - mapboxMap.gesturesManager.moveGestureDetector.interrupt() + draggedSymbolId = maplibreMap.queryRenderedSymbols(it, symbolsLayerId).firstOrNull()?.id()?.also { id -> + maplibreMap.uiSettings.setAllGesturesEnabled(false) + maplibreMap.gesturesManager.moveGestureDetector.interrupt() notifyOnSymbolDragListeners { onSymbolDragStarted(id) } @@ -239,7 +239,7 @@ class DraggableMarkerActivity : AppCompatActivity() { stopDragging() } - val latLng = mapboxMap.projection.fromScreenLocation(point) + val latLng = maplibreMap.projection.fromScreenLocation(point) symbolsCollection.features()?.indexOfFirst { it.id() == draggedSymbolId @@ -271,7 +271,7 @@ class DraggableMarkerActivity : AppCompatActivity() { } private fun stopDragging() { - mapboxMap.uiSettings.setAllGesturesEnabled(true) + maplibreMap.uiSettings.setAllGesturesEnabled(true) draggedSymbolId?.let { notifyOnSymbolDragListeners { onSymbolDragFinished(it) @@ -341,6 +341,6 @@ class DraggableMarkerActivity : AppCompatActivity() { } } -private fun MapboxMap.queryRenderedSymbols(latLng: LatLng, layerId: String): List { +private fun MapLibreMap.queryRenderedSymbols(latLng: LatLng, layerId: String): List { return this.queryRenderedFeatures(this.projection.toScreenLocation(latLng), layerId) } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/FillExtrusionActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/FillExtrusionActivity.kt similarity index 80% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/FillExtrusionActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/FillExtrusionActivity.kt index 566418d8f..195a726e6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/FillExtrusionActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/FillExtrusionActivity.kt @@ -1,20 +1,20 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.Point import com.mapbox.geojson.Polygon -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.* -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.* +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import java.util.* /** @@ -28,8 +28,8 @@ class FillExtrusionActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> + OnMapReadyCallback { maplibreMap: MapLibreMap -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> val lngLats = listOf( Arrays.asList( Point.fromLngLat(5.12112557888031, 52.09071040847704), @@ -50,7 +50,7 @@ class FillExtrusionActivity : AppCompatActivity() { PropertyFactory.fillExtrusionColor(Color.RED) ) ) - mapboxMap.animateCamera( + maplibreMap.animateCamera( CameraUpdateFactory.newCameraPosition( CameraPosition.Builder() .target(LatLng(52.09071040847704, 5.12112557888031)) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/FillExtrusionStyleTestActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/FillExtrusionStyleTestActivity.kt similarity index 79% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/FillExtrusionStyleTestActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/FillExtrusionStyleTestActivity.kt index 963f17b52..aab88ed77 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/FillExtrusionStyleTestActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/FillExtrusionStyleTestActivity.kt @@ -1,19 +1,19 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R /** * Test activity used for instrumentation tests of fill extrusion. */ class FillExtrusionStyleTestActivity : AppCompatActivity() { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap private set override fun onCreate(savedInstanceState: Bundle?) { @@ -23,10 +23,10 @@ class FillExtrusionStyleTestActivity : AppCompatActivity() { // Initialize map as normal mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - mapboxMap.setStyle( + mapView.getMapAsync { maplibreMap: MapLibreMap -> + maplibreMap.setStyle( Style.Builder().fromUri(Style.getPredefinedStyle("Streets")) - ) { style: Style? -> this@FillExtrusionStyleTestActivity.mapboxMap = mapboxMap } + ) { style: Style? -> this@FillExtrusionStyleTestActivity.maplibreMap = maplibreMap } } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GeoJsonClusteringActivity.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GeoJsonClusteringActivity.kt index 895d48609..89e72ce2e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GeoJsonClusteringActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GeoJsonClusteringActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.graphics.Point @@ -9,20 +9,20 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.content.res.ResourcesCompat import com.mapbox.geojson.Feature -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.CircleLayer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.CircleLayer +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonOptions +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.BitmapUtils import timber.log.Timber import java.net.URI import java.net.URISyntaxException @@ -33,7 +33,7 @@ import java.util.Objects */ class GeoJsonClusteringActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var clusterSource: GeoJsonSource? = null private var clickOptionCounter = 0 override fun onCreate(savedInstanceState: Bundle?) { @@ -45,11 +45,11 @@ class GeoJsonClusteringActivity : AppCompatActivity() { // noinspection ConstantConditions mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } - mapboxMap.animateCamera( + maplibreMap.animateCamera( CameraUpdateFactory.newLatLngZoom( LatLng(37.7749, 122.4194), 0.0 @@ -75,7 +75,7 @@ class GeoJsonClusteringActivity : AppCompatActivity() { ) ) try { - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Bright")) .withSource(createClusterSource().also { clusterSource = it }) @@ -95,10 +95,10 @@ class GeoJsonClusteringActivity : AppCompatActivity() { } catch (exception: URISyntaxException) { Timber.e(exception) } - mapboxMap.addOnMapClickListener { latLng: LatLng? -> - val point = mapboxMap.projection.toScreenLocation(latLng!!) + maplibreMap.addOnMapClickListener { latLng: LatLng? -> + val point = maplibreMap.projection.toScreenLocation(latLng!!) val features = - mapboxMap.queryRenderedFeatures(point, "cluster-0", "cluster-1", "cluster-2") + maplibreMap.queryRenderedFeatures(point, "cluster-0", "cluster-1", "cluster-2") if (!features.isEmpty()) { onClusterClick(features[0], Point(point.x.toInt(), point.y.toInt())) } @@ -115,8 +115,8 @@ class GeoJsonClusteringActivity : AppCompatActivity() { private fun onClusterClick(cluster: Feature, clickPoint: Point) { if (clickOptionCounter == 0) { val nextZoomLevel = clusterSource!!.getClusterExpansionZoom(cluster).toDouble() - val zoomDelta = nextZoomLevel - mapboxMap.cameraPosition.zoom - mapboxMap.animateCamera( + val zoomDelta = nextZoomLevel - maplibreMap.cameraPosition.zoom + maplibreMap.animateCamera( CameraUpdateFactory.zoomBy( zoomDelta + CAMERA_ZOOM_DELTA, clickPoint diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GradientLineActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GradientLineActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GradientLineActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GradientLineActivity.kt index 624b8a20f..4bae21dea 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GradientLineActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GradientLineActivity.kt @@ -1,18 +1,18 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.* -import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.* +import org.maplibre.android.style.sources.GeoJsonOptions +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.ResourceUtils import timber.log.Timber import java.io.IOException @@ -29,13 +29,13 @@ class GradientLineActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(mapboxMap: MapboxMap) { + override fun onMapReady(maplibreMap: MapLibreMap) { try { val geoJson = ResourceUtils.readRawResource( this@GradientLineActivity, R.raw.test_line_gradient_feature ) - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .withSource( GeoJsonSource( diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GridSourceActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GridSourceActivity.kt similarity index 89% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GridSourceActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GridSourceActivity.kt index e4a753cc5..2c1ab838f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/GridSourceActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/GridSourceActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -7,15 +7,15 @@ import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.MultiLineString import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.geometry.LatLngBounds -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.* -import com.mapbox.mapboxsdk.style.sources.CustomGeometrySource -import com.mapbox.mapboxsdk.style.sources.GeometryTileProvider -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.geometry.LatLngBounds +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.* +import org.maplibre.android.style.sources.CustomGeometrySource +import org.maplibre.android.style.sources.GeometryTileProvider +import org.maplibre.android.testapp.R import java.util.* /** @@ -92,7 +92,7 @@ class GridSourceActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { + override fun onMapReady(map: MapLibreMap) { source = CustomGeometrySource(ID_GRID_SOURCE, GridProvider()) layer = LineLayer(ID_GRID_LAYER, ID_GRID_SOURCE) layer!!.setProperties( diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/HeatmapLayerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/HeatmapLayerActivity.kt similarity index 92% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/HeatmapLayerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/HeatmapLayerActivity.kt index a6aee14b4..24e6a613b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/HeatmapLayerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/HeatmapLayerActivity.kt @@ -1,15 +1,15 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.* -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.* +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import timber.log.Timber import java.net.URI import java.net.URISyntaxException @@ -19,19 +19,19 @@ import java.net.URISyntaxException */ class HeatmapLayerActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_heatmaplayer) mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } try { - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Pastel")) .withSource(createEarthquakeSource()) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/HillshadeLayerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/HillshadeLayerActivity.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/HillshadeLayerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/HillshadeLayerActivity.kt index da81b1129..c32b32a95 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/HillshadeLayerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/HillshadeLayerActivity.kt @@ -1,31 +1,31 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.style.layers.HillshadeLayer -import com.mapbox.mapboxsdk.style.sources.RasterDemSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.* +import org.maplibre.android.style.layers.HillshadeLayer +import org.maplibre.android.style.sources.RasterDemSource +import org.maplibre.android.testapp.R /** * Test activity showcasing using HillshadeLayer. */ class HillshadeLayerActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_fill_extrusion_layer) mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } val rasterDemSource = RasterDemSource(SOURCE_ID, SOURCE_URL) val hillshadeLayer = HillshadeLayer(LAYER_ID, SOURCE_ID) - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Streets")) .withLayerBelow(hillshadeLayer, LAYER_BELOW_ID) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ImageInLabelActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/ImageInLabelActivity.kt similarity index 84% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ImageInLabelActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/ImageInLabelActivity.kt index 8236cc472..e1ab20d4e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ImageInLabelActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/ImageInLabelActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -6,17 +6,17 @@ import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.expressions.Expression.FormatOption -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.expressions.Expression.FormatOption +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.BitmapUtils /** * Test image in label. @@ -31,8 +31,8 @@ class ImageInLabelActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(mapboxMap: MapboxMap) { - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> + override fun onMapReady(maplibreMap: MapLibreMap) { + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> val us = BitmapUtils.getBitmapFromDrawable( resources.getDrawable(R.drawable.ic_us) ) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/NoStyleActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/NoStyleActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/NoStyleActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/NoStyleActivity.kt index e632fc7da..43e16d7ff 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/NoStyleActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/NoStyleActivity.kt @@ -1,18 +1,18 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.drawable.Drawable import android.os.Bundle import android.os.PersistableBundle import androidx.appcompat.app.AppCompatActivity import androidx.core.content.res.ResourcesCompat -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.layers.PropertyFactory.iconImage -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.databinding.ActivityMapSimpleBinding +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.Style +import org.maplibre.android.style.layers.PropertyFactory.iconImage +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.databinding.ActivityMapSimpleBinding import java.net.URI /** diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RealTimeGeoJsonActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RealTimeGeoJsonActivity.kt similarity index 80% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RealTimeGeoJsonActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RealTimeGeoJsonActivity.kt index 42eacb53e..e6ca25534 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RealTimeGeoJsonActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RealTimeGeoJsonActivity.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.os.Bundle import android.os.Handler import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.style.layers.* -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.* +import org.maplibre.android.style.layers.* +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import timber.log.Timber import java.net.URI import java.net.URISyntaxException @@ -21,7 +21,7 @@ import java.net.URISyntaxException */ class RealTimeGeoJsonActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var handler: Handler? = null private var runnable: Runnable? = null override fun onCreate(savedInstanceState: Bundle?) { @@ -32,9 +32,9 @@ class RealTimeGeoJsonActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style -> // add source + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style -> // add source try { style.addSource(GeoJsonSource(ID_GEOJSON_SOURCE, URI(URL_GEOJSON_SOURCE))) } catch (malformedUriException: URISyntaxException) { @@ -48,7 +48,7 @@ class RealTimeGeoJsonActivity : AppCompatActivity(), OnMapReadyCallback { // loop refresh geojson handler = Handler() - runnable = RefreshGeoJsonRunnable(mapboxMap!!, handler!!) + runnable = RefreshGeoJsonRunnable(maplibreMap!!, handler!!) runnable?.let { handler!!.postDelayed(it, 2000) } @@ -89,11 +89,11 @@ class RealTimeGeoJsonActivity : AppCompatActivity(), OnMapReadyCallback { } private class RefreshGeoJsonRunnable internal constructor( - private val mapboxMap: MapboxMap, + private val maplibreMap: MapLibreMap, private val handler: Handler ) : Runnable { override fun run() { - val geoJsonSource = mapboxMap.style!!.getSource(ID_GEOJSON_SOURCE) as GeoJsonSource + val geoJsonSource = maplibreMap.style!!.getSource(ID_GEOJSON_SOURCE) as GeoJsonSource geoJsonSource.url = URL_GEOJSON_SOURCE handler.postDelayed(this, 2000) } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RuntimeStyleActivity.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RuntimeStyleActivity.kt index 67a1067d6..9d2346e23 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RuntimeStyleActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -11,30 +11,30 @@ import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point import com.mapbox.geojson.Polygon -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.CancelableCallback -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.CircleLayer -import com.mapbox.mapboxsdk.style.layers.FillLayer -import com.mapbox.mapboxsdk.style.layers.Layer -import com.mapbox.mapboxsdk.style.layers.LineLayer -import com.mapbox.mapboxsdk.style.layers.Property -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.RasterLayer -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.layers.TransitionOptions -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.style.sources.RasterSource -import com.mapbox.mapboxsdk.style.sources.Source -import com.mapbox.mapboxsdk.style.sources.TileSet -import com.mapbox.mapboxsdk.style.sources.VectorSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.CancelableCallback +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.CircleLayer +import org.maplibre.android.style.layers.FillLayer +import org.maplibre.android.style.layers.Layer +import org.maplibre.android.style.layers.LineLayer +import org.maplibre.android.style.layers.Property +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.RasterLayer +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.layers.TransitionOptions +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.style.sources.RasterSource +import org.maplibre.android.style.sources.Source +import org.maplibre.android.style.sources.TileSet +import org.maplibre.android.style.sources.VectorSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.ResourceUtils import timber.log.Timber import java.io.IOException import java.util.Arrays @@ -45,7 +45,7 @@ import java.util.Collections */ class RuntimeStyleActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var styleLoaded = false var lngLats = listOf( Arrays.asList( @@ -80,20 +80,20 @@ class RuntimeStyleActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> // Store for later if (map != null) { - mapboxMap = map + maplibreMap = map } // Center and Zoom (Amsterdam, zoomed to streets) - mapboxMap.animateCamera( + maplibreMap.animateCamera( CameraUpdateFactory.newLatLngZoom( LatLng(52.379189, 4.899431), 1.0 ) ) - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Streets")) // set custom transition .withTransition(TransitionOptions(250, 50)) @@ -260,7 +260,7 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun listLayers() { - val layers = mapboxMap.style!! + val layers = maplibreMap.style!! .layers val builder = StringBuilder("Layers:") for (layer in layers) { @@ -271,7 +271,7 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun listSources() { - val sources = mapboxMap.style!! + val sources = maplibreMap.style!! .sources val builder = StringBuilder("Sources:") for (source in sources) { @@ -284,21 +284,21 @@ class RuntimeStyleActivity : AppCompatActivity() { private fun setLayerInvisible() { val roadLayers = arrayOf("water") for (roadLayer in roadLayers) { - val layer = mapboxMap.style!!.getLayer(roadLayer) + val layer = maplibreMap.style!!.getLayer(roadLayer) layer?.setProperties(PropertyFactory.visibility(Property.NONE)) } } private fun setRoadSymbolPlacement() { // Zoom so that the labels are visible first - mapboxMap.animateCamera( + maplibreMap.animateCamera( CameraUpdateFactory.zoomTo(14.0), object : DefaultCallback() { override fun onFinish() { val roadLayers = arrayOf("road-label-small", "road-label-medium", "road-label-large") for (roadLayer in roadLayers) { - val layer = mapboxMap.style!! + val layer = maplibreMap.style!! .getLayer(roadLayer) layer?.setProperties(PropertyFactory.symbolPlacement(Property.SYMBOL_PLACEMENT_POINT)) } @@ -308,12 +308,12 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun setBackgroundOpacity() { - val background = mapboxMap.style!!.getLayer("background") + val background = maplibreMap.style!!.getLayer("background") background?.setProperties(PropertyFactory.backgroundOpacity(0.2f)) } private fun setWaterColor() { - val water = mapboxMap.style!!.getLayerAs("water") + val water = maplibreMap.style!!.getLayerAs("water") if (water != null) { water.fillColorTransition = TransitionOptions(7500, 1000) water.setProperties( @@ -331,7 +331,7 @@ class RuntimeStyleActivity : AppCompatActivity() { private fun removeBuildings() { // Zoom to see buildings first - mapboxMap.style!!.removeLayer("building") + maplibreMap.style!!.removeLayer("building") } private fun addParksLayer() { @@ -347,7 +347,7 @@ class RuntimeStyleActivity : AppCompatActivity() { ).show() return } - mapboxMap.style!!.addSource(source) + maplibreMap.style!!.addSource(source) var layer: FillLayer? = FillLayer("parksLayer", "amsterdam-spots") layer!!.setProperties( PropertyFactory.fillColor(Color.RED), @@ -366,15 +366,15 @@ class RuntimeStyleActivity : AppCompatActivity() { ) ) ) - mapboxMap.style!!.addLayerBelow(layer, "building") + maplibreMap.style!!.addLayerBelow(layer, "building") // layer.setPaintProperty(fillColor(Color.RED)); // XXX But not after the object is attached // Or get the object later and set it. It's all good. - mapboxMap.style!!.getLayer("parksLayer")!! + maplibreMap.style!!.getLayer("parksLayer")!! .setProperties(PropertyFactory.fillColor(Color.RED)) // You can get a typed layer, if you're sure it's of that type. Use with care - layer = mapboxMap.style!!.getLayerAs("parksLayer") + layer = maplibreMap.style!!.getLayerAs("parksLayer") // And get some properties val fillAntialias = layer!!.fillAntialias Timber.d("Fill anti alias: %s", fillAntialias.getValue()) @@ -385,7 +385,7 @@ class RuntimeStyleActivity : AppCompatActivity() { Timber.d("Visibility: %s", visibility.getValue()) // Get a good look at it all - mapboxMap.animateCamera(CameraUpdateFactory.zoomTo(12.0)) + maplibreMap.animateCamera(CameraUpdateFactory.zoomTo(12.0)) } private fun addDynamicParksLayer() { @@ -404,7 +404,7 @@ class RuntimeStyleActivity : AppCompatActivity() { } // Add an empty source - mapboxMap.style!!.addSource(GeoJsonSource("dynamic-park-source")) + maplibreMap.style!!.addSource(GeoJsonSource("dynamic-park-source")) val layer = FillLayer("dynamic-parks-layer", "dynamic-park-source") layer.setProperties( PropertyFactory.fillColor(Color.GREEN), @@ -422,10 +422,10 @@ class RuntimeStyleActivity : AppCompatActivity() { ) ) ) - mapboxMap.style!!.addLayer(layer) + maplibreMap.style!!.addLayer(layer) // Get a good look at it all - mapboxMap.animateCamera(CameraUpdateFactory.zoomTo(12.0)) + maplibreMap.animateCamera(CameraUpdateFactory.zoomTo(12.0)) // Animate the parks source animateParksSource(parks, 0) @@ -435,13 +435,13 @@ class RuntimeStyleActivity : AppCompatActivity() { val handler = Handler(mainLooper) handler.postDelayed( { - if (mapboxMap == null) { + if (maplibreMap == null) { return@postDelayed } Timber.d("Updating parks source") // change the source val park = if (counter < parks.features()!!.size - 1) counter else 0 - val source = mapboxMap.style!!.getSourceAs("dynamic-park-source") + val source = maplibreMap.style!!.getSourceAs("dynamic-park-source") if (source == null) { Timber.e("Source not found") Toast.makeText(this@RuntimeStyleActivity, "Source not found", Toast.LENGTH_SHORT) @@ -462,7 +462,7 @@ class RuntimeStyleActivity : AppCompatActivity() { private fun addTerrainLayer() { // Add a source val source: Source = VectorSource("my-terrain-source", "maptiler://sources/hillshades") - mapboxMap.style!!.addSource(source) + maplibreMap.style!!.addSource(source) var layer: LineLayer? = LineLayer("terrainLayer", "my-terrain-source") layer!!.sourceLayer = "contour" layer.setProperties( @@ -473,7 +473,7 @@ class RuntimeStyleActivity : AppCompatActivity() { ) // adding layers below "road" layers - val layers = mapboxMap.style!! + val layers = maplibreMap.style!! .layers var latestLayer: Layer? = null Collections.reverse(layers) @@ -489,16 +489,16 @@ class RuntimeStyleActivity : AppCompatActivity() { } } if (latestLayer != null) { - mapboxMap.style!!.addLayerBelow(layer, latestLayer.id) + maplibreMap.style!!.addLayerBelow(layer, latestLayer.id) } // Need to get a fresh handle - layer = mapboxMap.style!!.getLayerAs("terrainLayer") + layer = maplibreMap.style!!.getLayerAs("terrainLayer") // Make sure it's also applied after the fact layer!!.minZoom = 10f layer.maxZoom = 15f - layer = mapboxMap.style!!.getLayer("terrainLayer") as LineLayer? + layer = maplibreMap.style!!.getLayer("terrainLayer") as LineLayer? Toast.makeText( this, String.format( @@ -513,14 +513,14 @@ class RuntimeStyleActivity : AppCompatActivity() { private fun addSatelliteLayer() { // Add a source val source: Source = RasterSource("my-raster-source", "maptiler://sources/satellite", 512) - mapboxMap.style!!.addSource(source) + maplibreMap.style!!.addSource(source) // Add a layer - mapboxMap.style!!.addLayer(RasterLayer("satellite-layer", "my-raster-source")) + maplibreMap.style!!.addLayer(RasterLayer("satellite-layer", "my-raster-source")) } private fun updateWaterColorOnZoom() { - val layer = mapboxMap.style!!.getLayerAs("water") ?: return + val layer = maplibreMap.style!!.getLayerAs("water") ?: return // Set a zoom function to update the color of the water layer.setProperties( @@ -537,7 +537,7 @@ class RuntimeStyleActivity : AppCompatActivity() { ) // do some animations to show it off properly - mapboxMap.animateCamera(CameraUpdateFactory.zoomTo(1.0), 1500) + maplibreMap.animateCamera(CameraUpdateFactory.zoomTo(1.0), 1500) } private fun addCustomTileSource() { @@ -547,7 +547,7 @@ class RuntimeStyleActivity : AppCompatActivity() { tileSet.minZoom = 0f tileSet.maxZoom = 14f val source: Source = VectorSource("custom-tile-source", tileSet) - mapboxMap.style!!.addSource(source) + maplibreMap.style!!.addSource(source) // Add a layer val lineLayer = LineLayer("custom-tile-layers", "custom-tile-source") @@ -559,12 +559,12 @@ class RuntimeStyleActivity : AppCompatActivity() { PropertyFactory.lineWidth(2.0f), PropertyFactory.lineColor(Color.GREEN) ) - mapboxMap.style!!.addLayer(lineLayer) + maplibreMap.style!!.addLayer(lineLayer) } private fun styleFillColorLayer() { - mapboxMap.setStyle(Style.Builder().fromUri("asset://fill_color_style.json")) - mapboxMap.moveCamera( + maplibreMap.setStyle(Style.Builder().fromUri("asset://fill_color_style.json")) + maplibreMap.moveCamera( CameraUpdateFactory.newLatLngZoom( LatLng(31.0, (-100).toDouble()), 3.0 @@ -573,8 +573,8 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun styleFillFilterLayer() { - mapboxMap.setStyle(Style.Builder().fromUri("asset://fill_filter_style.json")) - mapboxMap.moveCamera( + maplibreMap.setStyle(Style.Builder().fromUri("asset://fill_filter_style.json")) + maplibreMap.moveCamera( CameraUpdateFactory.newLatLngZoom( LatLng(31.0, (-100).toDouble()), 3.0 @@ -583,11 +583,11 @@ class RuntimeStyleActivity : AppCompatActivity() { val handler = Handler(mainLooper) handler.postDelayed( { - if (mapboxMap == null) { + if (maplibreMap == null) { return@postDelayed } Timber.d("Styling filtered fill layer") - val states = mapboxMap.style!!.getLayer("states") as FillLayer? + val states = maplibreMap.style!!.getLayer("states") as FillLayer? if (states != null) { states.setFilter(Expression.eq(Expression.get("name"), Expression.literal("Texas"))) states.fillOpacityTransition = TransitionOptions(2500, 0) @@ -609,8 +609,8 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun styleTextSizeFilterLayer() { - mapboxMap.setStyle(Style.Builder().fromUri("asset://fill_filter_style.json")) - mapboxMap.moveCamera( + maplibreMap.setStyle(Style.Builder().fromUri("asset://fill_filter_style.json")) + maplibreMap.moveCamera( CameraUpdateFactory.newLatLngZoom( LatLng(31.0, (-100).toDouble()), 3.0 @@ -619,11 +619,11 @@ class RuntimeStyleActivity : AppCompatActivity() { val handler = Handler(mainLooper) handler.postDelayed( { - if (mapboxMap == null) { + if (maplibreMap == null) { return@postDelayed } Timber.d("Styling text size fill layer") - val states = mapboxMap.style!!.getLayer("state-label-lg") as SymbolLayer? + val states = maplibreMap.style!!.getLayer("state-label-lg") as SymbolLayer? if (states != null) { states.setProperties( PropertyFactory.textSize( @@ -652,16 +652,16 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun styleLineFilterLayer() { - mapboxMap.setStyle(Style.Builder().fromUri("asset://line_filter_style.json")) - mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(40.0, (-97).toDouble()), 5.0)) + maplibreMap.setStyle(Style.Builder().fromUri("asset://line_filter_style.json")) + maplibreMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(40.0, (-97).toDouble()), 5.0)) val handler = Handler(mainLooper) handler.postDelayed( { - if (mapboxMap == null) { + if (maplibreMap == null) { return@postDelayed } Timber.d("Styling filtered line layer") - val counties = mapboxMap.style!!.getLayer("counties") as LineLayer? + val counties = maplibreMap.style!!.getLayer("counties") as LineLayer? if (counties != null) { counties.setFilter(Expression.eq(Expression.get("NAME10"), "Washington")) counties.setProperties( @@ -682,16 +682,16 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun styleNumericFillLayer() { - mapboxMap.setStyle(Style.Builder().fromUri("asset://numeric_filter_style.json")) - mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(40.0, (-97).toDouble()), 5.0)) + maplibreMap.setStyle(Style.Builder().fromUri("asset://numeric_filter_style.json")) + maplibreMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(40.0, (-97).toDouble()), 5.0)) val handler = Handler(mainLooper) handler.postDelayed( { - if (mapboxMap == null) { + if (maplibreMap == null) { return@postDelayed } Timber.d("Styling numeric fill layer") - val regions = mapboxMap.style!!.getLayer("regions") as FillLayer? + val regions = maplibreMap.style!!.getLayer("regions") as FillLayer? if (regions != null) { regions.setFilter( Expression.all( @@ -722,10 +722,10 @@ class RuntimeStyleActivity : AppCompatActivity() { } private fun bringWaterToFront() { - val water = mapboxMap.style!!.getLayer("water") + val water = maplibreMap.style!!.getLayer("water") if (water != null) { - mapboxMap.style!!.removeLayer(water) - mapboxMap.style!!.addLayerAt(water, mapboxMap.style!!.layers.size - 1) + maplibreMap.style!!.removeLayer(water) + maplibreMap.style!!.addLayerAt(water, maplibreMap.style!!.layers.size - 1) } else { Toast.makeText(this, "No water layer in this style", Toast.LENGTH_SHORT).show() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleTimingTestActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RuntimeStyleTimingTestActivity.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleTimingTestActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RuntimeStyleTimingTestActivity.kt index 8307b6371..d402bb836 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/RuntimeStyleTimingTestActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/RuntimeStyleTimingTestActivity.kt @@ -1,20 +1,20 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.style.layers.* -import com.mapbox.mapboxsdk.style.sources.VectorSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.* +import org.maplibre.android.style.layers.* +import org.maplibre.android.style.sources.VectorSource +import org.maplibre.android.testapp.R /** * Test activity for unit test execution */ class RuntimeStyleTimingTestActivity : AppCompatActivity() { lateinit var mapView: MapView - lateinit var mapboxMap: MapboxMap + lateinit var maplibreMap: MapLibreMap private set override fun onCreate(savedInstanceState: Bundle?) { @@ -24,8 +24,8 @@ class RuntimeStyleTimingTestActivity : AppCompatActivity() { // Initialize map as normal mapView = findViewById(R.id.mapView) as MapView mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> - this@RuntimeStyleTimingTestActivity.mapboxMap = mapboxMap + mapView.getMapAsync { maplibreMap: MapLibreMap -> + this@RuntimeStyleTimingTestActivity.maplibreMap = maplibreMap val parksLayer = CircleLayer("parks", "parks_source") parksLayer.sourceLayer = "parks" parksLayer.setProperties( @@ -37,7 +37,7 @@ class RuntimeStyleTimingTestActivity : AppCompatActivity() { "parks_source", "maptiler://sources/7ac429c7-c96e-46dd-8c3e-13d48988986a" ) - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Streets")) .withSource(parks) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StretchableImageActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/StretchableImageActivity.kt similarity index 89% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StretchableImageActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/StretchableImageActivity.kt index 9c432c137..710687c5b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StretchableImageActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/StretchableImageActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.os.AsyncTask import android.os.Bundle @@ -6,13 +6,13 @@ import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.* -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.GeoParseUtil -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.maps.* +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.* +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.GeoParseUtil +import org.maplibre.android.utils.BitmapUtils import timber.log.Timber import java.io.IOException import java.lang.ref.WeakReference @@ -22,7 +22,7 @@ import java.util.ArrayList * Test stretchable image as a background for text.. */ class StretchableImageActivity : AppCompatActivity(), OnMapReadyCallback { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -32,9 +32,9 @@ class StretchableImageActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> val popup = BitmapUtils.getBitmapFromDrawable( resources.getDrawable(R.drawable.popup) ) @@ -66,7 +66,7 @@ class StretchableImageActivity : AppCompatActivity(), OnMapReadyCallback { Timber.e("json is null.") return } - val style = mapboxMap.style + val style = maplibreMap.style if (style != null) { val featureCollection = FeatureCollection.fromJson(json) val stretchSource = GeoJsonSource(STRETCH_SOURCE, featureCollection) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StyleFileActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/StyleFileActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StyleFileActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/StyleFileActivity.kt index 59a9e4a16..e8468493d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/StyleFileActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/StyleFileActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.content.Context import android.os.AsyncTask @@ -8,12 +8,12 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.ResourceUtils import timber.log.Timber import java.io.BufferedWriter import java.io.File @@ -24,7 +24,7 @@ import java.lang.ref.WeakReference * Test activity showcasing how to use a file:// resource for the style.json and how to use MapboxMap#setStyleJson. */ class StyleFileActivity : AppCompatActivity() { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -32,17 +32,17 @@ class StyleFileActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap? -> + OnMapReadyCallback { map: MapLibreMap? -> if (map != null) { - mapboxMap = map + maplibreMap = map } - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) { style: Style? -> val fab = findViewById(R.id.fab_file) fab.setColorFilter(ContextCompat.getColor(this@StyleFileActivity, R.color.primary)) fab.setOnClickListener { view: View -> CreateStyleFileTask( view.context, - mapboxMap + maplibreMap ).execute() } val fabStyleJson = findViewById(R.id.fab_style_json) @@ -55,7 +55,7 @@ class StyleFileActivity : AppCompatActivity() { fabStyleJson.setOnClickListener { view: View -> LoadStyleFileTask( view.context, - mapboxMap + maplibreMap ).execute() } } @@ -66,10 +66,10 @@ class StyleFileActivity : AppCompatActivity() { /** * Task to read a style file from the raw folder */ - private class LoadStyleFileTask internal constructor(context: Context, mapboxMap: MapboxMap?) : + private class LoadStyleFileTask internal constructor(context: Context, maplibreMap: MapLibreMap?) : AsyncTask() { private val context: WeakReference - private val mapboxMap: WeakReference + private val maplibreMap: WeakReference protected override fun doInBackground(vararg p0: Void?): String? { var styleJson = "" try { @@ -83,13 +83,13 @@ class StyleFileActivity : AppCompatActivity() { override fun onPostExecute(json: String) { super.onPostExecute(json) Timber.d("Read json, %s", json) - val mapboxMap = mapboxMap.get() + val mapboxMap = maplibreMap.get() mapboxMap?.setStyle(Style.Builder().fromJson(json)) } init { this.context = WeakReference(context) - this.mapboxMap = WeakReference(mapboxMap) + this.maplibreMap = WeakReference(maplibreMap) } } @@ -98,11 +98,11 @@ class StyleFileActivity : AppCompatActivity() { */ private class CreateStyleFileTask internal constructor( context: Context, - mapboxMap: MapboxMap? + maplibreMap: MapLibreMap? ) : AsyncTask() { private lateinit var cacheStyleFile: File private val context: WeakReference - private val mapboxMap: WeakReference + private val maplibreMap: WeakReference protected override fun doInBackground(vararg p0: Void?): Long? { try { cacheStyleFile = File.createTempFile("my-", ".style.json") @@ -127,7 +127,7 @@ class StyleFileActivity : AppCompatActivity() { override fun onPostExecute(result: Long) { // Actual file:// usage - val mapboxMap = mapboxMap.get() + val mapboxMap = maplibreMap.get() mapboxMap?.setStyle( Style.Builder().fromUri("file://" + cacheStyleFile!!.absolutePath) ) @@ -145,7 +145,7 @@ class StyleFileActivity : AppCompatActivity() { init { this.context = WeakReference(context) - this.mapboxMap = WeakReference(mapboxMap) + this.maplibreMap = WeakReference(maplibreMap) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolGeneratorActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/SymbolGeneratorActivity.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolGeneratorActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/SymbolGeneratorActivity.kt index f989f338e..1e2057113 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolGeneratorActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/SymbolGeneratorActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.content.Context import android.graphics.Bitmap @@ -13,19 +13,19 @@ import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.FeatureCollection -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.Property -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.style.sources.Source -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils.readRawResource +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.Property +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.style.sources.Source +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.ResourceUtils.readRawResource import timber.log.Timber import java.lang.ref.WeakReference @@ -34,7 +34,7 @@ import java.lang.ref.WeakReference */ class SymbolGeneratorActivity : AppCompatActivity(), OnMapReadyCallback { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_symbol_generator) @@ -43,8 +43,8 @@ class SymbolGeneratorActivity : AppCompatActivity(), OnMapReadyCallback { mapView.getMapAsync(this) } - override fun onMapReady(map: MapboxMap) { - mapboxMap = map + override fun onMapReady(map: MapLibreMap) { + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Outdoor")) { style: Style? -> addSymbolClickListener() LoadDataTask(this@SymbolGeneratorActivity).execute() @@ -52,15 +52,15 @@ class SymbolGeneratorActivity : AppCompatActivity(), OnMapReadyCallback { } private fun addSymbolClickListener() { - mapboxMap.addOnMapClickListener { point: LatLng? -> - val screenPoint = mapboxMap.projection.toScreenLocation( + maplibreMap.addOnMapClickListener { point: LatLng? -> + val screenPoint = maplibreMap.projection.toScreenLocation( point!! ) - val features = mapboxMap.queryRenderedFeatures(screenPoint, LAYER_ID) + val features = maplibreMap.queryRenderedFeatures(screenPoint, LAYER_ID) if (!features.isEmpty()) { val feature = features[0] // validate symbol flicker regression for #13407 - val layer = mapboxMap.style!!.getLayerAs(LAYER_ID) + val layer = maplibreMap.style!!.getLayerAs(LAYER_ID) layer!!.setProperties( PropertyFactory.iconOpacity( Expression.match( @@ -88,11 +88,11 @@ class SymbolGeneratorActivity : AppCompatActivity(), OnMapReadyCallback { override fun onOptionsItemSelected(item: MenuItem): Boolean { if (item.itemId == R.id.menu_action_icon_overlap) { - val layer = mapboxMap.style!!.getLayerAs(LAYER_ID) + val layer = maplibreMap.style!!.getLayerAs(LAYER_ID) layer!!.setProperties(PropertyFactory.iconAllowOverlap(!layer.iconAllowOverlap.getValue()!!)) return true } else if (item.itemId == R.id.menu_action_filter) { - val layer = mapboxMap.style!!.getLayerAs(LAYER_ID) + val layer = maplibreMap.style!!.getLayerAs(LAYER_ID) layer!!.setFilter(Expression.eq(Expression.get(FEATURE_RANK), Expression.literal(1))) Timber.e("Filter that was set: %s", layer.filter) return true @@ -270,10 +270,10 @@ class SymbolGeneratorActivity : AppCompatActivity(), OnMapReadyCallback { // add a geojson source to the map val source: Source = GeoJsonSource(SOURCE_ID, featureCollection) - mapboxMap.style!!.addSource(source) + maplibreMap.style!!.addSource(source) // add symbol layer - mapboxMap.style!!.addLayer(symbolLayer) + maplibreMap.style!!.addLayer(symbolLayer) // get expressions val iconImageExpressionResult = symbolLayer.iconImage.expression @@ -297,11 +297,11 @@ class SymbolGeneratorActivity : AppCompatActivity(), OnMapReadyCallback { PropertyFactory.textField(textFieldExpressionResult), PropertyFactory.textColor(textColorExpressionResult) ) - GenerateSymbolTask(mapboxMap, this).execute(featureCollection) + GenerateSymbolTask(maplibreMap, this).execute(featureCollection) } private class GenerateSymbolTask internal constructor( - private val mapboxMap: MapboxMap?, + private val maplibreMap: MapLibreMap?, context: Context ) : AsyncTask>() { private val context: WeakReference @@ -330,7 +330,7 @@ class SymbolGeneratorActivity : AppCompatActivity(), OnMapReadyCallback { override fun onPostExecute(bitmapHashMap: HashMap) { super.onPostExecute(bitmapHashMap) - mapboxMap?.getStyle { style -> style.addImagesAsync(bitmapHashMap) } + maplibreMap?.getStyle { style -> style.addImagesAsync(bitmapHashMap) } } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolLayerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/SymbolLayerActivity.kt similarity index 87% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolLayerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/SymbolLayerActivity.kt index 00900d2b6..61b1a45a3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolLayerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/SymbolLayerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.graphics.Color import android.os.Bundle @@ -13,25 +13,25 @@ import com.google.gson.JsonPrimitive import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener -import com.mapbox.mapboxsdk.maps.MapboxMapOptions -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.expressions.Expression.FormatEntry -import com.mapbox.mapboxsdk.style.expressions.Expression.FormatOption -import com.mapbox.mapboxsdk.style.expressions.Expression.NumberFormatOption -import com.mapbox.mapboxsdk.style.layers.Property -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.style.sources.Source -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.utils.BitmapUtils +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.OnMapClickListener +import org.maplibre.android.maps.MapLibreMapOptions +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.expressions.Expression.FormatEntry +import org.maplibre.android.style.expressions.Expression.FormatOption +import org.maplibre.android.style.expressions.Expression.NumberFormatOption +import org.maplibre.android.style.layers.Property +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.style.sources.Source +import org.maplibre.android.testapp.R +import org.maplibre.android.utils.BitmapUtils import timber.log.Timber import java.util.Arrays import java.util.Objects @@ -51,15 +51,15 @@ class SymbolLayerActivity : AppCompatActivity(), OnMapClickListener, OnMapReadyC private var markerSymbolLayer: SymbolLayer? = null private var mapboxSignSymbolLayer: SymbolLayer? = null private var numberFormatSymbolLayer: SymbolLayer? = null - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var mapView: MapView public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_symbollayer) // Create map configuration - val mapboxMapOptions = MapboxMapOptions.createFromAttributes(this) - mapboxMapOptions.camera( + val maplibreMapOptions = MapLibreMapOptions.createFromAttributes(this) + maplibreMapOptions.camera( CameraPosition.Builder().target( LatLng(52.35273, 4.91638) ) @@ -68,14 +68,14 @@ class SymbolLayerActivity : AppCompatActivity(), OnMapClickListener, OnMapReadyC ) // Create map programmatically, add to view hierarchy - mapView = MapView(this, mapboxMapOptions) + mapView = MapView(this, maplibreMapOptions) mapView.getMapAsync(this) mapView.onCreate(savedInstanceState) (findViewById(R.id.container) as ViewGroup).addView(mapView) // Use OnStyleImageMissing API to lazily load an icon mapView.addOnStyleImageMissingListener { id: String? -> - val style = mapboxMap.style + val style = maplibreMap.style if (style != null) { Timber.e("Adding image with id: %s", id) val androidIcon = @@ -85,8 +85,8 @@ class SymbolLayerActivity : AppCompatActivity(), OnMapClickListener, OnMapReadyC } } - override fun onMapReady(mapboxMap: MapboxMap) { - this.mapboxMap = mapboxMap + override fun onMapReady(maplibreMap: MapLibreMap) { + this.maplibreMap = maplibreMap val carBitmap = BitmapUtils.getBitmapFromDrawable( ResourcesCompat.getDrawable(resources, R.drawable.ic_directions_car_black, null) ) @@ -153,7 +153,7 @@ class SymbolLayerActivity : AppCompatActivity(), OnMapClickListener, OnMapReadyC ) ) ) - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri("asset://streets.json") .withImage("Car", Objects.requireNonNull(carBitmap)!!, false) @@ -162,13 +162,13 @@ class SymbolLayerActivity : AppCompatActivity(), OnMapClickListener, OnMapReadyC ) // Set a click-listener so we can manipulate the map - mapboxMap.addOnMapClickListener(this@SymbolLayerActivity) + maplibreMap.addOnMapClickListener(this@SymbolLayerActivity) } override fun onMapClick(point: LatLng): Boolean { // Query which features are clicked - val screenLoc = mapboxMap.projection.toScreenLocation(point) - val markerFeatures = mapboxMap.queryRenderedFeatures(screenLoc, MARKER_LAYER) + val screenLoc = maplibreMap.projection.toScreenLocation(point) + val markerFeatures = maplibreMap.queryRenderedFeatures(screenLoc, MARKER_LAYER) if (!markerFeatures.isEmpty()) { for (feature in Objects.requireNonNull(markerCollection!!.features())!!) { if (feature.getStringProperty(ID_FEATURE_PROPERTY) @@ -195,7 +195,7 @@ class SymbolLayerActivity : AppCompatActivity(), OnMapClickListener, OnMapReadyC } markerSource!!.setGeoJson(markerCollection) } else { - val mapboxSignFeatures = mapboxMap.queryRenderedFeatures(screenLoc, MAPBOX_SIGN_LAYER) + val mapboxSignFeatures = maplibreMap.queryRenderedFeatures(screenLoc, MAPBOX_SIGN_LAYER) if (!mapboxSignFeatures.isEmpty()) { shuffleMapboxSign() } @@ -312,8 +312,8 @@ class SymbolLayerActivity : AppCompatActivity(), OnMapClickListener, OnMapReadyC public override fun onDestroy() { super.onDestroy() - if (mapboxMap != null) { - mapboxMap.removeOnMapClickListener(this) + if (maplibreMap != null) { + maplibreMap.removeOnMapClickListener(this) } mapView.onDestroy() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ZoomFunctionSymbolLayerActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/ZoomFunctionSymbolLayerActivity.kt similarity index 83% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ZoomFunctionSymbolLayerActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/ZoomFunctionSymbolLayerActivity.kt index b5ad9949d..9391f7760 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/ZoomFunctionSymbolLayerActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/style/ZoomFunctionSymbolLayerActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.style +package org.maplibre.android.testapp.activity.style import android.os.Bundle import android.view.Menu @@ -8,17 +8,17 @@ import com.google.gson.JsonObject import com.mapbox.geojson.Feature import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.MapboxMap.OnMapClickListener -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression -import com.mapbox.mapboxsdk.style.layers.Property -import com.mapbox.mapboxsdk.style.layers.PropertyFactory -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.OnMapClickListener +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression +import org.maplibre.android.style.layers.Property +import org.maplibre.android.style.layers.PropertyFactory +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.R import timber.log.Timber /** @@ -26,20 +26,20 @@ import timber.log.Timber */ class ZoomFunctionSymbolLayerActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var source: GeoJsonSource? = null private var layer: SymbolLayer? = null private var isInitialPosition = true private var isSelected = false private var isShowingSymbolLayer = true private val mapClickListener = OnMapClickListener { point -> - val screenPoint = mapboxMap.projection.toScreenLocation(point) - val featureList = mapboxMap.queryRenderedFeatures(screenPoint, LAYER_ID) + val screenPoint = maplibreMap.projection.toScreenLocation(point) + val featureList = maplibreMap.queryRenderedFeatures(screenPoint, LAYER_ID) if (!featureList.isEmpty()) { val feature = featureList[0] val selectedNow = feature.getBooleanProperty(KEY_PROPERTY_SELECTED) isSelected = !selectedNow - updateSource(mapboxMap.style) + updateSource(maplibreMap.style) } else { Timber.e("No features found") } @@ -52,8 +52,8 @@ class ZoomFunctionSymbolLayerActivity : AppCompatActivity() { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) mapView.getMapAsync( - OnMapReadyCallback { map: MapboxMap -> - mapboxMap = map + OnMapReadyCallback { map: MapLibreMap -> + maplibreMap = map map.setStyle(Style.getPredefinedStyle("Streets")) { style: Style -> updateSource(style) addLayer(style) @@ -120,10 +120,10 @@ class ZoomFunctionSymbolLayerActivity : AppCompatActivity() { } override fun onOptionsItemSelected(item: MenuItem): Boolean { - if (mapboxMap != null) { + if (maplibreMap != null) { if (item.itemId == R.id.menu_action_change_location) { isInitialPosition = !isInitialPosition - updateSource(mapboxMap.style) + updateSource(maplibreMap.style) } else if (item.itemId == R.id.menu_action_toggle_source) { toggleSymbolLayerVisibility() } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/telemetry/PerformanceMeasurementActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/telemetry/PerformanceMeasurementActivity.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/telemetry/PerformanceMeasurementActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/telemetry/PerformanceMeasurementActivity.kt index baa9a61d9..c655287d6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/telemetry/PerformanceMeasurementActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/telemetry/PerformanceMeasurementActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.telemetry +package org.maplibre.android.testapp.activity.telemetry import android.app.ActivityManager import android.os.Build @@ -8,13 +8,13 @@ import android.view.WindowManager import androidx.appcompat.app.AppCompatActivity import com.google.gson.Gson import com.google.gson.JsonObject -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.module.http.HttpRequestUtil -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.MapLibre +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.maps.Style +import org.maplibre.android.module.http.HttpRequestUtil +import org.maplibre.android.testapp.R import okhttp3.Call import okhttp3.OkHttpClient import okhttp3.OkHttpClient.Builder @@ -37,8 +37,8 @@ class PerformanceMeasurementActivity : AppCompatActivity() { .build() HttpRequestUtil.setOkHttpClient(okHttpClient) mapView.getMapAsync( - OnMapReadyCallback { mapboxMap: MapboxMap -> - mapboxMap.setStyle( + OnMapReadyCallback { maplibreMap: MapLibreMap -> + maplibreMap.setStyle( Style.Builder().fromUri(Style.getPredefinedStyle("Streets")) ) } @@ -135,7 +135,7 @@ class PerformanceMeasurementActivity : AppCompatActivity() { private val ram: String private get() { - val actManager = Mapbox.getApplicationContext() + val actManager = MapLibre.getApplicationContext() .getSystemService(ACTIVITY_SERVICE) as ActivityManager val memInfo = ActivityManager.MemoryInfo() actManager.getMemoryInfo(memInfo) @@ -144,7 +144,7 @@ class PerformanceMeasurementActivity : AppCompatActivity() { private val windowSize: String private get() { val windowManager = - Mapbox.getApplicationContext().getSystemService(WINDOW_SERVICE) as WindowManager + MapLibre.getApplicationContext().getSystemService(WINDOW_SERVICE) as WindowManager val display = windowManager.defaultDisplay val metrics = DisplayMetrics() display.getMetrics(metrics) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewAnimationActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewAnimationActivity.kt similarity index 76% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewAnimationActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewAnimationActivity.kt index d9f1b2591..450d532ce 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewAnimationActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewAnimationActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.textureview +package org.maplibre.android.testapp.activity.textureview import android.animation.ObjectAnimator import android.os.Bundle @@ -6,11 +6,11 @@ import android.os.Handler import android.view.View import android.widget.TextView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.maps.MapboxMap.CancelableCallback -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.maps.MapLibreMap.CancelableCallback +import org.maplibre.android.testapp.R import java.util.* /** @@ -18,7 +18,7 @@ import java.util.* */ class TextureViewAnimationActivity : AppCompatActivity() { private lateinit var mapView: MapView - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private var handler: Handler? = null private var delayed: Runnable? = null override fun onCreate(savedInstanceState: Bundle?) { @@ -39,10 +39,10 @@ class TextureViewAnimationActivity : AppCompatActivity() { private fun setupMapView(savedInstanceState: Bundle?) { mapView = findViewById(R.id.mapView) as MapView - mapView.getMapAsync { mapboxMap: MapboxMap -> - this@TextureViewAnimationActivity.mapboxMap = mapboxMap - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) - setFpsView(mapboxMap) + mapView.getMapAsync { maplibreMap: MapLibreMap -> + this@TextureViewAnimationActivity.maplibreMap = maplibreMap + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) + setFpsView(maplibreMap) // Animate the map view val animation = ObjectAnimator.ofFloat(mapView!!, "rotationY", 0.0f, 360f) @@ -51,19 +51,19 @@ class TextureViewAnimationActivity : AppCompatActivity() { animation.start() // Start an animation on the map as well - flyTo(mapboxMap, 0, 14.0) + flyTo(maplibreMap, 0, 14.0) } } - private fun flyTo(mapboxMap: MapboxMap, place: Int, zoom: Double) { - mapboxMap.animateCamera( + private fun flyTo(maplibreMap: MapLibreMap, place: Int, zoom: Double) { + maplibreMap.animateCamera( CameraUpdateFactory.newLatLngZoom(PLACES[place], zoom), 10000, object : CancelableCallback { override fun onCancel() { delayed = Runnable { delayed = null - flyTo(mapboxMap, place, zoom) + flyTo(maplibreMap, place, zoom) } delayed?.let { handler!!.postDelayed(it, 2000) @@ -71,15 +71,15 @@ class TextureViewAnimationActivity : AppCompatActivity() { } override fun onFinish() { - flyTo(mapboxMap, if (place == PLACES.size - 1) 0 else place + 1, zoom) + flyTo(maplibreMap, if (place == PLACES.size - 1) 0 else place + 1, zoom) } } ) } - private fun setFpsView(mapboxMap: MapboxMap) { + private fun setFpsView(maplibreMap: MapLibreMap) { val fpsView = findViewById(R.id.fpsView) as TextView - mapboxMap.setOnFpsChangedListener { fps: Double -> + maplibreMap.setOnFpsChangedListener { fps: Double -> fpsView.text = String.format(Locale.US, "FPS: %4.2f", fps) } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewDebugModeActivity.kt similarity index 62% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewDebugModeActivity.kt index d755a7096..514a7496e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewDebugModeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewDebugModeActivity.kt @@ -1,15 +1,15 @@ -package com.mapbox.mapboxsdk.testapp.activity.textureview +package org.maplibre.android.testapp.activity.textureview -import com.mapbox.mapboxsdk.maps.MapboxMapOptions -import com.mapbox.mapboxsdk.maps.OnMapReadyCallback -import com.mapbox.mapboxsdk.testapp.activity.maplayout.DebugModeActivity -import com.mapbox.mapboxsdk.testapp.utils.NavUtils +import org.maplibre.android.maps.MapLibreMapOptions +import org.maplibre.android.maps.OnMapReadyCallback +import org.maplibre.android.testapp.activity.maplayout.DebugModeActivity +import org.maplibre.android.testapp.utils.NavUtils /** * Test activity showcasing the different debug modes and allows to cycle between the default map styles. */ class TextureViewDebugModeActivity : DebugModeActivity(), OnMapReadyCallback { - override fun setupMapboxMapOptions(): MapboxMapOptions { + override fun setupMapboxMapOptions(): MapLibreMapOptions { val mapboxMapOptions = super.setupMapboxMapOptions() mapboxMapOptions.textureMode(true) return mapboxMapOptions diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewResizeActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewResizeActivity.kt similarity index 87% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewResizeActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewResizeActivity.kt index b0ebda7ee..dd0c0d6f2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewResizeActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewResizeActivity.kt @@ -1,12 +1,12 @@ -package com.mapbox.mapboxsdk.testapp.activity.textureview +package org.maplibre.android.testapp.activity.textureview import android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity import androidx.coordinatorlayout.widget.CoordinatorLayout import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R /** * Test resizing a [android.view.TextureView] backed map on the fly. @@ -32,11 +32,11 @@ class TextureViewResizeActivity : AppCompatActivity() { private fun setupMapView(savedInstanceState: Bundle?) { mapView = findViewById(R.id.mapView) mapView.onCreate(savedInstanceState) - mapView.getMapAsync(OnMapReadyCallback { mapboxMap: MapboxMap -> setupMap(mapboxMap) }) + mapView.getMapAsync(OnMapReadyCallback { maplibreMap: MapLibreMap -> setupMap(maplibreMap) }) } - private fun setupMap(mapboxMap: MapboxMap) { - mapboxMap.setStyle(Style.getPredefinedStyle("Streets")) + private fun setupMap(maplibreMap: MapLibreMap) { + maplibreMap.setStyle(Style.getPredefinedStyle("Streets")) } private fun setupFab() { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewTransparentBackgroundActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewTransparentBackgroundActivity.kt similarity index 73% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewTransparentBackgroundActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewTransparentBackgroundActivity.kt index 56b317fc4..309de2688 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/textureview/TextureViewTransparentBackgroundActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/textureview/TextureViewTransparentBackgroundActivity.kt @@ -1,15 +1,15 @@ -package com.mapbox.mapboxsdk.testapp.activity.textureview +package org.maplibre.android.testapp.activity.textureview import android.os.Bundle import android.view.View import android.view.ViewGroup import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.* -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.utils.ResourceUtils +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.* +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.utils.ResourceUtils import timber.log.Timber import java.io.IOException @@ -18,7 +18,7 @@ import java.io.IOException */ class TextureViewTransparentBackgroundActivity : AppCompatActivity() { private lateinit var mapView: MapView - private val mapboxMap: MapboxMap? = null + private val maplibreMap: MapLibreMap? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_textureview_transparent) @@ -33,24 +33,24 @@ class TextureViewTransparentBackgroundActivity : AppCompatActivity() { } private fun setupMapView(savedInstanceState: Bundle?) { - val mapboxMapOptions = MapboxMapOptions.createFromAttributes(this, null) - mapboxMapOptions.translucentTextureSurface(true) - mapboxMapOptions.textureMode(true) - mapboxMapOptions.camera( + val maplibreMapOptions = MapLibreMapOptions.createFromAttributes(this, null) + maplibreMapOptions.translucentTextureSurface(true) + maplibreMapOptions.textureMode(true) + maplibreMapOptions.camera( CameraPosition.Builder() .zoom(2.0) .target(LatLng(48.507879, 8.363795)) .build() ) - mapView = MapView(this, mapboxMapOptions) + mapView = MapView(this, maplibreMapOptions) mapView.onCreate(savedInstanceState) - mapView.getMapAsync { mapboxMap: MapboxMap -> initMap(mapboxMap) } + mapView.getMapAsync { maplibreMap: MapLibreMap -> initMap(maplibreMap) } (findViewById(R.id.coordinator_layout) as ViewGroup).addView(mapView) } - private fun initMap(mapboxMap: MapboxMap) { + private fun initMap(maplibreMap: MapLibreMap) { try { - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder().fromJson(ResourceUtils.readRawResource(this, R.raw.no_bg_style)) ) } catch (exception: IOException) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/MapSnapshotterWithinExpression.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/MapSnapshotterWithinExpression.kt similarity index 85% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/MapSnapshotterWithinExpression.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/MapSnapshotterWithinExpression.kt index f7349fcbe..0ef23d045 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/MapSnapshotterWithinExpression.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/MapSnapshotterWithinExpression.kt @@ -1,35 +1,35 @@ -package com.mapbox.mapboxsdk.testapp.activity.turf +package org.maplibre.android.testapp.activity.turf import android.graphics.Color import android.os.Bundle import android.os.PersistableBundle import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.* -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.snapshotter.MapSnapshot -import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter -import com.mapbox.mapboxsdk.style.expressions.Expression.within -import com.mapbox.mapboxsdk.style.layers.CircleLayer -import com.mapbox.mapboxsdk.style.layers.FillLayer -import com.mapbox.mapboxsdk.style.layers.LineLayer -import com.mapbox.mapboxsdk.style.layers.Property.NONE -import com.mapbox.mapboxsdk.style.layers.PropertyFactory.* -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.databinding.ActivityMapsnapshotterWithinExpressionBinding +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.snapshotter.MapSnapshot +import org.maplibre.android.snapshotter.MapSnapshotter +import org.maplibre.android.style.expressions.Expression.within +import org.maplibre.android.style.layers.CircleLayer +import org.maplibre.android.style.layers.FillLayer +import org.maplibre.android.style.layers.LineLayer +import org.maplibre.android.style.layers.Property.NONE +import org.maplibre.android.style.layers.PropertyFactory.* +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonOptions +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.databinding.ActivityMapsnapshotterWithinExpressionBinding /** * An Activity that showcases the use of MapSnapshotter with 'within' expression */ class MapSnapshotterWithinExpression : AppCompatActivity() { private lateinit var binding: ActivityMapsnapshotterWithinExpressionBinding - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var snapshotter: MapSnapshotter private var snapshotInProgress = false @@ -37,7 +37,7 @@ class MapSnapshotterWithinExpression : AppCompatActivity() { override fun onCameraDidChange(animated: Boolean) { if (!snapshotInProgress) { snapshotInProgress = true - snapshotter.setCameraPosition(mapboxMap.cameraPosition) + snapshotter.setCameraPosition(maplibreMap.cameraPosition) snapshotter.start(object : MapSnapshotter.SnapshotReadyCallback { override fun onSnapshotReady(snapshot: MapSnapshot) { binding.imageView.setImageBitmap(snapshot.bitmap) @@ -73,15 +73,15 @@ class MapSnapshotterWithinExpression : AppCompatActivity() { binding.mapView.onCreate(savedInstanceState) binding.mapView.getMapAsync { map -> - mapboxMap = map + maplibreMap = map // Setup camera position above Georgetown - mapboxMap.cameraPosition = CameraPosition.Builder().target(LatLng(38.90628988399711, -77.06574689337494)).zoom(15.5).build() + maplibreMap.cameraPosition = CameraPosition.Builder().target(LatLng(38.90628988399711, -77.06574689337494)).zoom(15.5).build() // Wait for the map to become idle before manipulating the style and camera of the map binding.mapView.addOnDidBecomeIdleListener(object : MapView.OnDidBecomeIdleListener { override fun onDidBecomeIdle() { - mapboxMap.easeCamera( + maplibreMap.easeCamera( CameraUpdateFactory.newCameraPosition( CameraPosition.Builder().zoom(16.0).target(LatLng(38.905156245642814, -77.06535338052844)).bearing(80.68015859462369).tilt(55.0).build() ), @@ -106,14 +106,14 @@ class MapSnapshotterWithinExpression : AppCompatActivity() { // Setup style with additional layers, // using streets as a base style - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder().fromUri(Style.getPredefinedStyle("Streets")) ) { binding.mapView.addOnCameraDidChangeListener(cameraListener) } val options = MapSnapshotter.Options(binding.imageView.measuredWidth / 2, binding.imageView.measuredHeight / 2) - .withCameraPosition(mapboxMap.cameraPosition) + .withCameraPosition(maplibreMap.cameraPosition) .withPixelRatio(2.0f).withStyleBuilder( Style.Builder().fromUri(Style.getPredefinedStyle("Streets")).withSources( GeoJsonSource( diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/PhysicalUnitCircleActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/PhysicalUnitCircleActivity.kt similarity index 89% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/PhysicalUnitCircleActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/PhysicalUnitCircleActivity.kt index ff5765987..cad5f32e8 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/PhysicalUnitCircleActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/PhysicalUnitCircleActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.turf +package org.maplibre.android.testapp.activity.turf import android.graphics.Color import android.os.Bundle @@ -6,14 +6,14 @@ import android.os.PersistableBundle import android.widget.SeekBar import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression.* -import com.mapbox.mapboxsdk.style.layers.FillLayer -import com.mapbox.mapboxsdk.style.layers.PropertyFactory.fillColor -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.databinding.ActivityPhysicalCircleBinding +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression.* +import org.maplibre.android.style.layers.FillLayer +import org.maplibre.android.style.layers.PropertyFactory.fillColor +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.databinding.ActivityPhysicalCircleBinding import com.mapbox.turf.TurfTransformation /** diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/WithinExpressionActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/WithinExpressionActivity.kt similarity index 87% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/WithinExpressionActivity.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/WithinExpressionActivity.kt index d68839a7d..9a4e1a6ba 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/turf/WithinExpressionActivity.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/activity/turf/WithinExpressionActivity.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.activity.turf +package org.maplibre.android.testapp.activity.turf import android.graphics.Color import android.os.Bundle @@ -6,29 +6,29 @@ import android.os.Handler import android.os.PersistableBundle import androidx.appcompat.app.AppCompatActivity import com.mapbox.geojson.* -import com.mapbox.mapboxsdk.camera.CameraPosition -import com.mapbox.mapboxsdk.camera.CameraUpdateFactory -import com.mapbox.mapboxsdk.geometry.LatLng -import com.mapbox.mapboxsdk.maps.MapView -import com.mapbox.mapboxsdk.maps.MapboxMap -import com.mapbox.mapboxsdk.maps.Style -import com.mapbox.mapboxsdk.style.expressions.Expression.within -import com.mapbox.mapboxsdk.style.layers.CircleLayer -import com.mapbox.mapboxsdk.style.layers.FillLayer -import com.mapbox.mapboxsdk.style.layers.LineLayer -import com.mapbox.mapboxsdk.style.layers.Property.NONE -import com.mapbox.mapboxsdk.style.layers.PropertyFactory.* -import com.mapbox.mapboxsdk.style.layers.SymbolLayer -import com.mapbox.mapboxsdk.style.sources.GeoJsonOptions -import com.mapbox.mapboxsdk.style.sources.GeoJsonSource -import com.mapbox.mapboxsdk.testapp.databinding.ActivityWithinExpressionBinding +import org.maplibre.android.camera.CameraPosition +import org.maplibre.android.camera.CameraUpdateFactory +import org.maplibre.android.geometry.LatLng +import org.maplibre.android.maps.MapView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.Style +import org.maplibre.android.style.expressions.Expression.within +import org.maplibre.android.style.layers.CircleLayer +import org.maplibre.android.style.layers.FillLayer +import org.maplibre.android.style.layers.LineLayer +import org.maplibre.android.style.layers.Property.NONE +import org.maplibre.android.style.layers.PropertyFactory.* +import org.maplibre.android.style.layers.SymbolLayer +import org.maplibre.android.style.sources.GeoJsonOptions +import org.maplibre.android.style.sources.GeoJsonSource +import org.maplibre.android.testapp.databinding.ActivityWithinExpressionBinding /** * An Activity that showcases the within expression to filter features outside a geometry */ class WithinExpressionActivity : AppCompatActivity() { - private lateinit var mapboxMap: MapboxMap + private lateinit var maplibreMap: MapLibreMap private lateinit var binding: ActivityWithinExpressionBinding private lateinit var mapView: MapView @@ -45,10 +45,10 @@ class WithinExpressionActivity : AppCompatActivity() { mapView.onCreate(savedInstanceState) mapView.getMapAsync { map -> - mapboxMap = map + maplibreMap = map // Setup camera position above Georgetown - mapboxMap.cameraPosition = CameraPosition.Builder() + maplibreMap.cameraPosition = CameraPosition.Builder() .target(LatLng(38.90628988399711, -77.06574689337494)) .zoom(15.5) .build() @@ -95,7 +95,7 @@ class WithinExpressionActivity : AppCompatActivity() { // Setup style with additional layers, // using streets as a base style - mapboxMap.setStyle( + maplibreMap.setStyle( Style.Builder() .fromUri(Style.getPredefinedStyle("Streets")) .withSources( @@ -127,10 +127,10 @@ class WithinExpressionActivity : AppCompatActivity() { } private fun optimizeStyle() { - val style = mapboxMap.style!! + val style = maplibreMap.style!! // Add fill layer to represent buffered LineString - mapboxMap.style!!.addLayerBelow( + maplibreMap.style!!.addLayerBelow( FillLayer(FILL_ID, FILL_ID) .withProperties( fillOpacity(0.12f), @@ -140,7 +140,7 @@ class WithinExpressionActivity : AppCompatActivity() { ) // Move to a new camera position - mapboxMap.easeCamera( + maplibreMap.easeCamera( CameraUpdateFactory.newCameraPosition( CameraPosition.Builder() .zoom(16.0) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/adapter/FeatureAdapter.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/adapter/FeatureAdapter.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/adapter/FeatureAdapter.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/adapter/FeatureAdapter.kt index f1f28ae9b..9cca2b386 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/adapter/FeatureAdapter.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/adapter/FeatureAdapter.kt @@ -1,13 +1,13 @@ -package com.mapbox.mapboxsdk.testapp.adapter +package org.maplibre.android.testapp.adapter import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.model.activity.Feature -import com.mapbox.mapboxsdk.testapp.utils.FontCache +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.model.activity.Feature +import org.maplibre.android.testapp.utils.FontCache /** * Adapter used for FeatureOverviewActivity. diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/adapter/FeatureSectionAdapter.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/adapter/FeatureSectionAdapter.java similarity index 97% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/adapter/FeatureSectionAdapter.java rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/adapter/FeatureSectionAdapter.java index 474745c78..fc8dc64b3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/adapter/FeatureSectionAdapter.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/adapter/FeatureSectionAdapter.java @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.adapter; +package org.maplibre.android.testapp.adapter; import android.content.Context; import android.util.SparseArray; @@ -12,7 +12,7 @@ import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import com.mapbox.mapboxsdk.testapp.utils.FontCache; +import org.maplibre.android.testapp.utils.FontCache; import java.util.Arrays; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/activity/Feature.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/activity/Feature.kt similarity index 96% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/activity/Feature.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/activity/Feature.kt index 379d5a820..fda26e0e0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/activity/Feature.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/activity/Feature.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.model.activity +package org.maplibre.android.testapp.model.activity import android.os.Parcel import android.os.Parcelable diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CityStateMarker.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CityStateMarker.kt similarity index 58% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CityStateMarker.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CityStateMarker.kt index 6a8a68146..7cde67479 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CityStateMarker.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CityStateMarker.kt @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.testapp.model.annotations +package org.maplibre.android.testapp.model.annotations -import com.mapbox.mapboxsdk.annotations.Marker +import org.maplibre.android.annotations.Marker class CityStateMarker( cityStateOptions: CityStateMarkerOptions?, diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CityStateMarkerOptions.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CityStateMarkerOptions.kt similarity index 89% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CityStateMarkerOptions.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CityStateMarkerOptions.kt index b6b764457..0ffe31f9f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CityStateMarkerOptions.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CityStateMarkerOptions.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.testapp.model.annotations +package org.maplibre.android.testapp.model.annotations import android.graphics.Bitmap import android.os.Parcel import android.os.Parcelable -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions -import com.mapbox.mapboxsdk.annotations.IconFactory -import com.mapbox.mapboxsdk.geometry.LatLng +import org.maplibre.android.annotations.BaseMarkerOptions +import org.maplibre.android.annotations.IconFactory +import org.maplibre.android.geometry.LatLng class CityStateMarkerOptions : BaseMarkerOptions { private var infoWindowBackgroundColor: String? = null diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CountryMarker.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CountryMarker.kt new file mode 100644 index 000000000..10f4cc6fa --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CountryMarker.kt @@ -0,0 +1,10 @@ +package org.maplibre.android.testapp.model.annotations + +import org.maplibre.android.annotations.BaseMarkerOptions +import org.maplibre.android.annotations.Marker + +class CountryMarker( + baseMarkerOptions: BaseMarkerOptions<*, *>?, + val abbrevName: String, + val flagRes: Int +) : Marker(baseMarkerOptions) diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CountryMarkerOptions.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CountryMarkerOptions.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CountryMarkerOptions.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CountryMarkerOptions.kt index 2020cd0bd..d33ef29be 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/CountryMarkerOptions.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/annotations/CountryMarkerOptions.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.testapp.model.annotations +package org.maplibre.android.testapp.model.annotations import android.graphics.Bitmap import android.os.Parcel import android.os.Parcelable -import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions -import com.mapbox.mapboxsdk.annotations.IconFactory -import com.mapbox.mapboxsdk.geometry.LatLng +import org.maplibre.android.annotations.BaseMarkerOptions +import org.maplibre.android.annotations.IconFactory +import org.maplibre.android.geometry.LatLng class CountryMarkerOptions : BaseMarkerOptions { private var abbrevName: String? = null diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/customlayer/ExampleCustomLayer.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/customlayer/ExampleCustomLayer.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/customlayer/ExampleCustomLayer.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/customlayer/ExampleCustomLayer.kt index 8d4eaea5f..7def2f521 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/customlayer/ExampleCustomLayer.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/customlayer/ExampleCustomLayer.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.model.customlayer +package org.maplibre.android.testapp.model.customlayer import androidx.annotation.Keep diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/other/OfflineDownloadRegionDialog.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/other/OfflineDownloadRegionDialog.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/other/OfflineDownloadRegionDialog.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/other/OfflineDownloadRegionDialog.kt index bdc6f71e6..00c266d8e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/other/OfflineDownloadRegionDialog.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/other/OfflineDownloadRegionDialog.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.model.other +package org.maplibre.android.testapp.model.other import android.app.Activity import android.app.Dialog @@ -7,8 +7,8 @@ import android.os.Bundle import android.widget.EditText import androidx.appcompat.app.AlertDialog import androidx.fragment.app.DialogFragment -import com.mapbox.mapboxsdk.testapp.R -import com.mapbox.mapboxsdk.testapp.model.other.OfflineDownloadRegionDialog.DownloadRegionDialogListener +import org.maplibre.android.testapp.R +import org.maplibre.android.testapp.model.other.OfflineDownloadRegionDialog.DownloadRegionDialogListener import timber.log.Timber class OfflineDownloadRegionDialog : DialogFragment() { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/other/OfflineListRegionsDialog.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/other/OfflineListRegionsDialog.kt similarity index 92% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/other/OfflineListRegionsDialog.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/other/OfflineListRegionsDialog.kt index 4fa0409da..a8e5d1c5e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/other/OfflineListRegionsDialog.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/model/other/OfflineListRegionsDialog.kt @@ -1,11 +1,11 @@ -package com.mapbox.mapboxsdk.testapp.model.other +package org.maplibre.android.testapp.model.other import android.app.Dialog import android.content.DialogInterface import android.os.Bundle import androidx.appcompat.app.AlertDialog import androidx.fragment.app.DialogFragment -import com.mapbox.mapboxsdk.testapp.R +import org.maplibre.android.testapp.R import timber.log.Timber class OfflineListRegionsDialog : DialogFragment() { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ApiKeyUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ApiKeyUtils.kt similarity index 82% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ApiKeyUtils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ApiKeyUtils.kt index 07175f1f8..7e85c8ea6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ApiKeyUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ApiKeyUtils.kt @@ -1,7 +1,7 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.content.Context -import com.mapbox.mapboxsdk.Mapbox +import org.maplibre.android.MapLibre import java.lang.Exception object ApiKeyUtils { @@ -10,7 +10,7 @@ object ApiKeyUtils { * * Returns the ApiKey set in the app resources. * - * It will first search for a api key in the Mapbox object. If not found it + * It will first search for a api key in the MapLibre object. If not found it * will then attempt to load the api key from the * `res/values/dev.xml` development file. * @@ -20,7 +20,7 @@ object ApiKeyUtils { fun getApiKey(context: Context): String? { return try { // Read out AndroidManifest - val apiKey = Mapbox.getApiKey() + val apiKey = MapLibre.getApiKey() require(!(apiKey == null || apiKey.isEmpty())) apiKey } catch (exception: Exception) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FileUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/FileUtils.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FileUtils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/FileUtils.kt index 927e43f2d..70570203d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FileUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/FileUtils.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.content.Context import android.os.AsyncTask diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/FontCache.kt similarity index 93% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/FontCache.kt index 5a6d1e9aa..7a7033002 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/FontCache.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.content.Context import android.graphics.Typeface diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/GeoParseUtil.kt similarity index 95% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/GeoParseUtil.kt index 8a1094a36..224b97943 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/GeoParseUtil.kt @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.content.Context import android.text.TextUtils import com.mapbox.geojson.FeatureCollection import com.mapbox.geojson.Point -import com.mapbox.mapboxsdk.geometry.LatLng +import org.maplibre.android.geometry.LatLng import java.io.BufferedReader import java.io.IOException import java.io.InputStreamReader diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/IconUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/IconUtils.kt similarity index 88% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/IconUtils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/IconUtils.kt index 6922ad6c1..c4e60dcd9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/IconUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/IconUtils.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.content.Context import android.graphics.Bitmap @@ -7,8 +7,8 @@ import androidx.annotation.ColorInt import androidx.annotation.DrawableRes import androidx.core.content.res.ResourcesCompat import androidx.core.graphics.drawable.DrawableCompat -import com.mapbox.mapboxsdk.annotations.Icon -import com.mapbox.mapboxsdk.annotations.IconFactory +import org.maplibre.android.annotations.Icon +import org.maplibre.android.annotations.IconFactory object IconUtils { /** diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/IdleZoomListener.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/IdleZoomListener.kt new file mode 100644 index 000000000..5b63cd272 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/IdleZoomListener.kt @@ -0,0 +1,15 @@ +package org.maplibre.android.testapp.utils + +import android.widget.TextView +import org.maplibre.android.maps.MapLibreMap +import org.maplibre.android.maps.MapLibreMap.OnCameraIdleListener +import org.maplibre.android.testapp.R + +class IdleZoomListener(private val maplibreMap: MapLibreMap, private val textView: TextView) : + OnCameraIdleListener { + override fun onCameraIdle() { + val context = textView.context + val position = maplibreMap.cameraPosition + textView.text = String.format(context.getString(R.string.debug_zoom), position.zoom) + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ItemClickSupport.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ItemClickSupport.java similarity index 97% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ItemClickSupport.java rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ItemClickSupport.java index b92ac5b16..89e239a8c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ItemClickSupport.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ItemClickSupport.java @@ -1,10 +1,10 @@ -package com.mapbox.mapboxsdk.testapp.utils; +package org.maplibre.android.testapp.utils; import android.view.View; import androidx.recyclerview.widget.RecyclerView; -import com.mapbox.mapboxsdk.testapp.R; +import org.maplibre.android.testapp.R; public class ItemClickSupport { private final RecyclerView recyclerView; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/NavUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/NavUtils.kt similarity index 69% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/NavUtils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/NavUtils.kt index 80fd14b38..0ee5c4484 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/NavUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/NavUtils.kt @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.app.Activity import android.content.Intent -import com.mapbox.mapboxsdk.testapp.activity.FeatureOverviewActivity +import org.maplibre.android.testapp.activity.FeatureOverviewActivity object NavUtils { fun navigateHome(context: Activity) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/OfflineUtils.kt similarity index 90% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/OfflineUtils.kt index 57f872a68..266909432 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/OfflineUtils.kt @@ -1,8 +1,8 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import com.google.gson.Gson import com.google.gson.JsonObject -import com.mapbox.mapboxsdk.testapp.activity.offline.OfflineActivity +import org.maplibre.android.testapp.activity.offline.OfflineActivity import timber.log.Timber import java.lang.Exception diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ResourceUtils.kt similarity index 95% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ResourceUtils.kt index b6244c439..cabe0ccdc 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ResourceUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ResourceUtils.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.content.Context import android.util.TypedValue diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TileLoadingMeasurementUtils.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TileLoadingMeasurementUtils.kt similarity index 92% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TileLoadingMeasurementUtils.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TileLoadingMeasurementUtils.kt index 7df2e1c5b..c7aa7a27c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TileLoadingMeasurementUtils.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TileLoadingMeasurementUtils.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.app.ActivityManager import android.content.Context @@ -12,10 +12,10 @@ import android.view.WindowManager import androidx.annotation.StringDef import com.google.gson.Gson import com.google.gson.JsonObject -import com.mapbox.mapboxsdk.MapStrictMode -import com.mapbox.mapboxsdk.Mapbox -import com.mapbox.mapboxsdk.constants.MapboxConstants -import com.mapbox.mapboxsdk.module.http.HttpRequestUtil +import org.maplibre.android.MapStrictMode +import org.maplibre.android.MapLibre +import org.maplibre.android.constants.MapLibreConstants +import org.maplibre.android.module.http.HttpRequestUtil import okhttp3.Interceptor import okhttp3.Interceptor.Chain import okhttp3.OkHttpClient @@ -42,14 +42,14 @@ class TileLoadingMeasurementUtils { private val isTileLoadingMeasurementOn: Boolean private get() = isBooleanMetaDataValueOn( - MapboxConstants.KEY_META_DATA_MEASURE_TILE_DOWNLOAD_ON, - MapboxConstants.DEFAULT_MEASURE_TILE_DOWNLOAD_ON + MapLibreConstants.KEY_META_DATA_MEASURE_TILE_DOWNLOAD_ON, + MapLibreConstants.DEFAULT_MEASURE_TILE_DOWNLOAD_ON ) private fun isBooleanMetaDataValueOn(propKey: String, defaultValue: Boolean): Boolean { try { // Try getting a custom value from the app Manifest - val context = Mapbox.getApplicationContext() + val context = MapLibre.getApplicationContext() val appInfo = context.packageManager.getApplicationInfo( context.packageName, PackageManager.GET_META_DATA @@ -134,7 +134,7 @@ class TileLoadingMeasurementUtils { private val ram: String private get() { - val actManager = Mapbox.getApplicationContext() + val actManager = MapLibre.getApplicationContext() .getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager val memInfo = ActivityManager.MemoryInfo() actManager.getMemoryInfo(memInfo) @@ -142,7 +142,7 @@ class TileLoadingMeasurementUtils { } private val windowSize: String private get() { - val windowManager = Mapbox.getApplicationContext() + val windowManager = MapLibre.getApplicationContext() .getSystemService(Context.WINDOW_SERVICE) as WindowManager val display = windowManager.defaultDisplay val metrics = DisplayMetrics() @@ -155,7 +155,7 @@ class TileLoadingMeasurementUtils { @get:ConnectionState private val connectionState: String private get() { - val appContext = Mapbox.getApplicationContext() + val appContext = MapLibre.getApplicationContext() val connectivityManager = appContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TimberLogger.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TimberLogger.kt similarity index 91% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TimberLogger.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TimberLogger.kt index 39107115f..01565d4dd 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TimberLogger.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TimberLogger.kt @@ -1,6 +1,6 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils -import com.mapbox.mapboxsdk.log.LoggerDefinition +import org.maplibre.android.log.LoggerDefinition import timber.log.Timber class TimberLogger : LoggerDefinition { diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TimingLogger.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TimingLogger.kt similarity index 99% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TimingLogger.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TimingLogger.kt index b32b08256..3e814929d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/TimingLogger.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/TimingLogger.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.os.SystemClock import timber.log.Timber diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ViewToBitmapUtil.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ViewToBitmapUtil.kt similarity index 94% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ViewToBitmapUtil.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ViewToBitmapUtil.kt index 2492bb63e..59b7c0de2 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/ViewToBitmapUtil.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/utils/ViewToBitmapUtil.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.utils +package org.maplibre.android.testapp.utils import android.graphics.Bitmap import android.graphics.Canvas diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/view/LockableBottomSheetBehavior.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/view/LockableBottomSheetBehavior.kt similarity index 98% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/view/LockableBottomSheetBehavior.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/view/LockableBottomSheetBehavior.kt index b65cecf54..716945aeb 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/view/LockableBottomSheetBehavior.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/view/LockableBottomSheetBehavior.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.view +package org.maplibre.android.testapp.view import android.content.Context import android.util.AttributeSet diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/view/MapViewPager.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/view/MapViewPager.kt similarity index 92% rename from platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/view/MapViewPager.kt rename to platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/view/MapViewPager.kt index d6b1792db..030ad3741 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/view/MapViewPager.kt +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/org/maplibre/android/testapp/view/MapViewPager.kt @@ -1,4 +1,4 @@ -package com.mapbox.mapboxsdk.testapp.view +package org.maplibre.android.testapp.view import android.content.Context import android.util.AttributeSet diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml index 0bb8106d0..f19741667 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_add_sprite.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - - - - - - - - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml index 262bb0739..3bb6c551f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_custom_layer.xml @@ -7,7 +7,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_data_driven_style.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_data_driven_style.xml index 2cbe20b47..b8d89467f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_data_driven_style.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_data_driven_style.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml index f292c8026..9cfa849a9 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_default.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_draggable_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_draggable_marker.xml index 2db336403..057d98c48 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_draggable_marker.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_draggable_marker.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" tools:context=".activity.style.DraggableMarkerActivity"> - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml index df4e7430e..10182faab 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_dynamic_marker.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml index 131d4fa57..3b1f98424 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_gesture_detector.xml @@ -4,9 +4,9 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.mapbox.mapboxsdk.testapp.activity.camera.GestureDetectorActivity"> + tools:context="com.maplibre.mapboxsdk.testapp.activity.camera.GestureDetectorActivity"> - - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_hillshade_layer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_hillshade_layer.xml index ef6e1030f..61d31787c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_hillshade_layer.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_hillshade_layer.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - - - - - - - - - - - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml index e67740ad5..a9fcdd28c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_simple.xml @@ -6,7 +6,7 @@ android:orientation="vertical" tools:context=".activity.maplayout.SimpleMapActivity"> - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_visibility.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_visibility.xml index fe5853781..b4327cebf 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_visibility.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_map_visibility.xml @@ -8,7 +8,7 @@ android:orientation="vertical" tools:context=".activity.maplayout.SimpleMapActivity"> - - - + - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml index 716e73971..d8093eb84 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_multi_map.xml @@ -1,6 +1,6 @@ + maplibre:maplibre_cameraTargetLat="38.913187" + maplibre:maplibre_cameraTargetLng="-77.032546" + maplibre:maplibre_cameraZoom="12" /> + maplibre:maplibre_cameraTargetLat="37.775732" + maplibre:maplibre_cameraTargetLng="-122.413985" + maplibre:maplibre_cameraZoom="13"/> + maplibre:maplibre_cameraTargetLat="12.97913" + maplibre:maplibre_cameraTargetLng="77.59188" + maplibre:maplibre_cameraZoom="14" /> + maplibre:maplibre_cameraTargetLat="-13.155980" + maplibre:maplibre_cameraTargetLng="-74.217134" + maplibre:maplibre_cameraZoom="15" /> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml index 3e21015e9..a0162869b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_offline.xml @@ -12,7 +12,7 @@ android:indeterminate="true" android:visibility="gone"/> - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_physical_circle.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_physical_circle.xml index 44132e91b..67782ba04 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_physical_circle.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_physical_circle.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" tools:context=".activity.style.DraggableMarkerActivity"> - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_pixel_test.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_pixel_test.xml index fdf041539..039b58c1e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_pixel_test.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_pixel_test.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml index a5e4b01dc..b783de69d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_query_features_box.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_scroll_by.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_scroll_by.xml index 7e364a90f..d309547ff 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_scroll_by.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_scroll_by.xml @@ -80,7 +80,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_textureview_animate.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_textureview_animate.xml index b6b12128c..15c5dc714 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_textureview_animate.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_textureview_animate.xml @@ -9,7 +9,7 @@ android:orientation="vertical"> - - - - @@ -16,6 +16,6 @@ android:paddingBottom="4dp" android:paddingTop="4dp"/> - + diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_within_expression.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_within_expression.xml index de8abb502..4794f55c3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_within_expression.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_within_expression.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" tools:context=".activity.style.DraggableMarkerActivity"> - diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_zoom_symbol_layer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_zoom_symbol_layer.xml index 87fc97904..c46bd5b9c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_zoom_symbol_layer.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_zoom_symbol_layer.xml @@ -5,7 +5,7 @@ android:layout_height="match_parent" android:orientation="vertical"> - - + maplibre:maplibre_cameraTargetLat="47.6077" + maplibre:maplibre_cameraTargetLng="-122.3421" + maplibre:maplibre_cameraZoom="11"/> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_double_map.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_double_map.xml index 28ddaba47..b841b4b44 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_double_map.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/fragment_double_map.xml @@ -13,7 +13,7 @@ android:layout_marginRight="5dp" android:layout_marginTop="5dp"> - - - - @@ -11,5 +11,5 @@ android:paddingBottom="4dp" android:paddingTop="4dp"/> - + diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_data_driven_style.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_data_driven_style.xml index a596ff570..b456f6f7c 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_data_driven_style.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_data_driven_style.xml @@ -1,50 +1,50 @@ + xmlns:maplibre="http://schemas.android.com/apk/res-auto"> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> + maplibre:showAsAction="never"/> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_padding.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_padding.xml index f0197a971..1238bf510 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_padding.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_padding.xml @@ -1,8 +1,8 @@ + xmlns:maplibre="http://schemas.android.com/apk/res-auto"> + maplibre:showAsAction="never" /> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polygon.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polygon.xml index f2cd9aedb..6c4bcdcb3 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polygon.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polygon.xml @@ -1,24 +1,24 @@ + xmlns:maplibre="http://schemas.android.com/apk/res-auto"> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polyline.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polyline.xml index 8549d6604..59fb5e869 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polyline.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_polyline.xml @@ -1,25 +1,25 @@ + xmlns:maplibre="http://schemas.android.com/apk/res-auto"> + maplibre:showAsAction="ifRoom" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_runtime_style.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_runtime_style.xml index 6a21f640c..edbd540d5 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_runtime_style.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_runtime_style.xml @@ -1,82 +1,82 @@ + xmlns:maplibre="http://schemas.android.com/apk/res-auto"> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_zoom.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_zoom.xml index 67c0b2df5..18254befb 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_zoom.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_zoom.xml @@ -1,25 +1,25 @@ + xmlns:maplibre="http://schemas.android.com/apk/res-auto"> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> + maplibre:showAsAction="never" /> diff --git a/platform/android/TESTS.md b/platform/android/TESTS.md index f0bdeb2dc..1f485be02 100644 --- a/platform/android/TESTS.md +++ b/platform/android/TESTS.md @@ -64,12 +64,12 @@ Then: * Go to your AWS Console and choose Device Farm. * Create a new project, e.g. `MapboxGLAndroidSDKTestApp` * On step 1, upload the APK in `mapbox-gl-native/android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug-unaligned.apk` -* On step 2, choose Instrumentation, test filter is `com.mapbox.mapboxgl.testapp.MainActivityTest` and upload the APK in `mapbox-gl-native/android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug-androidTest-unaligned.apk` +* On step 2, choose Instrumentation, test filter is `org.maplibre.android.testapp.MainActivityTest` and upload the APK in `mapbox-gl-native/android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug-androidTest-unaligned.apk` * On step 3, choose a device pool. E.g. Top Devices * On step 4, customize your device state (if needed) * Finally, confirm the configuration and run the tests. -On Step 2, you can also separate by commas different classes: `com.mapbox.mapboxgl.testapp.MainActivityTest,com.mapbox.mapboxgl.testapp.MainActivityScreenTest` +On Step 2, you can also separate by commas different classes: `org.maplibre.android.testapp.MainActivityTest,org.maplibre.android.testapp.MainActivityScreenTest` If you have no tests for your app, or want to test some random user behavior, you can just choose "Built-in: Fuzz" in step 2. @@ -106,7 +106,7 @@ To exercise Monkey on the test app, install the package on the device (e.g. via and then: ``` -$ adb shell monkey -p com.mapbox.mapboxgl.testapp -v 500 +$ adb shell monkey -p org.maplibre.testapp -v 500 ``` diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js index 63b2bb1bc..37c0f2160 100755 --- a/platform/android/scripts/generate-style-code.js +++ b/platform/android/scripts/generate-style-code.js @@ -403,21 +403,21 @@ global.supportsPropertyFunction = function (property) { // Template processing // // Java + JNI Light (Peer model) -const lightJava = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs', 'utf8'), {strict: true}); -const lightJavaUnitTests = ejs.compile(fs.readFileSync('MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/light.junit.ejs', 'utf8'), {strict: true}); -writeIfModified(`MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java`, lightJava({properties: lightProperties})); -writeIfModified(`MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LightTest.java`, lightJavaUnitTests({properties: lightProperties})); +const lightJava = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/light.java.ejs', 'utf8'), {strict: true}); +const lightJavaUnitTests = ejs.compile(fs.readFileSync('MapboxGLAndroidSDKTestApp/src/androidTest/java/org/maplibre/android/testapp/style/light.junit.ejs', 'utf8'), {strict: true}); +writeIfModified(`MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/light/Light.java`, lightJava({properties: lightProperties})); +writeIfModified(`MapboxGLAndroidSDKTestApp/src/androidTest/java/org/maplibre/android/testapp/style/LightTest.java`, lightJavaUnitTests({properties: lightProperties})); // Java -const layerJava = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs', 'utf8'), {strict: true}); -const layerJavaUnitTests = ejs.compile(fs.readFileSync('MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/layer.junit.ejs', 'utf8'), {strict: true}); +const layerJava = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/layer.java.ejs', 'utf8'), {strict: true}); +const layerJavaUnitTests = ejs.compile(fs.readFileSync('MapboxGLAndroidSDKTestApp/src/androidTest/java/org/maplibre/android/testapp/style/layer.junit.ejs', 'utf8'), {strict: true}); for (const layer of layers) { - var srcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/' - var testDir = 'MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/' + var srcDir = 'MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/' + var testDir = 'MapboxGLAndroidSDKTestApp/src/androidTest/java/org/maplibre/android/testapp/style/' if (layer.type === 'location-indicator') { - srcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/' - testDir = 'MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/' + srcDir = 'MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/' + testDir = 'MapboxGLAndroidSDKTestApp/src/androidTest/java/org/maplibre/android/location/' } writeIfModified(srcDir + `${camelize(layer.type)}Layer.java`, layerJava(layer)); @@ -436,23 +436,23 @@ for (const layer of layers) { } // Java PropertyFactory -const propertyFactoryTemplate = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs', 'utf8'), {strict: true}); +const propertyFactoryTemplate = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property_factory.java.ejs', 'utf8'), {strict: true}); -var propertyFactorySrcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/PropertyFactory.java' +var propertyFactorySrcDir = 'MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/PropertyFactory.java' writeIfModified( propertyFactorySrcDir, propertyFactoryTemplate({layoutProperties: layoutProperties, paintProperties: paintProperties, locationIndicator: false}) ); -var locationPropertyFactorySrcDir = 'MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationPropertyFactory.java' +var locationPropertyFactorySrcDir = 'MapboxGLAndroidSDK/src/main/java/org/maplibre/android/location/LocationPropertyFactory.java' writeIfModified( locationPropertyFactorySrcDir, propertyFactoryTemplate({layoutProperties: locationLayoutProperties, paintProperties: locationPaintProperties, locationIndicator: true}) ); // Java Property -const enumPropertyJavaTemplate = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property.java.ejs', 'utf8'), {strict: true}); +const enumPropertyJavaTemplate = ejs.compile(fs.readFileSync('MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/property.java.ejs', 'utf8'), {strict: true}); writeIfModified( - `MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java`, + `MapboxGLAndroidSDK/src/main/java/org/maplibre/android/style/layers/Property.java`, enumPropertyJavaTemplate({properties: enumProperties}) ); diff --git a/platform/android/src/example_custom_layer.cpp b/platform/android/src/example_custom_layer.cpp index 621a17708..a5578f8b6 100644 --- a/platform/android/src/example_custom_layer.cpp +++ b/platform/android/src/example_custom_layer.cpp @@ -227,7 +227,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { JNIEnv *env = nullptr; vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6); - jclass customLayerClass = env->FindClass("com/mapbox/mapboxsdk/testapp/model/customlayer/ExampleCustomLayer"); + jclass customLayerClass = env->FindClass("org/maplibre/android/testapp/model/customlayer/ExampleCustomLayer"); JNINativeMethod methods[] = {{"createContext", "()J", reinterpret_cast(&nativeCreateContext)}, {"setColor", "(FFFF)V", reinterpret_cast(&nativeSetColor)}};