Kendo Map MultiPolygon

Thread is closed for posting
5 posts, 1 answers
  1. Zack
    Zack avatar
    2 posts
    Member since:
    Oct 2013

    Posted 09 Oct 2014 Link to this post

    Hi there,

    I've been playing around with the Kendo UI Map, been working great so far.

    Based on the example here (http://demos.telerik.com/kendo-ui/map/geojson), is it possible when a shape is part of a multipolygon to be able to have the other polygons highlighted in the shapeMouseEnter/shapeMouseEnter function.

    In other words if I was to enter mainland USA with my mouse, would it be possible to trigger the highlight on Alaska and Hawaii as well?

    Thanks,
    Zack
  2. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2771 posts

    Posted 13 Oct 2014 Link to this post

    Hello,

    Locating and updating related shapes is possible, but we need to keep track of the shapes ourselves.
    The shape reference that we get shapeCreated in remains "live" until the next map reset.

    We can do the following:
      var shapesById = {};

      function onShapeCreated(e) {
        var id = e.shape.dataItem.id;
        shapesById[id] = shapesById[id] || [];        
        shapesById[id].push(e.shape);
      }
          
      function onReset() {
        shapesById = {};
      }

    Then we can get the id from the shape in the shapeMouse* events:
      function toggleShape(e) {
        var id = e.shape.dataItem.id;
        var shapes = shapesById[id];
        ...
      }

    I demonstrated this in the following snippets. I hope this helps.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Zack
    Zack avatar
    2 posts
    Member since:
    Oct 2013

    Posted 14 Oct 2014 Link to this post

    Fantastic, this is exactly what I was hoping for! 

    Thanks so much for your quick response.

    Zack
  5. Rakesh
    Rakesh avatar
    1 posts
    Member since:
    Oct 2014

    Posted 15 Oct 2014 Link to this post

    Hi there,
     
    I am using Kendo UI Map ,For set of latitude and longitude

    My question is is it possible to Show my all my  Lat,Long in same map ,I am using for loop & have attached a snap which shows the route ,i want some thing like this .

     public static void main(String argv[])
       {
            double baseLat = 12.924155;
           double baseLon = 77.55282333333334;
           Random rand = new Random();
           
           for (int i=0;i<15;i++)
           {
            double lat = baseLat + ((double)rand.nextInt(100) / 100.0);
               double lon = baseLon + ((double)rand.nextInt(100) / 100.0);
             //  GeoCode gp = new GeoCode(lat, lon);
                System.out.println("Found RG: " + lat +","+lon);
            }
           
       }



  6. T. Tsonev
    Admin
    T. Tsonev avatar
    2771 posts

    Posted 16 Oct 2014 Link to this post

    Hello Rakesh,

    The Binding markers to remote data demo illustrates how to do this in an MVC project.

    Please open a new thread if you need any further assistance.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready