I've implemented a map that draws features from a geoJSON and I colour the features based on the values read from a separate JSON file, inside
shapeCreated
For testing purpouse, I need to read the features from the map to check that the correct colours have been assigned to each of the features.
How can I read data back from the map? Mind you, from the map, not from the geoJSON, i.e.: after the style of shapeCreated has been assigned
Hi Pierpaolo,
You can access the data items for the features in the shapeFeatureCreated event handler:
https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/map/events/shapefeaturecreated
Here is the full list of the data you can access inside the event:
In case this is not what you are looking for could you pelase share more information so I can have a better understanding?
Regards,
Nikolay
What I need is a way to iterate the shapes rendered on the map and read the fill colour, to compare it with the entity data:
e.g.: let's say that Italy should be coloured white, I need to check that its shape on the map has beed rendered in white colour.
The reason being that I randomly found out that the code of one shape (inside the geojson file) was different from the code for the same country in the data represented and, consequently, its colour on the map was wrong.
Hi Pierpaolo,
Is it possible to share a runnable Dojo demo where the problem is replicated so I can investigate further?
Regards,
Nikolay
Hi Nikolay,
I don't have a dojo demo that I could share but any choropleth map would do.
I need code to read the colour of a shape from the rendered map.
Would that still be the recommended approach or is there a functionality that renders storing the shapes inside a dedicated object unnecessary?
Hi Pierpaolo,
This approach is still valid and I recommend sticking to it. I have updated Dojo to the latest Kendo UI version:
https://dojo.telerik.com/EvEromob
Regards,
Nikolay
Hi Pierpaolo,
Yes, that is correct. Store the shapes within the onShapeCreated to access them after the page has been rendered.
Regards,
Nikolay