Map User current location for web app

Please help! I need to show the current location of the user (like the blue dot in G maps) in my web app maps,but i have no idea how.

You need to perform an api call that retrieves the current geographic location of the user

1 Like

I don’t mean to discourage you, but this is a broad question. Many answers are already online or easy to find with a quick search.

The steps will depend on which map service you use, Google Maps or something else. When you get to the specifics, the group is good at helping out.

Here are couple of pages to help you get started:

1 Like

Hi @lester1 . I know those documents and my question is not broad. I want to show the real time location (or almost real time) of a user on a map on a web app. and in fact this documents don’t go into detail. That’s the problem

Thanks mate. Wouldn’t that just kill the API quota if i have many users accessing that feature daily? e.g. going to maps and looking for something near them and literally calling the api every 5 seconds..fore very user?

Sort of needing to call an api to get current location, but not exactly. Bubble has the built in ‘current geographic position’ dynamic expression, nothing else.

One thing to note, users MUST give consent to provide that information to your app, and in the event they do not consent, there is nothing that would alert you necessarily except the fact that 'current geographic position’ will be empty, at which point the best thing you could do is run an api call to get the details from the browser (of which many free plugins already have that functionality) and use the browser details which can be wildly off base due to the very nature of how that works.

Yes, so many different map elements and plugins and different reasons why it is such a headache for the OP, such as is the issue the ‘blue dot’ instead of a traditional icon marker or is it the retrieval of the actual location and why the ‘current geographic position’ is not working.

1 Like

Thanks a lot Matthew. But my challenge is I want to show the user position AND a list of markers (hotels) on the map, at the same time. So in the “number of markers” tab I’ve put a list and in the markers address field, naturally, I’ve put the list of hotels. Think of looking for “hotels near you” on google maps and seeing the blue dot and markers around. That’s what I want to achieve

Feed the map two lists at once using merged with operator. Its lists of address, not things. But that might be difficult depending on map element and requirements for how to populate the map. I personally do not use native map element and have used leafy map plugin mostly.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.