[FEATURE-12779] Map Component - OnClick event for a marker

Hello All,

I am looking to achieve two things on the map component in Ignition 8.

  1. I want to access the onClick event for a marker on the map to perform a few simple actions based on which marker was clicked. Map component provides a way to access only the onClick event for the map, not the marker.
  2. I want to manipulate the color of the marker, essentially to show some kind of status.

Any suggestions on how this can be done?

Currently, there is no way to do this. The map component has yet to be revisited since the conference, but there is plan to do so later this week. I will include your request for features in this plan. --Yousuf

Thanks for the update Yousuf

1 Like

Do you know if the map component has been reworked now?

Hi,

Iā€™m currently working on the component at the moment. Your feature request has successfully been added. Each marker has a name property (set by the designer) that is passed along in the marker click event payload. I have also added the corresponding component event called onMarkerClick which you may subscribe to. There are other features that have been added, including:

  • onMapClick component event which contains the lat and lng coordinates of the click event
  • a new view layer added to the ui layers
  • the ability to render views in popups and tooltips
  • performance updates

I am hopeful that these changes will become available in the next nightly build.

-Yousuf

2 Likes

Thanks for the detailed update Yousuf!

Hi,

New map component features have just been merged. Should be available in the next nightly build. See change log notes for additions and improvements.

-Yousuf

1 Like

Awesome. Thanks!!
Will there be a way to manipulate the color of the marker or maybe even change the icon?

Yes, there will be. -Yousuf

1 Like

Hi, Is there way i can assign events for each individual marker clicks?
Right now all makers are having the same scripts.

Regards,
Kumar

Give your markers unique names and then you can dispatch to any desired script based on marker name.

1 Like

Yes. My markers have unique names.
When I configure using right click, configure events; Configuring one marker, configures all markers with the same script.