Markers on a map

I have 50 markers on a map and need to see which ones are visible. Is there a way to check on a any component level and not have to check each one on its own?

Yes. Make a list of the Markers. Use the Markers List to cycle thru the existing Markers and use the circled blocks to set whether MarkerVisible for each Marker it true or false.

Exactly how to determine the Marker state depends on whether the Markers are design time Markers (Marker1, Marker2, etc.) or run time Markers ( made using the call Marker.CreateMarker block) and your existing code (which you did not share).

Code similar to the following should work:

Is this what you hope to do or do you want to determine present status? Developers can query the status of each using an If block.

Regards,
Steve

Thanks, this helps a lot.

How do I detect which Marker has been clicked?
When the user clicks the marker it fills text boxes depending on which marker.

The following discussion shows one way.

You can frequently find advice already present in the forum by using the group's search function ... like this

Are you able to click on a Marker and get a result?

I have created at design time 20 markers (Marker1, Marker2 …)
I query a mysql and get the marker (map locations) which is fed into the vCustomerList.
I then loop to set the markets in runtime.
Gives me the error having a problem with the number counter. (as in pic)

How do I get around this? In your example you have a runtimeMarkerList, how do you make that list up?


try for each item in list list from csv table responseContent
to iterate over all markers.

On call marker set location need to change from count, its a number , need to be a marker component

In the example I used the creaateMarker
to make a single run time Marker.

You are using design time Markers (Marker1, Marker2, Marker3 perhaps). Design time Markers should work fine. To make a List of them, create a List of the component names (Marker1, Marker2,...) - all 20 of them and initialize the List in your Screen1.Initialize (or using a button or whatever you want).
designTimeMarkerList
Loop thru the myMarkerList to add your coordinates and Labels. The code you posted looks 'suspect' , depending what is in your Procedure ClearMarkers and why you use a count instead of the number 20 or length of list myMarkerList Block in your for each number Block.

Hopefully, the above advice will get you started.

You could create your app using run time Markers.

HOW TO: Use a Google Spreadsheet Hosted on your Google Drive to Update a Map

shows something similar to what you might want to do.

Clear Markers is intended to loop thru the Markers and make them all invisible.
blocks (5)
This gives an error.

vCustomerList is built with a php mysql query so length is undetermined
For each item in the vCustomerList I need to make a Marker visible and set its attributes.

I just cant get this to work!

@KnightsMultiMedia I can’t perform Magic and make things disappear (like Markers) unless I know more about them.

What error do you get? To debug, it is important to know this and share that information.

You said ‘vCustomerList is built with a php mysql query so length is undetermined’. Ok, Do you know you can find out how large the list is? Find out how long runtimeMarkerList is using the length of list block; make sure your list of components and is really a List; and use a for each number block instead of for each item Block. You do not show a DoIt or an example of what is in this List or why your vCustomerList relates to your runtimeMarkerList.

You could try something like the following example to clear your design time Markers:

runtimeMarkerHide

that might work like Magic. It is a guess. Does the code work? If not, what is the error and what is the structure of your runtimeMarkerList?

Regards,
Steve


Thanks for all your help guys, i finally got it to work using a little bit from everyone.
Attached is the working block - just thought I would share what worked so that maybe if someone else has a similar problem they can also find a solution.

Truly, thanks all

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