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

**URL:** <https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815>\
**Category:** Ignition Early Access\
**Created:** [February 22, 2019, 6:43pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815 "2019-02-22T18:43:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankitkarwa21](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ankitkarwa21](https://forum.inductiveautomation.com/u/ankitkarwa21)\
**Post date:** [February 22, 2019, 6:43pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/1 "2019-02-22T18:43:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [February 27, 2019, 4:51pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/2 "2019-02-27T16:51:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ankitkarwa21](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ankitkarwa21](https://forum.inductiveautomation.com/u/ankitkarwa21)\
**Post date:** [March 4, 2019, 6:42pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/3 "2019-03-04T18:42:17Z")

</div>

Thanks for the update Yousuf

---

<div class="post-metadata">

**Author:** ![ankitkarwa21](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ankitkarwa21](https://forum.inductiveautomation.com/u/ankitkarwa21)\
**Post date:** [March 11, 2019, 11:54pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/4 "2019-03-11T23:54:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [March 14, 2019, 3:26pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/5 "2019-03-14T15:26:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ankitkarwa21](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ankitkarwa21](https://forum.inductiveautomation.com/u/ankitkarwa21)\
**Post date:** [March 14, 2019, 5:31pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/6 "2019-03-14T17:31:52Z")

</div>

Thanks for the detailed update Yousuf!

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [March 15, 2019, 9:16pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/7 "2019-03-15T21:16:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ankitkarwa21](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ankitkarwa21](https://forum.inductiveautomation.com/u/ankitkarwa21)\
**Post date:** [March 15, 2019, 10:18pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/8 "2019-03-15T22:18:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [March 15, 2019, 10:40pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/9 "2019-03-15T22:40:16Z")

</div>

Yes, there will be. -Yousuf

---

<div class="post-metadata">

**Author:** ![kumar.chellappan](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kumar.chellappan](https://forum.inductiveautomation.com/u/kumar.chellappan)\
**Post date:** [July 30, 2020, 4:25pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/10 "2020-07-30T16:25:50Z")

</div>

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

Regards,  
Kumar

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 30, 2020, 4:29pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/11 "2020-07-30T16:29:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kumar.chellappan](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kumar.chellappan](https://forum.inductiveautomation.com/u/kumar.chellappan)\
**Post date:** [July 30, 2020, 4:32pm UTC](https://forum.inductiveautomation.com/t/feature-12779-map-component-onclick-event-for-a-marker/22815/12 "2020-07-30T16:32:11Z")

</div>

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