Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Draggable marker example - #12326

Merged
LukasPaczos merged 2 commits into
masterfrom
lp-draggable-marker-activity
Jul 6, 2018
Merged

LukasPaczos merged 2 commits into
masterfrom
lp-draggable-marker-activity

Conversation

@LukasPaczos

Copy link
Copy Markdown
Contributor

Refs #2450.
Adds an example of how to build a class that is responsible for handling dragged symbols and disptaching callbacks with the drag state.

Also, adds Kotlin dependencies to the test app.

ezgif com-video-to-gif 2

@LukasPaczos LukasPaczos added the Android Mapbox Maps SDK for Android label Jul 5, 2018
@LukasPaczos LukasPaczos added this to the android-v6.3.0 milestone Jul 5, 2018
@LukasPaczos
LukasPaczos requested a review from tobrun July 5, 2018 18:47
@LukasPaczos
LukasPaczos force-pushed the lp-draggable-marker-activity branch from 858a11c to 03a9fa3 Compare July 5, 2018 18:50

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more kotlin friendly way to do string formatting?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loving these extension functions!

@tobrun tobrun mentioned this pull request Jul 6, 2018
@LukasPaczos
LukasPaczos force-pushed the lp-draggable-marker-activity branch from 03a9fa3 to d580765 Compare July 6, 2018 09:58
@LukasPaczos
LukasPaczos merged commit 282f89a into master Jul 6, 2018
@LukasPaczos
LukasPaczos deleted the lp-draggable-marker-activity branch July 6, 2018 11:22
@iamanvesh

Copy link
Copy Markdown

I have tried to use DraggableSymbolsManager with my app but there's an issue if we use a style which has some layers already present in it. It was throwing a segmentation fault error if we try to use style with SymbolLayer simultaneously.

// Setting up markers icon, source and layer
mapboxMap.addImage(markerImageId, IconFactory.getInstance(this).defaultMarker().bitmap)
mapboxMap.addSource(source)
mapboxMap.addLayer(layer)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steps to replicate the issue.

  • Use the API key which has a predefined style with some custom layers created using mapbox studio.

  • Apply the style using setStyleUrl()

  • Try to add this layer in onStyleLoaded() callback.

It was throwing a segmentation fault error when I tried this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was caused because I was trying to add the source before the style has loaded. I tried adding source and layer both in onStyleLoaded callback and its working.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad to hear that @iamanvesh! Let us know if you run into any other issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Android Mapbox Maps SDK for Android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants