Giter Club home page Giter Club logo

mapbox-maps-android's Introduction

Mapbox Maps SDK for Android

CLA assistant

The Mapbox Maps SDK for Android is a public library for displaying interactive, thoroughly customizable maps in native Android. It takes map styles that conform to the Mapbox Style Specification, applies them to vector tiles that conform to the Mapbox Vector Tile Specification, and renders them using OpenGL.

Getting Started

This README is intended for developers who are interested in contributing to the Mapbox Maps SDK for Android. Please visit https://docs.mapbox.com/android/beta/maps/guides/ for general information and instructions on using the Maps SDK in your Android application.

Developing

If you are interested in contributing to the Maps SDK, please see the DEVELOPING.md file for information on setting up, running and building the SDK.

Migrating from previous versions

To ensure a smooth transition for developers upgrading from previous versions of the Mapbox SDK, we've prepared comprehensive migration guides. If you're upgrading from version 10 to 11, please refer to our v11 migration guide for detailed instructions. For those moving from version 9 to 10, the v10 migration guide is available to facilitate your upgrade process.

Reporting issues / Need help?

Report a bug ๐Ÿชฒ

Please use our bug template to report any issues.

Request a new feature or enhancement ๐Ÿ

Please use our feature template to request new features or enhancements.

Other questions

If you have any questions about how to use the SDK or if you need help with specific features, you can reach out to our support team via our website or connect with our developer community by joining our Discord channel. We kindly ask you to avoid using the issue tracker in this repository for questions and instead use our support channels.

Historical Note

This repository is a continuation of the Mapbox Maps SDK for Android available at mapbox/mapbox-gl-native-android.

mapbox-maps-android's People

Contributors

aleksproger avatar anderco avatar ank27 avatar axti avatar baleboy avatar brunoabinader avatar daniel-j-h avatar dorkmatter avatar evil159 avatar flasher297 avatar jush avatar kiryldz avatar kmadsen avatar lukaspaczos avatar macdrevx avatar mapbox-github-ci-writer-1[bot] avatar mapbox-github-ci-writer-2[bot] avatar mapbox-github-ci-writer-3[bot] avatar mapbox-github-ci-writer-4[bot] avatar mapbox-github-ci-writer-5[bot] avatar mapbox-github-ci-writer-public-1[bot] avatar natiginfo avatar paulrenn67 avatar pengdev avatar pjleonard37 avatar sevazhukov avatar tobrun avatar yunikkk avatar zeac avatar zizasaurus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapbox-maps-android's Issues

Prepare example of creating MapView programatically

New Feature

New example should provide clear instructions of creating MapView programmatically and include:

  • providing custom token for given MapView
  • setting initial camera position
  • setting some custom map options (constrain mode, glyphs etc).

Revisit MapboxMap plugin extension functions

Environment

  • Android OS version: any
  • Devices affected: any
  • Maps SDK Version: v10.0.0-beta.12

Tailwork for #63
We need to revisit approach in general of using some plugin functionality as extension functions for MapboxMap.

Current examples are plugin-animation, plugin-gestures that expose some of their functions as extension functions (e.g. MapboxMap.flyTo, MapboxMap.setGesturesManager).

Camera plugin was fixed in #63 but still we're using weak references stored in static HashMap which is obviously not perfect. Gestures plugin will work incorrectly now if using several MapboxMap instances.

Aim of this task is to introduce complete new approach to connect plugins with MapboxMap and make it easy to add extension functions that will work properly in case of several MapboxMap objects.

FillExtrusionLayer is inside out

Environment

  • Maps SDK Version: 10.0.0-beta.13

Observed behavior and steps to reproduce

style.addLayerAbove(layer, "building-outline") style.addLayer(layer)
Screen Shot 2021-03-02 at 10 47 55 AM Screen Shot 2021-03-02 at 8 45 09 AM

Expected behavior

It may be my own confusion, but why does the layer you render relative to another layer affect the shape? I would expect the layer to only be a "draw order".

Here's the draft where I'm reproducing mapbox/mapbox-navigation-android#4078

Refactor Event API into new Observers

Upstream we have been refactoring the event API through the Observable interface to make the event system untyped. This will allow us long term to be more reactive to changes by expoing experimental events while not being tied down by semver. We do still need to refactor the code to remove the old system and put in place a replacement.

For now, we will wrap the untyped system with the existing callbacks but there will be cases we're will replace specific implementations (Eg. decoupling MapChangeListener into specific interfaces), This will lead to some breaking changes.

MapView#snapshot(callback) returns a black bitmap

On some occasions, when MapView#snapshot(callback) is called, the returned snapshot is just an opaque black bitmap with no map contents. I don't have a reliable reproducible case, but it's not rare. Calling MapView#snapshot(callback) twice on the same map instance returns a black bitmap for the first call and correct capture for the second call, no specific rule here.

v10 zoom and rotation do not use correct axis

Environment

  • Android OS version: 9
  • Devices affected: replicated on Lenovo TB-8505FS
  • Maps SDK Version: v10 beta 12

Observed behavior and steps to reproduce

Same issue as reported for iOS in mapbox/mapbox-maps-ios#65 with exception of fact that panning works while two-finger gesture is in progress, which is not true on iOS.

Expected behavior

pinch to zoom and rotate center on the gesture rather than center of the map

Make ModelSource and ModelLayer API more fluent

ModelSource and ModelLayer APIs currently take in list of doubles, this makes integration for developers hard as they aren't aware what these values mean on initial sight and need to start digging through documentation to figure this out. This issue tracks adding object abstractions to make the APIs more fluent (eg. Orientation.kt which represents the orientation of a 3D model).

CameraAnimationsPluginImpl deadlock

Maps SDK: 10.0.0-beta.13.

I can't reproduce the issue but I run into a situation where an animator was added to runningAnimatorsQueue and was never cleared. This led to the camera's complete deadlock because the plugin animates on the first animator's ticks:

val firstAnimator = if (runningAnimatorsQueue.iterator().hasNext()) {
runningAnimatorsQueue.iterator().next()
} else {
null
}
val cameraOptions = when {
// if no running animators in queue - get current map camera
firstAnimator == null -> {
mapCameraDelegate.getCameraOptions()
}
// if update is triggered for first (oldest) animator - build options and jump
it == firstAnimator -> {
cameraOptionsBuilder.build()
}
// do not perform jump if update is triggered for not first (oldest) animator
else -> {
null
}
}
// TODO revisit after https://github.com/mapbox/mapbox-maps-android/issues/119
if (animator.type == CameraAnimatorType.ANCHOR) {
anchor = it.animatedValue as ScreenCoordinate
}
cameraOptions?.let { camera ->
camera.anchor = anchor
// move map camera
performMapJump(camera)
// reset values
cameraOptionsBuilder = CameraOptions.Builder()
}
// set current animator value
updateCameraValue(animator)

and since the first animator wasn't running (I was able to plug in a debugger and check, firstAnimator.isRunning and firstAnimator.isStarted were returning false as well), we had no camera updates being dispatched.

From the user's perspective, there was no other way to recover from this deadlock besides restarting the activity (recreating the map).

/cc @mapbox/maps-android

Cannot use LocationTrackingActivity

https://github.com/mapbox/mapbox-maps-android/blob/main/app/src/main/java/com/mapbox/maps/testapp/examples/LocationTrackingActivity.kt

private fun initLocationComponent(style: Style) {
    val locationPluginImpl = mapView.getLocationPlugin()
    locationPluginImpl.activateLocationComponent(
      LocationComponentActivationOptions
        .builder(this, style)
        .useDefaultLocationEngine(true)
        .locationEngineRequest(
          LocationEngineRequest.Builder(750)
            .setFastestInterval(750)
            .setPriority(LocationEngineRequest.PRIORITY_HIGH_ACCURACY)
            .build()
        )
        .build()
    )
    locationPluginImpl.addOnCameraTrackingChangedListener(this)
    locationPluginImpl.cameraMode = CameraMode.TRACKING_GPS // CameraMode.TRACKING_GPS_NORTH
    locationPluginImpl.renderMode = RenderMode.GPS
    locationPluginImpl.enabled = true
  }

Configuration to disable all gestures

While we expose granular control over enabled/disabling gestures. We don't expose a main kill switch to disable them all.
Above matches the following sequence:

    val gesturesPlugin = mapView.getGesturesPlugin()
    gesturesPlugin.pitchEnabled = false
    gesturesPlugin.rotateEnabled = false
    gesturesPlugin.zoomEnabled = false
    gesturesPlugin.scrollEnabled = false
    // since this issue was created we have a couple more enabled properties   
    // and renamed a couple properties as well
  • tests
  • add API
  • add integration example in gestures activity
  • serialisation spec? -> needs discussion, maybe just as extension function
  • validate naming from OP with current state

Camera animations plugin doesn't work properly with multiple mapView instances.

Environment

  • Android OS version: 10
  • Devices affected: OnePlus 7 Pro
  • Maps SDK Version: v10.0.0-beta.12

Observed behavior and steps to reproduce

When the application uses multiple MapViews, the high level animation APIs like easeTo, flyTo,pitchBy etc. will not work properly for all the MapViews. These camera animations will only be applied to the last created MapView.

Expected behavior

The high level animation APIs should work property for every MapView created in the application.

Notes / preliminary analysis

Currently in the camera animation plugin, the high level animation APIs, such as easeTo, flyTo,pitchBy etc, are extension functions of the MapboxMap, but they are not bound to the specific MapboxMap instance. These extension functions use the WeakReference of the animations plugin inside the CameraAnimationsPluginImpl's companion object. As a result, animation plugin created together with the new MapView will override the old weak reference.

Additional links and references

Give us an option to disable logging

Example code:

fun StyleManagerInterface.getLayer(layerId: String): Layer? {
  val expected = this.getStyleLayerProperties(layerId)
  expected.value?.let { value ->
    @Suppress("UNCHECKED_CAST")
    val map = value.contents as HashMap<String, Value>
    val source = map["source"]?.contents?.let { it as String }
    val type = map["type"]?.contents?.let { it as String }
    return when (type) {
      "background" -> BackgroundLayer(layerId).also { it.delegate = this }
      "circle" -> CircleLayer(layerId, source!!).also { it.delegate = this }
      "fill-extrusion" -> FillExtrusionLayer(layerId, source!!).also { it.delegate = this }
      "fill" -> FillLayer(layerId, source!!).also { it.delegate = this }
      "heatmap" -> HeatmapLayer(layerId, source!!).also { it.delegate = this }
      "hillshade" -> HillshadeLayer(layerId, source!!).also { it.delegate = this }
      "line" -> LineLayer(layerId, source!!).also { it.delegate = this }
      "raster" -> RasterLayer(layerId, source!!).also { it.delegate = this }
      "symbol" -> SymbolLayer(layerId, source!!).also { it.delegate = this }
      "location-indicator" -> LocationIndicatorLayer(layerId).also { it.delegate = this }
      "model" -> ModelLayer(layerId, source!!).also { it.delegate = this }
      "sky" -> SkyLayer(layerId).also { it.delegate = this }
      else -> {
        Logger.e("StyleLayerPlugin", "Layer type: $type unknown.")
        null
      }
    }
  }
  expected.error?.let {
    Logger.e("StyleLayerPlugin", "Get layer $layerId failed: $it")
  }
  return null
}

I do not need to know when a layer does not exist. Also for getSource. There is no logging in v9.

Incompatible with Android 11 and Target SDK 30

With target SDK set to 30 and running on an Android 11 device, we are running into an OkHttp issue:

   Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 30
        at f.n0.m.a.u(:238)
        at f.n0.m.e.i(:202)
        at f.n0.m.e.<clinit>(:79)
        at f.n0.m.e.j(:85) 
        at f.e0.B(:263) 
        at f.e0.<init>(:229) 
        at f.e0$b.b(:1015) 
        at com.mapbox.common.module.okhttp.MapboxOkHttpService.<init>(:57) 
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
        at com.mapbox.common.module.provider.MapboxModuleProvider$noArgConstructorCreator$1.getInstance(:108) 
        at com.mapbox.common.module.provider.MapboxModuleProvider.createModule(:69) 
        at com.mapbox.common.core.module.CommonSingletonModuleProvider$httpServiceInstance$2.invoke(:19) 
        at com.mapbox.common.core.module.CommonSingletonModuleProvider$httpServiceInstance$2.invoke(:14) 
        at e.l.getValue(:74) 
        at com.mapbox.common.core.module.CommonSingletonModuleProvider.getHttpServiceInstance(Unknown Source:7) 
        at com.mapbox.common.MapboxSDKCommonInitializer.loadHttpClient(:13) 
        at com.mapbox.common.MapboxSDKCommonInitializer.create(:36) 
        at com.mapbox.common.MapboxSDKCommonInitializer.create(:9) 
        at androidx.startup.a.b(:155) 
        at androidx.startup.a.a(:198) 
        at androidx.startup.InitializationProvider.onCreate(:42) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:2451) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:2421) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:7509) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:7032) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6921) 
        at android.app.ActivityThread.access$1600(ActivityThread.java:269) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2045) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:233) 
        at android.app.ActivityThread.main(ActivityThread.java:7959) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978) 

This issue stems from OkHttp because as are still using a 3.12.x version of the library to be able to support minSDK version of 19. To be investigated if this can be fixed from our end or if we are required to update to a minimum version of OkHttp 4.x and minSDK of 21.

Hiding logo, attribution or scale bar not working

Environment

  • Android OS version: 11
  • Devices affected: Pixel 5
  • Maps SDK Version: SDK main branch 1st of March

Observed behavior and steps to reproduce

Inset map sample in the sample app tries to hide logo, attribution, scalebar, and compass in onCreate


        insetMapFragment.getMapView()?.apply {
          getLogoPlugin().enabled = false
          getScaleBarPlugin().enabled = false
          getAttributionPlugin().enabled = false
          getCompassPlugin().enabled = false

          getGesturesPlugin().updateSettings {
            scrollEnabled = false
            zoomEnabled = false
          }
        }

but running that sample shows that only the compass is hidden.

After modifying the activity_inset_map.xml to disable them in the XML

    <com.mapbox.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        mapbox:mapbox_cameraTargetLat="11.302318"
        mapbox:mapbox_cameraTargetLng="106.025839"
        mapbox:mapbox_scaleBarEnabled = "false"
        mapbox:mapbox_logoEnabled = "false"
        mapbox:mapbox_attributionEnabled = "false"
        mapbox:mapbox_cameraZoom="5.11" />

the scale bar and attribution are hidden, but the logo is still visible

Expected behavior

In both scenarios all 3 should be hidden.

Notes / preliminary analysis

Additional links and references

Use pixelRatio from MapboxMapOptions when addImage to the style.

Environment

  • Android OS version:
  • Devices affected:
  • Maps SDK Version: v10.0.0-beta.15

Observed behavior and steps to reproduce

Currently the following extension functions:
StyleManagerInterface.addImage(image: StyleContract.StyleImageExtension) and StyleManagerInterface.addStyleImage(imageId: String, bitmap: Bitmap)
are using the density of the primary display as the scale by default, which will result in the unexpected image scaling issues on the secondary display(if the density is different from the primary display).

Further, since the LocationComponentPlugin is using the StyleManagerInterface.addStyleImage(imageId: String, bitmap: Bitmap) API as well, the location puck's size is also affected.

Expected behavior

Instead of using the density of the primary display as the pixel ratio when adding image to the map, we should respect the specified pixel ratio when the MapView is initialised, since we do provide the interface to overwrite the default pixel ratio during the MapView's initialisation.

Notes / preliminary analysis

The APIs exposed directly under Style class like Style#addImage(imageId: String, bitmap: Bitmap) are already using the given pixel ratio, which is the desired behaviour, the issue only exists on the above two mentioned extension functions. We need to fix these APIs to be consistent with each other.

Additional links and references

When creating an Expression Stop small numbers are converted to scientific notation.

Environment

  • Android OS version:
  • Devices affected:
  • Maps SDK Version: 10.0.0-beta.13

Observed behavior and steps to reproduce

With in the Nav. SDK we have a feature that calculates the percentage of a route that has been traveled and create a gradient line to indicate the route traveled has one color and the route yet to travel has a different color.

The value for the percentage traveled can be a very small number. A customer reported a crash that occurred when two of the values used for the Expression.Stop were converted to scientific notation. It appears values smaller than 0.001 will get converted to scientific notation rather than the literal decimal number.

Expected behavior

I put in a fix on the Nav. SDK side to filter out values below 0.001 but perhaps there's something that can be done on the Maps SDK side to address this as well.

Notes / preliminary analysis

From the customer's stack trace:
03-01 17:17:32.563 9369 9369 E AndroidRuntime: java.lang.RuntimeException: Set layer property "line-gradient" failed:
03-01 17:17:32.563 9369 9369 E AndroidRuntime: [743]: Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.
03-01 17:17:32.563 9369 9369 E AndroidRuntime: [step, [line-progress], [rgba, 0.0, 0.0, 0.0, 0.0], 0.0, [rgba, 86.0, 168.0, 251.0, 1.0], 7.875125394489743E-4, [rgba, 255.0, 149.0, 0.0, 1.0], 9.88627405946961E-4, [rgba, 86.0, 168.0, 251.0, 1.0], 0.0011926985676139702, [rgba, 255.0, 149.0, 0.0, 1.0], 0.0013977277614471628, ...

Here's some code to produce this similar to what's being done in the Nav. SDK:

        val expressionBuilder = Expression.ExpressionBuilder("step")
        expressionBuilder.lineProgress()
        expressionBuilder.stop {
            rgba {
                literal(0.0)
                literal(0.0)
                literal(0.0)
                literal(0.0)
            }
        }

        expressionBuilder.stop {
            literal(0.0007875125394489743)
            color(0)
        }
        expressionBuilder.stop {
            literal(0.000988627405946961)
            color(0)
        }
        expressionBuilder.stop {
            literal(0.001)
            color(0)
        }
        expressionBuilder.stop {
            literal(0.0011926985676139702)
            color(0)
        }
        expressionBuilder.stop {
            literal(0.0013977277614471628)
            color(0)
        }

        
    expressionBuilder.build().toString()
    //[step, [line-progress], [rgba, 0.0, 0.0, 0.0, 0.0], 7.875125394489743E-4, [rgba, 0.0, 0.0, 0.0, 0.0], 9.88627405946961E-4, 
    //[rgba, 0.0, 0.0, 0.0, 0.0], 0.001, [rgba, 0.0, 0.0, 0.0, 0.0], 0.0011926985676139702, [rgba, 0.0, 0.0, 0.0, 0.0], 
    //0.0013977277614471628, [rgba, 0.0, 0.0, 0.0, 0.0]]

Additional links and references

Revisit gesture event result handling

We currently have an API that uses a boolean flag to indicate if a event should be continued to be handled down the chain or if we should break the chain and flag the event as handled (returning true). This was working well for our previous implementation of the SDK as feature querying was implemented synchronously. Now with the addition of asynchronous querying. This becomes a clunky as we need to provide feedback to the system that the event was handled eventhough we don't actually know.

For example:


        mapView.getGesturesPlugin().addOnMapClickListener { point ->
          mapView.getLocationComponentPlugin()
            .isPointOnLocationPuck(point) { isPointOnLocationPuck ->
              if (isPointOnLocationPuck) {
                Toast.makeText(this, "Clicked on location puck", Toast.LENGTH_SHORT).show()
              }
            }
          true
        }

MapboxOptions singleton across multiple map instances

Environment

  • Maps SDK Version: v10.0.0-beta.13

Observed behavior and steps to reproduce

Inflate a MapView that defines some attributes via XML.

Inflate another MapView instance in the same app process with different XML attributes.

The second map instance will use the options of the first map instance.

Expected behavior

Both map instances have different options as defined in the XMLs.

Notes / preliminary analysis

I haven't thoroughly tested this but looking at the code:

internalResourceOptions = if (MapboxOptions.isInitialized()) {
MapboxOptions.getDefaultResourceOptions(context)
} else {
ResourcesAttributeParser.parseResourcesOptions(context, typedArray)
}

MapboxOptions.isInitialized() will return true for the second map instance, so it will inherit the options from the first instance.

/cc @mapbox/maps-android

dependencies for configuration

  • What went wrong:
    Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.

Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
Could not resolve com.mapbox.common:okhttp:10.0.0-beta.8.
Required by:
project :app > project :sdk
> Could not resolve com.mapbox.common:okhttp:10.0.0-beta.8.
> Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/common/okhttp/10.0.0-beta.8/okhttp-10.0.0-beta.8.pom'.
> Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/common/okhttp/10.0.0-beta.8/okhttp-10.0.0-beta.8.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.mapbox.common:okhttp:10.0.0-beta.8.
> Could not get resource 'https://oss.jfrog.org/artifactory/oss-snapshot-local/com/mapbox/common/okhttp/10.0.0-beta.8/okhttp-10.0.0-beta.8.pom'.
> Could not GET 'https://oss.jfrog.org/artifactory/oss-snapshot-local/com/mapbox/common/okhttp/10.0.0-beta.8/okhttp-10.0.0-beta.8.pom'. Received status code 409 from server:
Could not resolve com.mapbox.maps:android-core:10.0.0-beta.13.
Required by:
project :app > project :sdk > project :sdk-base
> Could not resolve com.mapbox.maps:android-core:10.0.0-beta.13.
> Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android-core/10.0.0-beta.13/android-core-10.0.0-beta.13.pom'.
> Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/maps/android-core/10.0.0-beta.13/android-core-10.0.0-beta.13.pom'. Received status code 403 from server: Forbidden

Crash in LocationComponentActivity

Environment

  • Android OS version: Android 10
  • Devices affected: Xiaomi Mi 9
  • Maps SDK Version: v10.0.0-beta.12

Observed behavior and steps to reproduce

  1. Run LocationComponentActivity
  2. Disable component.
  3. Minimize app.
  4. Restore app.
  5. Toggle customized puck style.
  6. Enable component.

Crash appears:

2021-02-02 14:11:40.630 1902-1902/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mapbox.maps.testapp, PID: 1902
    java.lang.RuntimeException: Set layer property "shadow-image-size" failed:
    [4]: Expected number but found array<number, 3> instead.
    [interpolate, [exponential, 0.5], [zoom], 0.5545888516776374, [literal, [285569.6382978727, 285569.6382978727, 285569.6382978727]], 22.0, [literal, [0.10000000149011612, 0.10000000149011612, 0.10000000149011612]]]
        at com.mapbox.maps.plugin.locationcomponent.LocationLayerWrapper.updateProperty(LocationLayerWrapper.kt:27)
        at com.mapbox.maps.plugin.locationcomponent.LocationIndicatorLayerWrapper.shadowImageSize(LocationIndicatorLayerWrapper.kt:30)
        at com.mapbox.maps.plugin.locationcomponent.LocationIndicatorLayerRenderer.styleScaling(LocationIndicatorLayerRenderer.kt:72)
        at com.mapbox.maps.plugin.locationcomponent.LocationPuckManager.styleScaling$plugin_locationcomponent_debug(LocationPuckManager.kt:188)
        at com.mapbox.maps.plugin.locationcomponent.LocationPuckManager.initialize(LocationPuckManager.kt:50)
        at com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl$activateLocationComponent$1.invoke(LocationComponentPluginImpl.kt:151)
        at com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl$activateLocationComponent$1.invoke(LocationComponentPluginImpl.kt:21)
        at com.mapbox.maps.plugin.MapDelegateProviderImpl$getStyle$1.onStyleLoaded(MapDelegateProviderImpl.kt:20)
        at com.mapbox.maps.MapboxMap.getStyle(MapboxMap.kt:214)
        at com.mapbox.maps.plugin.MapDelegateProviderImpl.getStyle(MapDelegateProviderImpl.kt:20)
        at com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl.activateLocationComponent(LocationComponentPluginImpl.kt:132)
        at com.mapbox.maps.plugin.locationcomponent.LocationComponentPluginImpl.applySettings(LocationComponentPluginImpl.kt:249)
        at com.mapbox.maps.plugin.locationcomponent.generated.LocationComponentSettingsBase.setEnabled(LocationComponentSettingsBase.kt:51)
        at com.mapbox.maps.testapp.examples.LocationComponentActivity.onOptionsItemSelected(LocationComponentActivity.kt:64)
        at android.app.Activity.onMenuItemSelected(Activity.java:4205)
        at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:384)
        at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:228)
        at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
        at androidx.appcompat.app.AppCompatDelegateImpl.onMenuItemSelected(AppCompatDelegateImpl.java:1176)
        at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:834)
        at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
        at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:985)
        at androidx.appcompat.view.menu.MenuPopup.onItemClick(MenuPopup.java:128)
        at android.widget.AdapterView.performItemClick(AdapterView.java:330)
        at android.widget.AbsListView.performItemClick(AbsListView.java:1224)
        at android.widget.AbsListView$PerformClick.run(AbsListView.java:3235)
        at android.widget.AbsListView$3.run(AbsListView.java:4191)
        at android.os.Handler.handleCallback(Handler.java:914)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:224)
        at android.app.ActivityThread.main(ActivityThread.java:7560)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Expected behavior

No crash.

Notes / preliminary analysis

Additional links and references

java.lang.IndexOutOfBoundsException in test app.

Environment

  • Android OS version: Android 7.1 (API level 25)
  • Devices affected: PH-1
  • Maps SDK Version: v10.0.0-beta.13

Observed behavior and steps to reproduce

Our CI caught the following crash:

java.lang.IndexOutOfBoundsException: Index: 6, Size: 2
     FATAL EXCEPTION: Thread-2
Process: com.mapbox.maps.testapp, PID: 2540
java.lang.IndexOutOfBoundsException: Index: 6, Size: 2
	at java.util.ArrayList.get(ArrayList.java:411)
	at com.mapbox.maps.testapp.ExampleOverviewActivity$onCreate$$inlined$apply$lambda$1.onItemClicked()
	at com.mapbox.maps.testapp.utils.ItemClickSupport$onClickListener$1.onClick()
	at android.view.View.performClick(View.java:5637)
	at android.view.View$PerformClick.run(View.java:22434)
	at android.os.Handler.handleCallback(Handler.java:751)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at androidx.test.espresso.base.Interrogator.a(Interrogator.java:11)
	at androidx.test.espresso.base.UiControllerImpl.n(UiControllerImpl.java:6)
	at androidx.test.espresso.base.UiControllerImpl.m(UiControllerImpl.java:1)
	at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:6)
	at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:15)
	at androidx.test.espresso.action.Tap.b(Tap.java)
	at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:1)
	at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:4)
	at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:4)
	at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java)
	at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	at android.os.Handler.handleCallback(Handler.java:751)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6126)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Expected behavior

No crash.

Notes / preliminary analysis

Additional links and references

Scrolling across IDL when bounds crosses IDL

Given:

    private val CROSS_IDL_BOUNDS: BoundOptions = BoundOptions.Builder()
      .bounds(
        CoordinateBounds(
          Point.fromLngLat(170.0202020, -20.0),
          Point.fromLngLat(190.0, 20.0)
        )
      )
      .minZoom(2.0)
      .build()

and calling Map#setBounds(CROSS_IDL_BOUNDS)

I'm unable to use this bounds correctly, when I pan across IDL. It jumps back.

ezgif com-video-to-gif(13)

The source of the issue stems from the new platform driven camera system.

Symbol#textFont

We got customer feedback about textFonts not working as expected. We are seeing the following log message, even if we aren't using the textFont ourselves:

Layer 'mapbox-android-symbol-layer-1' has an invalid value for text-font and will not render text. Output values must be contained as literals within the expression.

First issue is that we provide a default value, while capturing from the style-spec, this isn't required. By default
it will fallback on a font from the style. We can't make any assumptions on which fonts will be availlable.

  // currently 
  /**
   * Font stack to use for displaying text.
   */
  var textFont: List<String> = listOf("Open Sans Regular", "Arial Unicode MS Regular")

  // excpected
  /**
   * Font stack to use for displaying text.
   */
  var textFont: List<String>? = null

The second issue is that we aren't handling the "null" case correclty. We should be checking if the JsonArray value size is larger as zero before calling into enableDataDrivenProperty.

  // currently 
  if (!(jsonObject.get(SymbolOptions.PROPERTY_TEXT_FONT).isJsonNull)) {
    annotationManager.enableDataDrivenProperty(SymbolOptions.PROPERTY_TEXT_FONT)
  }

  // expected
  if ((jsonObject.get(SymbolOptions.PROPERTY_TEXT_FONT) as JsonArray).size() > 0) {
    annotationManager.enableDataDrivenProperty(SymbolOptions.PROPERTY_TEXT_FONT)
  }

[rendering] Expose function to schedule runnable on GL thread

New Feature

Expose two methods for render thread: queueGlEvent and queueEvent instead of one now.

Why

It may be useful in some cases to split putting some Runnable in GL thread event queue and simply running it and putting that Runnable (most likely with GL commands) to a queue, executing them and performing buffer swap to see result on screen. Current implementation of queueEvent always performs drawing after executing Runnable.

URL Request Transform

New Feature

Looking at the v10 API I cannot find a replacement for the FileSource Resource Transform Callback:
https://docs.mapbox.com/android/maps/api/9.5.0/com/mapbox/mapboxsdk/storage/FileSource.ResourceTransformCallback.html
The Observable plugin might provide this feature but I cannot see a way or example to modify the request.

Why

Other Tile providers such as HERE require custom headers on requests https://developer.here.com/documentation/vector-tiles-api/dev_guide/topics/examples/mapbox.html

It was added to GL JS on numerous requests.
mapbox/mapbox-gl-js#5021

[v10.0.0-beta.15] sample app crashes on an emulator

Environment

  • Android OS version: x86 Emulator, API30
  • Devices affected: Emulator
  • Maps SDK Version: v10.0.0-beta.15

Observed behavior and steps to reproduce

  1. Run sample app
  2. Click one of the example in the list
  3. Crash happens (Crash does not happen on a physical device)

If you select "Annotation Circle", following crash happends.

2021-03-08 21:57:52.083 8052-8052/com.mapbox.maps.testapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mapbox.maps.testapp, PID: 8052
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mapbox.maps.testapp/com.mapbox.maps.testapp.examples.annotation.CircleActivity}: android.view.InflateException: Binary XML file line #6 in com.mapbox.maps.testapp:layout/activity_annotation: Binary XML file line #6 in com.mapbox.maps.testapp:layout/activity_annotation: Error inflating class com.mapbox.maps.MapView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: android.view.InflateException: Binary XML file line #6 in com.mapbox.maps.testapp:layout/activity_annotation: Binary XML file line #6 in com.mapbox.maps.testapp:layout/activity_annotation: Error inflating class com.mapbox.maps.MapView
     Caused by: android.view.InflateException: Binary XML file line #6 in com.mapbox.maps.testapp:layout/activity_annotation: Error inflating class com.mapbox.maps.MapView
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
        at android.view.LayoutInflater.createView(LayoutInflater.java:854)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:656)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
        at com.mapbox.maps.testapp.examples.annotation.CircleActivity.onCreate(CircleActivity.kt:31)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__ashldi3" referenced by "/data/app/com.mapbox.maps.testapp-kgqhTeFScsaz14qhLxtHkw==/lib/x86/libmapbox-maps.so"...
        at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
2021-03-08 21:57:52.083 8052-8052/com.mapbox.maps.testapp E/AndroidRuntime:     at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
        at java.lang.System.loadLibrary(System.java:1667)
        at com.mapbox.common.loader.MapboxLibraryLoader.load(MapboxLibraryLoader.kt:19)
        at com.mapbox.maps.loader.MapboxMapStaticInitializer.loadMapboxMapNativeLib(MapboxMapStaticInitializer.java:12)
        at com.mapbox.maps.MapController.<clinit>(MapController.kt:367)
        at com.mapbox.maps.MapView.<init>(MapView.kt:111)
        at com.mapbox.maps.MapView.<init>(MapView.kt:84)
        at com.mapbox.maps.MapView.<init>(MapView.kt:66)
        at com.mapbox.maps.MapView.<init>(MapView.kt:60)
        	... 27 more
2021-03-08 21:57:52.100 8052-8052/com.mapbox.maps.testapp I/Process: Sending signal. PID: 8052 SIG: 9

Expected behavior

Crash does not happen

Notes / preliminary analysis

Additional links and references

@mapbox/maps-android

`OnCameraChangeListener` is invoked on the render thread

Environment

  • Maps SDK Version: 10.0.0-beta.15

Observed behavior and steps to reproduce

OnCameraChangeListener is called on the MapboxRenderThread.

Expected behavior

OnCameraChangeListener is called on the main thread.

Notes / preliminary analysis

This is a breaking change that was introduced somewhere between beta.13 and beta.15. Is it the desired behavior @mapbox/maps-android? Looks a little bit surprising.

3D terrain crashes on specific GPU hardware

3D terrain, currently an experimental feature, can crash on specific GPU hardware:

  • Adreno 640 GP

There is no error log related to our SDKs - just Adreno driver specific before the crash:

2021-01-27 15:06:27.441 10487-10533/? W/Adreno-GSL: <gsl_ldd_control:549>: ioctl fd 78 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 71 Protocol error
2021-01-27 15:06:27.441 10487-10533/? W/Adreno-GSL: <log_gpu_snapshot:458>: panel.gpuSnapshotPath is not set.not generating user snapshot
2021-01-27 15:06:29.551 10487-10533/? W/Adreno-GSL: <gsl_ldd_control:549>: ioctl fd 78 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 35 Resource deadlock would occur
2021-01-27 15:06:29.551 10487-10533/? W/Adreno-GSL: <log_gpu_snapshot:458>: panel.gpuSnapshotPath is not set.not generating user snapshot
2021-01-27 15:06:29.552 10487-10533/? W/Adreno-GSL: <gsl_ldd_control:549>: ioctl fd 78 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) failed: errno 35 Resource deadlock would occur
2021-01-27 15:06:29.552 10487-10533/? W/Adreno-GSL: <log_gpu_snapshot:458>: panel.gpuSnapshotPath is not set.not generating user snapshot
device-2021-01-25-195104.mp4

Map.jumpTo std::exception

Vague crash caught by crashlytics on 10.0.0-beta.13.
Device: Huawei Mate 20 lite
Android: 10

Fatal Exception: java.lang.Error: std::exception
       at com.mapbox.maps.Map.jumpTo(Map.java)
       at com.mapbox.maps.NativeMapImpl.jumpTo(NativeMapImpl.java:34)
       at com.mapbox.maps.MapboxMap$jumpTo$1.invoke(MapboxMap.java:263)
       at com.mapbox.maps.MapboxMap$jumpTo$1.invoke(MapboxMap.java:32)
       at com.mapbox.maps.UtilsKt.call(UtilsKt.java:9)
       at com.mapbox.maps.MapboxMap.jumpTo(MapboxMap.java:263)
       at com.mapbox.maps.plugin.animation.CameraAnimationsPluginImpl.performMapJump(CameraAnimationsPluginImpl.java:147)
       at com.mapbox.maps.plugin.animation.CameraAnimationsPluginImpl.access$getPitchListeners$p(CameraAnimationsPluginImpl.java:30)
       at com.mapbox.maps.plugin.animation.CameraAnimationsPluginImpl$registerInternalUpdateListener$1.onAnimationUpdate(CameraAnimationsPluginImpl.java:317)
       at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1558)
       at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1349)
       at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1481)
       at android.animation.ValueAnimator.pulseAnimationFrame(ValueAnimator.java:1500)
       at android.animation.AnimatorSet.pulseFrame(AnimatorSet.java:1170)
       at android.animation.AnimatorSet.doAnimationFrame(AnimatorSet.java:1061)
       at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
       at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
       at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1055)
       at android.view.Choreographer.doCallbacks(Choreographer.java:875)
       at android.view.Choreographer.doFrame(Choreographer.java:772)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042)
       at android.os.Handler.handleCallback(Handler.java:888)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:213)
       at android.app.ActivityThread.main(ActivityThread.java:8178)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)

/cc @mapbox/maps-android

Choose to disable logging on StyleManagerInterface.getLayer(layerId: String)

fun StyleManagerInterface.getLayer(layerId: String): Layer? {
  val expected = this.getStyleLayerProperties(layerId)
  expected.value?.let { value ->
    @Suppress("UNCHECKED_CAST")
    val map = value.contents as HashMap<String, Value>
    val source = map["source"]?.contents?.let { it as String }
    val type = map["type"]?.contents?.let { it as String }
    return when (type) {
      "background" -> BackgroundLayer(layerId).also { it.delegate = this }
      "circle" -> CircleLayer(layerId, source!!).also { it.delegate = this }
      "fill-extrusion" -> FillExtrusionLayer(layerId, source!!).also { it.delegate = this }
      "fill" -> FillLayer(layerId, source!!).also { it.delegate = this }
      "heatmap" -> HeatmapLayer(layerId, source!!).also { it.delegate = this }
      "hillshade" -> HillshadeLayer(layerId, source!!).also { it.delegate = this }
      "line" -> LineLayer(layerId, source!!).also { it.delegate = this }
      "raster" -> RasterLayer(layerId, source!!).also { it.delegate = this }
      "symbol" -> SymbolLayer(layerId, source!!).also { it.delegate = this }
      "location-indicator" -> LocationIndicatorLayer(layerId).also { it.delegate = this }
      "model" -> ModelLayer(layerId, source!!).also { it.delegate = this }
      "sky" -> SkyLayer(layerId).also { it.delegate = this }
      else -> {
        Logger.e("StyleLayerPlugin", "Layer type: $type unknown.")
        null
      }
    }
  }
  expected.error?.let {
    Logger.e("StyleLayerPlugin", "Get layer $layerId failed: $it")
  }
  return null
}

I would like to avoid this as I check many layers I do not need this to be logged.

expected.error?.let {
    Logger.e("StyleLayerPlugin", "Get layer $layerId failed: $it")
  }

[help wanted] iconOffset Expression

Hi,
I want to set iconOffset using the expression way, It requires a float array but I don't know how to do it. Searched in demo project but no luck, Could someone help me on this?

Thanks a lot.

MapboxOptions#setDefaultResourceOptions not respected for map inflation

Calling MapboxOptions#setDefaultResourceOptions and afterward inflating the map results in the MapboxMapOptions still recreating the resources from scratch (and for example using token from XML) instead of taking the available default options.

Granted that I can reproduce the issue, but that logic doesn't seem to have fundamentally changed. I think it should rather be something like:

internalResourceOptions = if (MapboxOptions.isInitialized()) {
        MapboxOptions.getDefaultResourceOptions(context)
    } else {
        ResourcesAttributeParser.parseResourcesOptions(context, typedArray)
    }

Gradle build fails with "Duplicate class com.mapbox.mapboxsdk.text.LocalGlyphRasterizer found in modules" when using together with mapbox-android-sdk

Hi,

i want to try out some things from com.mapbox.maps:android:10.0.0-beta.10 but when i try to build my app with gradle, i get conflicts. The reason is that i also have

implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:5.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0'

As dependencies from another module i require (react native module).

The error message is

Duplicate class com.mapbox.mapboxsdk.text.LocalGlyphRasterizer found in modules jetified-android-core-10.0.0-beta.10-runtime.jar (com.mapbox.maps:android-core:10.0.0-beta.10) and jetified-mapbox-android-sdk-9.0.0-runtime.jar (com.mapbox.mapboxsdk:mapbox-android-sdk:9.0.0)

Is there any workaround for this, or am i just unable to use both dependencies in the same app?

I require a react-native package that requires the versions mentioned above, and dont want to change anything there, but i also want to try some native android things in the same app, where i need at least version 10 of com.mapbox.maps:android.

BR
Samuel

[annotation] Reload layer and source in Annotation plugin when style is changed.

Environment

  • Android OS version:
  • Devices affected:
  • Maps SDK Version:

Observed behavior and steps to reproduce

The annotation plugin sometimes doesn't survive the style change event.

Expected behavior

The annotation plugin should persist the added annotations during the style change event.

Notes / preliminary analysis

Currently we are using OnDidFinishRenderingMapListener to trigger the re-add of the sources and layers inside the annotation plugin, but this event sometimes may not be triggered due to resources not being fully loaded, and so that layer and source will not be reloaded.

Instead of OnDidFinishRenderingMapListener, we could add MapStyleObserverPlugin interface to the AnnotationPlugin, and propagate the style changed event to the underlying annotation managers to re-add the layers/sources.

Additional links and references

Use the location component without asking for permissions

I would like to use the location component without asking for permission. As it is possible that one wants to use the component to display a location which has nothing to do with the devices location and where the location is given through a custom location engine or similar where the devices GPS etc. is never used.

I'm quite new to Mapbox, so I'm sorry if one already can do that or my request is not valid because of my ignorance.

Rename getAnnotationManager to createAnnotationManager

Current API naming is a bit confusing. When I read getAnnotationManager, I'm thinking that the API returns me a reference to a predefined manager. Calling it twice, will return the same object. This is however not the case, it's factory method which create a new instance every time. I'm proposing to rename the function to createAnnotationManager instead.

[RFC] updating the minimum SDK version to API 21

This issue tracks the conversation on updating the library minimum SDK version to API 21. The requirement is not something that originates from Mapbox but is being passed down by the OkHttp dependency. We have tried with using the LTS version of OkHttp 3.12.12 but due to the problems laid out below. We feel, we are forced to migrate to OkHttp 4.x which will result in bumping the mininum SDK version of this library to 21.

OkHttp 3.12.x series is compatible with Android 19 (our current min. SDK version), when users use 3.14 of the library, which can come from other transitive dependencies as retrofit. It makes our SDK unusable on API levels lower as 21 without the developer knowing. This is a bad UX and out of our control to fix.

Note that you can force okhttp 3.12.12 in this scenario but this is nothing from the SDK side we can enforce:

configurations.all {
    resolutionStrategy {
        force "com.squareup.okhttp3:okhttp:3.12.12"
    }
}

We are proposing now to update OkHttp to the 4.x series and increasing our minimum SDK version to 21, this not only removes the security concerns from Square but also makes the SDK itself more future proof. SDKs when compared to apps have a longer turn around time to be updated and can stay longer active in production. Considering OkHttp 3.12 is out-of-live at the end of the year. This seems like the appropriate time for us to update.

refs ##55

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.