Dynamically Load Map Markers

Each marker on my map has an associated marker as well. When a user clicks on a pin, I want to hide all other pins and only show that pin and the one associated with it (will eventually show driving directions between the 2). Then when a user clicks off the map (or use a clear button) I want all other markers to come back. Right now I am just working on hiding all other pins.

I am loading the markers data with the Workspace to help bind the data element to Workspace.

This is working fine.


Here is my On Marker Click Event

I expect this to override the Workspace data with just these 2 markers and update the map markers. Currently, nothing is happening and all markers are still there.

Is this even possible?

Your Markers Logic uses the job collection from Page Data to render all markers.

When a marker is clicked, you want to re-render the markers. This means there needs to be a change in the corresponding data model (the Workspace data model). And yes, you’re making a change in that data model. As a result of that change the Markers logic will be triggered, however, it will do the same thing as it did originally because the jobs collection in Page Data has not changed.

Hopefully it explains why you’re not seeing any changes upon click.