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

Kendo Map MultiPolygon

4 Answers 218 Views
Map
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Zack
Top achievements
Rank 1
Zack asked on 09 Oct 2014, 05:38 PM
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

4 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 13 Oct 2014, 08:13 AM
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!
 
0
Zack
Top achievements
Rank 1
answered on 14 Oct 2014, 12:35 PM
Fantastic, this is exactly what I was hoping for! 

Thanks so much for your quick response.

Zack
0
Rakesh
Top achievements
Rank 1
answered on 15 Oct 2014, 05:49 AM
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);
        }
       
   }



0
T. Tsonev
Telerik team
answered on 16 Oct 2014, 08:23 AM
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!
 
Tags
Map
Asked by
Zack
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Zack
Top achievements
Rank 1
Rakesh
Top achievements
Rank 1
Share this question
or