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

Queryable GeoJSON

3 Answers 153 Views
Map
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 08 Jul 2015, 07:05 PM

Hello,

In the samples I see a lot of static GeoJSON being used to provide shape layer data but none where the layer data is fetched from a service which could query a source and return only the GeoJSON for the current map bounds, perhaps also dependent on the zoom.

My challenge is to integrate a database with plenty of shapes (polygons) in it so querying the database is the only realistic option we have. In the end, new shapes would also be created through the map and saved to the database but for this questions purpose I am only interested in querying and returning the correctly formatted GeoJSON based on the current bounds and zoom.

Does the map control support passing the bound and zoom parameters to the service behind a GeoJSON URL? If so, what are these parameters and would you be able to point me to the related documentation or create a new entry explaining and demonstrating this feature.

Regards,

Aaron

3 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 10 Jul 2015, 11:19 AM
Hi,

The Data Source allows sending additional data to the remote service that can be used for filtering.

I've prepared a small snippet to demonstrate how this can be used to inform the service of the current map extent.

I hope this helps.

Regards,
T. Tsonev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 05 Oct 2016, 05:14 PM

The particular scenario listed above in Aaron's post is what I am trying to tackle currently. The example T.Tsonev gave still seems to reference a json file to load the map.

What I am looking for is an example of when no specific geo json file exists but rather the json is created from a webapi call.

I want the datasource of the map to be the results of a webapi that returns geojson data. 

Can you provide documentation or an example of that scenario? 

0
Ianko
Telerik team
answered on 07 Oct 2016, 10:17 AM

Hello Michael,

 

The datasource configuration for GeoJSON that is fetched from a service is no different than any other type of format. Simply, set the url option to the API url. You can check out this demo: http://demos.telerik.com/kendo-ui/datasource/remote-operations. And also you might find useful the API in our documentation: http://docs.telerik.com/kendo-ui/api/javascript/data/datasource

 

In your scenario you should note that the type of the DataSource should be set to geojson, but the service should return JSON type. 

 

Next, it is up to the service to provide the proper GeoJSON data so to bind the Map properly.

 

Regards,
Ianko
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Map
Asked by
Aaron
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Michael
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or