This is a migrated thread and some comments may be shown as answers.

Marker click event

8 Answers 688 Views
Map
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 13 May 2014, 11:23 PM
Hi,

Just wondering if anyone knows how I can catch a click event when a user clicks on a marker. There are click and shapeClick events but dosent seem to be a marker specific event.

Any suggestions greatly appreciated.

Cheers,
M

8 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 14 May 2014, 08:28 AM
Hi Michael,

At this point Kendo UI Map does not raise a click events for the markers. As a possible workaround I can suggest displaying markers.tooltip on "click" and attach a handler to the show event
$("#map").kendoMap({
  //....
  markers: [{ 
     //....
     tooltip: {
        content: "Austin, TX",
        showOn: "click",
        show: onShow
     }
  }]
});
 
function onShow(){
   //....
}

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Michael
Top achievements
Rank 1
answered on 14 May 2014, 11:09 PM
Thanks IIiana :)
0
Chris
Top achievements
Rank 1
answered on 08 Oct 2014, 01:58 PM
Iliana,
does this work with 'type: "tile"' types or ONLY 'type: "shape"'

see my http://dojo.telerik.com/@wcaulton/iLOCA using tile but no location coordinates showing.
0
Iliana Dyankova
Telerik team
answered on 10 Oct 2014, 07:41 AM
Hi Warren,

I am glad to inform you that markerClick event is already available. For your convenience here is the updated example.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Chris
Top achievements
Rank 1
answered on 10 Oct 2014, 11:52 AM
Thanks for the update, I did not get the marker info as expected. I have another example here.

Again my question is: Does the type:  "shape" or "tile" make a difference? It appears to.

Thanks for the help.
0
Iliana Dyankova
Telerik team
answered on 13 Oct 2014, 12:29 PM
Hi Warren,

I am not quite sure what the expected info is, however in the markerClick event you have the marker instance. Please take a look at this updated example and let me know if I am missing something.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tarik
Top achievements
Rank 1
answered on 21 Oct 2020, 07:26 PM
Hi, Im using markerClick, but I see no way of getting to the dataItem.  I want to get to the source data bound to the marker.   How do I do this?
0
Preslav
Telerik team
answered on 23 Oct 2020, 10:37 AM

Hello Tarik,

To get the dataItem of the marker, use the e.marker parameter of the event handler. More information about this is available here - https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/map/events/markerclick

For example, check this Dojo - https://dojo.telerik.com/ediXeDaL

I hope this helps.

 

Regards,
Preslav
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Map
Asked by
Michael
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Michael
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Tarik
Top achievements
Rank 1
Preslav
Telerik team
Share this question
or