Book Image

Kendo UI Cookbook

By : Sagar Ganatra
Book Image

Kendo UI Cookbook

By: Sagar Ganatra

Overview of this book

Table of Contents (18 chapters)
Kendo UI Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a map by binding it to the GeoJSON data


GeoJSON is a format for encoding a variety of geographic data structures. It is an open-standard format for encoding a collection of simple geographical features along with non-spatial attributes using JSON. In this recipe, we will create a map that is bound to the geoJSON data, containing not only the coordinates, but also other non-spatial information about the area.

How to do it…

To create shapes that correspond to points or coordinates, set the layer type as shape. Let's first refer to the geoJSON data that contains the coordinates and also other non-spatial data:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "GEO_ID": "0400000US23",
        "STATE": "23",
        "NAME": "Maine",
        "LSAD": "",
        "CENSUSAREA": 30842.923
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [-67.619761, 44.519754...