Google Maps API - detect when crossing state lines and calculate distance travelled in each state

前端 未结 3 1089
[愿得一人]
[愿得一人] 2020-12-21 01:03

I am using google maps api to calculate the number of miles my company\'s vehicles travel in each state over a period of time. For trips taken over the period, the user wil

3条回答
  •  无人及你
    2020-12-21 01:35

    Looking at the directions text in the panel, it looks like the text "Entering " appears in the steps that cross state boundaries.
    http://www.geocodezip.com/v3_example_geo2.asp?addr1=New%20York,NY&addr2=Washington,%20DC&geocode=1&geocode=2

    • Entering New Jersey
    • Entering Delaware
    • Entering Maryland
    • Entering District of Columbia

    (this is not documented, so might stop working)

    You could also find the intersection of the Directions polyline with a set of state polygons.

提交回复
热议问题