Search code examples
javascriptgoogle-mapsweb-applications

How can I check if Google Map co-ordinates lie in London Congestion Zone?


I am trying to check if google map co-ordinates lie in London Congestion Zone. How can I detect if the co-ordinates lie inside the boundary of London Congestion Zone or Is there any other way around.


Solution

  • The congestion charge area is available in GeoJSON format from this site.

    https://data.cdrc.ac.uk/dataset/ccz

    You can import this data into Google Maps using map.data.loadGeoJson. Some example code can be found at:

    https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/javascript/examples/layer-data-simple

    You can then use map.geometry.poly.containsLocation from the map API to answer your question