Generating markers with grid's datasource

2 posts, 0 answers
  1. Aitor
    Aitor avatar
    1 posts
    Member since:
    Feb 2016

    Posted 16 Feb 2016 Link to this post

    Hello everyone!

    Is it possible to bind some of the fields in the grid´s datasource to a marker layer on a map?

    For example:

    For every registry in my grid, take "Text", "longitude" and "latitude" fields and bind them to a markers layer on a map, "text" being the marker's title, and ["longitude", "latitude"] being the marker's latlng.


    Thank you in advance for your help.


  2. T. Tsonev
    T. Tsonev avatar
    2834 posts

    Posted 18 Feb 2016 Link to this post


    The marker layer will normally expect the location to be available as a [lat, long] array.
    We can get around that by handling the markerCreated event and setting the location there.

    I've just noticed that the API reference for the Marker class is missing for some reason. Will check it out.
           markerCreated: function(e) {
              var dataItem = e.marker.dataItem;
              var location = new, dataItem.longitude);

    See this snippet for an example.

    T. Tsonev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top