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

Custom Marker from Server Side

1 Answer 114 Views
Map
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 06 Jul 2019, 04:04 AM

HI Their

I wana customize Marker in Ajax  RADMAP with numeric value Text in it . any help 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 09 Jul 2019, 10:54 AM
Hi Deepak,

I have just answered your support ticket on this matter, for convenience I am pasting my answer here in case any other user is wondering how to achieve the same:

RadMap does not expose template for its markers and the only way to show custom data for each marker for the moment is to add to the content of the marker.tooltip.template, where you can access the marker's dataItem and its fields. Such implementation is demonstrated here in the following live demo:
https://demos.telerik.com/aspnet-ajax/map/examples/functionality/markers/defaultcs.aspx

<TooltipSettings AutoHide="false" Width="300"
    Template="<div class='leftCol'><div class='flag'></div></div><div class='rightCol'><div class='country'>#= marker.dataItem.country #</div><div class='city'>#= marker.dataItem.city #</div><div class='address'>#= marker.dataItem.address #</div><div class='address'>#= marker.dataItem.address2 #</div><div class='phone'>p #= marker.dataItem.phone #</div><div class='email'>e <a href='mailto:#= marker.dataItem.email #'>#= marker.dataItem.email #</a></div><div class='location'>Location:#= location.lat #, #= location.lng #</div></div>">

The other option I can think of is to add custom CSS classes to each marker and then change the content of each marker using your own logic relating the marker CSS class and the data that needs to be shown:
https://docs.telerik.com/devtools/aspnet-ajax/controls/map/appearance-and-styling/customizing-markers-in-radmap

Last but not least, you can add a Feature Request for Markers Template in the Kendo UI Feedback portal (as RadMap is a server-side wrapper of the Kendo UI Map widget) and our developers will consider its implementation depending on the popularity of the item:
https://feedback.telerik.com/kendo-jquery-ui?typeId=2&listMode=Recent


Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Map
Asked by
Deepak
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or