Using lat/longs for Map?

I need to include a Map that sets markers based off of lat/long coordinates. It looks like the way Adalo is currently set up, it takes an address inputs (street/city/state/zip) and turns that into a lat/long – thus starting with lat/long formatting makes it go haywire. Is it possible to nix that automatic code-flip? Anyone have a workaround?

Hi @becky,

Just tested - using Lat & Long worked for me in the Maps component.
My setup was: Input → button updates property for logged-in user taken from input → Maps use a single marker, this property’s value is taken using magic text. All works fine.

There is a refresh cycle using visibility, but that’s a different story.

Best regards, Victor.

Trying to understand — so your Map was

  • set to one marker instead of Multiple
  • the Marker location came from a logged-in user’s input? What input? Are they inputting manually the lat/lon?

My Map input was lat and long as separate inputs, so maybe yours was one input of lat/long separated by comma?

Hi @becky,

This is what I used as a base app for testing: Adalo quick hints: Maps component refresh - YouTube

I entered Latitude and Longitude, separated by comma, into the input field. Everything worked fine :slight_smile:

Best regards, Victor.

I think you may be offering a solution for a different problem than the one I am trying to solve.

I want to show a map with multiple markers (~250 of them) for locations that do not have addresses, they have latitude and longitude coordinates.

@Colin Hi! It looks like you mentioned using lat/long in Map here. I would love to know where I’m going astray if you have a sec.

As an example, one of the 250+ pins I’m trying to map has this data attached to the Record in a Database:

  • Latitude = 36.8116989
  • Longitude = -76.2903976

If I need to update my spreadsheet to list all of them as “lat, long” in one record, I can, but it seems like Magic Text is built to do that in the Adalo app?

Many thanks in advance. :pray:

Dear @becky,

Just to clarify, may be my explanations weren’t articulated in a proper way.

In your original question you’ve stated that

In my test application, instead of an address, I’ve entered latitude and longitude, and it worked correctly.
Please see the sceenshot:

The application which I used for testing initially was created to illustrate different things, but this doesn’t contradict the possibility of displaying address by Latitude and Longitude. And this works by using Magic Text.

Having a map to display a collection with several markers containing Latitude and Longitude works as well:

(For the information - the top 3 records are coordinates for The Capitol, Pier 39 and Niagara Falls).

As a side note - displaying 250 records in the map might greatly increase the Google Maps API calls quantity, which might lead to high bills.

Victor.

1 Like

Dang, ok! Trying again. Thank you so much for this in-depth follow-up!

1 Like

@Victor :wave: If you’re able to take a look at my WIP, I’m still having trouble seeing where I’ve gone astray. I double-checked the APIs are enabled per Adalo’s Maps walkthrough, I don’t have/need JSON…

This is the data as entered in the Collection:

This is my set-up, with Google Maps API Key, multiple markers, the Collection its reading from, and a max 5 markers.

(As mentioned, no JSON)

And then I pull in the marker address from the Collection – Lat & Long. Super cool fancy custom marker. :stuck_out_tongue:

I feel like I must be missing something super obvious. :woman_facepalming: Any insight/suggestions more than welcome. Thanks in advance.

:map:

Hi @becky,

What happens when you launch the app in preview?
In the builder you’ll never see the actual map with data.

Also, what happens if you change the marker to default?

In preview, the Map shows up blank–

Will try w/ default markers now!

From what I can tell, default markers don’t seem to have an effect.

Hi @becky,

This is quite interesting.
Would you be able to share your markers’ collection CSV? You can send it to victor.v.kuzmichev@gmail.com.
Blank page might mean that the component has encountered an error and crashed, it’ll be interesting to see if the same happens in my sample app.

Best regards, Victor.

1 Like

Copy that! Just shared a spreadsheet w/ 50 lat/longs your way for testing.

Hi @becky,

Thanks for sending me this. I’ve experimented with the spreadsheet & maps, the results are a bit strange, I’ll share later.

Best regards, Victor.

1 Like

Oh man, I’m so interested to hear! But take your time, of course. Any insight much appreciated. :100:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

Hi @becky,

Sorry, I’ve been absent for some time, just returned and had an opportunity to continue with your issue.

I’ve re-created the app from scratch based on your Lat/Long list. Displaying multiple markers worked correctly for me.
Though there is one very important (but non-obvious) thing to do, when you set up the map markers based on Latitude and Longitute values. I assume these values are stored as numbers in the collection.
So, when you set up them in the Map Markers section, don’t forget to change the number formatting to None, see the screenshot below.

“Marker Address” field in the maps component is a text field, so without changing the number formatting it will cut part of the fraction, so the coordinates will become incorrect.

Hope this is still helpful :slight_smile:

Best regards, Victor.

2 Likes