Queryable GeoJSON

4 posts, 0 answers
  1. Aaron
    Aaron avatar
    3 posts
    Member since:
    May 2015

    Posted 08 Jul 2015 Link to this post

    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

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 10 Jul 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Michael
    Michael avatar
    1 posts
    Member since:
    Oct 2015

    Posted 05 Oct in reply to T. Tsonev Link to this post

    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? 

  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 07 Oct Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready