Google Maps - Multiple Markers & Info associated with them

First of all, the purpose of the app I want to make, is to have multiple locations highlighted (with markers) and when a user clicks on one of them he will be redirected to an info screen about the location he clicked.
So I wanted to ask you , how can I create multiple markers with the minimum amount of blocks (so to avoid a meshy workspace) using lists. And another thing is how can I associate coordinates with marker ID.
Any suggestions would be helpful.
Thanks!

I also wanted an app like this. I researched here in the community. Maps , Google Maps ,Location … and I managed to do it. Have you ever tried to do what I did?

I believe that the code that is required for this to work looks something like this
Sem título

( i found it in this thread :Get Marker Title from Google Maps component - #2 by ImranTariq )

The problem is, I don’t get how can I connect lat & lng to a specific marker.
Example :
blocks

blocks(1)

How do I connect Items from different lists to a marker ID in order to display specific locations (with lat & lng) when the app opens?

1 Like

Join index 1 from the list of lat + index from the lng list and the indices 2,3,4,N and make the pairs that are necessary to create several Markers (use the Join block)

You have to associate each latitude and longitude with a name or location.
In a database or a list you will have to make this association.

Block When On Marker Click , return longitude And latitude.

When clicking on the marker:

  • take the latitude and longitude
  • take only with 2 decimal places
  • compare with latitude and longitude lists.
  • if it is the same , get the index and then you will know where you should show the details
1 Like

2 Likes

Ok , so what blocks should I use to associate each latitude and longitude with a name or location using lists?

Have you tried to do what I suggested above?:+1:
Or maybe I don’t understand what you want to do​:grimacing:.
This example is with MySQL and PHP.:point_up:

I have done this so far.

I want to avoid using MySQL and PHP because I don’t have a lot of experience in using them and I want the app to be available offline.
So I am using a csv file to get the data I need to display the markers.
What do you think about this? I am having a bit trouble finding out what blocks should I use add in the Add Markers block.

Can you share your csv file?

I have written this Guide - How to create dynamic marker on maps

1 Like

Here an example with google spreadsheet. I’m calling only colums E,F,G

https://docs.google.com/spreadsheets/d/your_spreadsheet_id/gviz/tq?tqx=out:csv&tq=SELECT E,F,G

Blocks to create markers

2 Likes

Ok. :+1:

MYSQL+:point_right:Sqlite​:point_left::grin: but , I understand you…

1 Like

Here it is :

Replicating your spreadsheet data

image

Call data from spreadsheet

https://docs.google.com/spreadsheets/d/your_spreadsheet_id/gviz/tq?tqx=out:csv&tq=SELECT *

Using Google Maps component

Result

If you wish to use Maps instead of Google Maps components follow the guide above provided by @sugarlesscreator

2 Likes

format your writing using the currency format. convert it to plain text.

I’ve made the tutorial here

1 Like

Thanks everybody for the help, managed to do it!
As @dora_paz pointed out the URL for Web1 should be :

https://docs.google.com/spreadsheets/d/your_spreadsheet_id/gviz/tq?tqx=out:csv&tq=SELECT *

and the blocks :


Also another thing I had wrong ,was the format I was using in spreadsheets as @sugarlesscreator said.
Correct format for this to work is with plain text!

1 Like

Sorry for the interruption.
How many tags can be added Can sites be added in a database and added to the application Can you try 1000 sites

If using a robust bank, create a routine in the application to enter latitudes and longitudes. Then create the routine to show only the desired records, (bakery, cafeteria, gas station).
Directly by the app.
It’s flexible and any user of the app can supply the makers

1 Like

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