APP INVENTOR put markers on the map from the coordinates saved in the firebase

I'm developing a project in inventor app, and I came up with an idea but I'm not sure how to do it, that is every time a coordinate is added to the firebase, the inventor app puts those coordinates in markers on the map, if anyone knows it would help a lot!

Yes, you can make an app like that.

What have you tried? You can search the community for Map CloudDB or Map FirebaseDB for examples.

Here is part of what you want to do How to broadcast a GPS location and share the information on a map with others in real time..CloudDB

and perhaps this Social Distancing ... a CloudDB / Location Marker Tutorial

Is this what you hope to build? A CloudDB works similarly to a FirebaseDB. Substitute the FirebaseDB controls to the above examples and you might have what you want to do.

I have the same need, to locate on the map the coordinates stored in firebase. The examples that I find in the community show how to store them, but not how to locate them again on the map ... can you help us?

What you do to highlight a particular Marker depends on your existing code. I assume you want to be able to highlight an existing Marker.

Traverse your Marker information. Filter it based on the criteria you expect to use to 'locate' or highlight the Marker on your map. You can also hard code the information to highlight a Marker by it's 'name' if you already know which one you want to 'locate on the map'.

Change it's color or center the map on the Marker or Marker.ShowInfoBox etc. using a Button or ListPicker or ListView event handler. This will make it easy for a user to find the highlighted location.

The following two part tutorial contains a examples of several ways to highlight an existing Marker.

1 Like

In the examples I see that they locate points on the map, but I don't see how they retrieve the coordinates from the DB.
I have several markers on the map, which will be located according to the coordinates they receive once I retrieve the coordinates from firebase. But I don't know how to retrieve them from firebase.

Your Tag is Lospajaros which is a List containing email,latitud,longitud and nit

so code like this will extract the entire string, email,latude, longitude and nit into Labels 2,3,4,5,6 .

you need to assign the latitude and longitude to the Marker.

Did the code work. (This will not run in the basic MIT emulator).

1 Like

Hi SteveJG. It worked very well for me. Now I have another question ... I have 2 independent lists, one of birds, another of users, and I want to see the users and the birds on the map at the same time, but when I consult it, it does not correctly locate the birds. Can you guide me, how should I do?


@Gloria_Patricia_Esco

OK. What you can do depends on

  • whether you use run time Markers or design time Markers
  • how you use your Custom Markers
  • whether the user location is the same as the bird location. If the locations are identical (or very close), the icons will over plot each other. A partial solution in that case is offset the plotting of the bird or to not plot the user (you red default icon?) and place the user name in the bird Marker's InfoBox and show Marker.ShowInfoBox . Another is set one of the Markers to offset by using the Marker.AnchorHorizontal and / or Marker.AnchorVertical.
  • if you center your map on the user but don't post his/her location, you might just display the birds posted by that user. Whether you can do this depends on how you set up your database to segregate the birds that belong to each user.
  • your existing code (you did not share it)

The Marker icons center on the bottom of the icon by default. You can change this behavior by
AnchorHorizontalSets or gets the horizontal offset of the Marker center relative to its image. Valid values are: 1 (Left), 2 (Right), or 3 (Center).

AnchorVerticalSets or gets the vertical offset of the Marker center relative to its image. Valid values are: 1 (Top), 2 (Center), or 3 (Bottom).

You can use those tools to perhaps 'correctly' locate the birds by setting both Properties to Center.

You have a LOT of tools available ( see Map components )