Completed
Last Updated: 20 Nov 2014 21:02 by ADMIN
Pierpaolo
Created on: 18 Sep 2014 12:34
Category: Kendo UI for jQuery
Type: Feature Request
17
Separation of shapes and datasource for maps in DataViz
What I want to achieve is a dynamic Choropleth map of the World, whose data change according to a set of parameters.

It is my understanding that the maps widget in Kendo UI can display data in a Shape layer using GeoJSON files that contain both the definition of the shapes of the countries and the data itself (e.g. the population). From your GeoJSON demo it is clear how to change the colour of the countries using the Chroma.scale method.

But it also looks like I need the shape definitions to be duplicated over and over to show different data on the same map: 
let's say that I have about 400.000 possible combinations of the filters, it appears as if I'm going to need 400.000 GeoJSON files that contain both the shapes definitions and the the data and this means lots of network traffic.

My point is that, since the shapes of the countries do not change because the map is always the same, wouldn't it be useful to split the shape definition from the data itself?
In other words having a "shapeSource" property to which you link a GeoJSON that defines the shapes and the "dataSource" property bound to a JSON file that only has data: when the combination of filters changes I would only change the dataSource object.

My current solution is to have the "shapes definition only" file set in the dataSource property of the shape layer and then to use a Kendo.dataSource "data-only" object that I would use in the shapeCreated method to set the colours of the countries.

As a side note, the "data-only" Kendo.dataSource object will be shared between three widgets in the same page because the same data will be shown in a map, a chart and a grid.
3 comments
ADMIN
Telerik Admin
Posted on: 29 Sep 2014 08:25
See the comment from Tsvetomir below.
ADMIN
T. Tsonev
Posted on: 24 Sep 2014 15:22
Keeping the data and the shapes together indeed does not make sense in this approach.

You can load the GeoJSON once in a shape layer and then update the shapes according to the data set.

You can obtain a reference to the rendered shapes in the shapeCreated event. These are regular Drawing API Paths that will remain "live" until the next map reset.

See the following snippet: http://dojo.telerik.com/@tsvetomir/aCeM
See also: http://docs.telerik.com/kendo-ui/api/javascript/dataviz/drawing/path
Pierpaolo
Posted on: 23 Sep 2014 12:57
@kendoteam: no comment about this?