XML is the first hero of services in the Web 2.0 zone. With the help of XML, services or machines can easily communicate between them. XML can also be readable by humans. But after browser evolution, JSON has become much more popular due to its native readability for JavaScript and its lightweight compared to XML. GeoJSON is a form of JSON that includes collections of simple features such as points, polylines, or polygons. GeoJSON is not a standard of OGC, but it is a new de facto standard used by most GIS software or services.
The Google Maps JavaScript API does not support GeoJSON natively, but GeoJSON support will be added with a few lines of coding or with some additional libraries. With coding, we will go through the JSON format and read the coordinates one by one. Then, we will show the feature on the map according to its type, which can be point, polyline, or polygon.
In this recipe, we will read GeoJSON from a local file via the jQuery...