Plural Map Markers can not be displayed simultaneously. Why?

I want to make an application.
This application has function as the followings,

  1. To get plural sets of latitude and longitude data from CloudDB.
  2. To display Markers on the Map.
  3. In order do to 2., I apply "For Each" structure in my application.
    Looking up the execution of this application, I found this application displays once Marker but erase previous Marker at displaying latest Marker.
    If I have to display 3 Markers, application finally writes 3 Markers and deletes no.1 and no.2 Markers, remains only no.3 Marker.
    I do not know reason why "For Each Loop" erase previous Marker.
    Is there any way to remain all Markers on Map.

I'm not sure which is the problem you have with markers, but you have several examples relative to multiple Markers on a map....some examples:

search in the community.

In order to provide specific advice we need some additional information from you @shigeki_suzuki .

  • are you using run time Markers (using Create) or design time Markers (those markers using default Marker1, Marker 2, and so fourth). It makes a huge difference in what you use.
  • please provide an image of your Blocks here.
  • how many Markers do you expect to display (how many markers does your Project need ?) Only 3 markers in total?
  • If you use design time markers, what you want to do should be relatively easy when using the CloudDB tool; using run time markers with CloudDB is much more complex.

No one else knows because you did not share your code. We cannot see what you coded. :cry:
Be aware, you might be posting markers on top of existing markers giving the appearance that previous markers disappear.

hi there,
i send my block to intend display plural Map Markers but get only the last Marker.

Please review this why only the last Marker remains another erased.

All the Markers are posted to the Map. You set each marker with initial coordinates of 0,0 . What happens is Marker1 is posted; Marker2 is posted on top of Marker1 and hides Marker1. Marker3 is posted on top of Markers 1 and 2, hiding them. Marker4 is the last Marker posted.. It post over 1,2 and 3 so you only see Marker4 because, at the moment all the markers are at 0,0 lat/lon.

They are NOT erased only covered by other markers in your example and 'hidden' from view.

An experiment :cry:
Make a Button and place the following code in the Button.Click as a Block to:

set Marker4.Visible to false

The code will hide Marker4 and you should see Marker3

Experiment results true.
Set New Marker makes to hide previous Marker.
That is correct.
It is inconvenient.
how to show all Markers using For Each structure.

Sorry. I do not understand your code

This example may be helpful to plot all four Markers prior to using your database.


Without seeing an example of your database, I can not help you. Tell me what you are trying to do with your database and provide an example of the database.

for each structure; works like this

See and Figure

However I do not understand why you want to do that.

thanks JG
i did use block like you suggest.
For Each structure override and hide previous Markers, so I must select the same blocks as you suggest.
I want App Inventor that For Each block not to overlay previous Marker . But it can not.

Look at this example. Social Distancing ... a CloudDB / Location Marker Tutorial

Perhaps this type of coding is what you are trying to do?

To 'not to overlay previous Marker ' the next marker MUST have different coordinates from any existing Marker so you can avoid overlaying. :wink:

its good .
I try it