Home > OS >  How to implement speed van feature like toll feature using Google Maps API
How to implement speed van feature like toll feature using Google Maps API

Time:11-30

I am creating a route planner application for my application I am using Google Maps API which allows me to use Google Maps in my application anyone who has used Google Maps know that when picking a route you want to take clicking on a specific route tells you how long it will take and if there is a toll on it (atleast for Ireland it comes up telling you where tolls are). For my route planner application I want to tell the user that this route could have a speed van on it. I also want to be able to tell the user that a speed van is coming up slow down. I am wondering how could I implement these features I have a csv file for where the speed vans are.

CodePudding user response:

You would want to calculate point to polyline and have some tolerance for the range that you find acceptable based upon the projection that you are using to represent your data. Points near the poles will be actual closer than reported if you are using a traditional mercator or web mercator projection. Depending on your language, there is likely a library that already does this. Since I assume you are using the Google Maps API, there is a Nearest Roads API that you may find beneficial.

  • Related