Show user location independently of GeolocateControl
#2960
Replies: 9 comments 1 reply
-
I'm not sure I understand the requirement here. |
Beta Was this translation helpful? Give feedback.
-
In order to do so I would like to reuse the location indicator that shows the user location on the map, otherwise we have to build that again by ourselves. |
Beta Was this translation helpful? Give feedback.
-
I would recommend looking at the code here and understanding how it works and tweak it as you need. Since I can't understand the requirements here in order to actually define a behavior that is missing... |
Beta Was this translation helpful? Give feedback.
-
@HarelM I'm working together with @JulianBissekkou. We already have a location stream that changes whenever the position of the user has changed.
|
Beta Was this translation helpful? Give feedback.
-
As stated before, I don't understand the requirements to the location control. |
Beta Was this translation helpful? Give feedback.
-
I guess the thing is that it would be nice to be able to handle the location fetching part ourselves; so we could plug our own location data into GeolocationControl to use its functionality/styling. As right now we need to either build/copy the entire functionality/styling ourselves; or use parts and copy for example the styling into our own setup. |
Beta Was this translation helpful? Give feedback.
-
Yea, I don't see this as a general request that other can actually use. |
Beta Was this translation helpful? Give feedback.
-
if i interpreted OP correctly, i think what they meant was: being able to show the user location (and the marker on the map), independent of having to use or show as it is right now:
the feature request seems to be:
i myself was confused, that this is not described in the docs and when searching user location only this shows up: https://maplibre.org/maplibre-gl-js/docs/examples/locate-user/ which links tracking a users location to the ui control element 🤔 |
Beta Was this translation helpful? Give feedback.
-
I'm conversing this into a discussion as I don't see a real value in keeping this issue open. |
Beta Was this translation helpful? Give feedback.
-
User Story
As an developer I would like to integrate the mapbox location easier into the location business logic of my product by updating the location indicator independently from the
GeolocationControl
Rationale
Its a common use case for apps to load the location of the user independently from the map to do other business logic with it. If you decide to give the user more context you can show a map but this is not required.
For example we might have a location aware search that filters nearby shops based on the distance to the user. The user can search and find places, but we only want to show the map with the users location when the user presses the option "show on map".
It woud be nice to give the map the location that we fetched previously and show it on the map without interacting with the
GeolocationControl
.Right now the UX is very poor because we have to open the map and wait for the
GeolocationControl
to fetch the location again.Afaik there is not workaround for this. All location updates need to be performed by
GeolocationControl
.Beta Was this translation helpful? Give feedback.
All reactions