Comments (5)
The API is currently exposed on MapboxMap and requires providing a Style. I believe it makes more sense moving the API to Style itself as it's a required argument. This would simplify showing a default styled user location on the map as:
new StyleBuilder().withLocationComponent()
// or
style.setLocationComponentEnabled(true)
Options classes can be provided as:
new StyleBuilder().withLocationComponent(LocationComponentOptions... options)
// or
style.setLocationComponentEnabled(true, LocationComponentOptions... options)
from mapbox-gl-native-android.
IMO any object tied to a style should have the lifespan equal to the one of the style in question, this would force users to cache all of the component's current options and re-apply them with each style change, which is now done out-of-the-box becuase the component can survive style changes.
I think that just because an entity needs access to the style object to add sources and layers doesn't mean that it should be managed by the style object itself.
Anyway, let's get this ticket back on track and focus on the rename of the enable/disable
method, any additional thoughts on that @tobrun? I'm going to cut another ticket to capture above comments.
from mapbox-gl-native-android.
Yes, the LocationComponent
's layers/sources are tied to the Style
object, but I like the idea of sticking to the current setup where the LocationComponent
is a separate entity. As @LukasPaczos says, the LocationComponent
is already surviving style changes, which makes it seem and visually behave like it's independent from the visible style. By "visually behave", I mean that when it's enabled and the style is switched, there is lag between the new Style
being visible and the LocationComponent
being visible again. It's not as if the LocationComponent
is loaded exactly at the same time as the rest of the Style
's visual properties. Correct me if I'm wrong, but it's not as if LocationComponent
styling information is in the Style JSON when a Style
object is initially loaded anyways. Anyways, you get my point 👀
Maybe rather than enableLocationComponent()
and disableLocationComponent()
, the methods could be showLocationComponent()
and hideLocationComponent()
? Or maybe displayLocationComponent()
instead of showLocationComponent()
?
enable
and disable
don't make it immediately clear that they adjust the LocationComponent
's actual visibility. enable
and disable
sound more like behind-the-curtain telemetry enabling/disabling of detecting device location, rather than conveying the fact the methods will affect whether or not the device location dot will actually appear on the map.
from mapbox-gl-native-android.
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
from mapbox-gl-native-android.
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
from mapbox-gl-native-android.
Related Issues (20)
- Change MAPBOX_ACCESS_TOKEN on runtime HOT 1
- jcenter sunset - release code to maven HOT 3
- Incorrect TalkBack accessibility feedback when gesture interaction is disabled
- Error when trying to display map
- MapView sometime doesn't load the map `(failed to connect to api.mapbox.com/64:ff9b::6c9d:ba (port 443))` HOT 1
- Location tracking issues Android 12 HOT 1
- Crash when using android.uid.system
- Flutter useHybridComposition cause crash HOT 4
- android 12, APP keep crashing
- Intergrate Android Auto
- Source code for mapbox-android-sdk-gl-core
- Mapbox sometimes crash, android 9
- The animation of the location component has lags when the RenderMode.COMPASS and mapbox_elevation=0dp are set
- Mapbox gets app rejected HOT 1
- Center to user location
- PropertyFactory.lineColor not working HOT 1
- E2E Tests implementation
- SoLoader load 'mapbox-gl' with FileLockInterruptionException
- Unable to generate DOCS using javadoc in android studio HOT 1
- LocationComponent crashing on Android 13 and 12 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapbox-gl-native-android.