how to draw a route between two markers in google maps

前端 未结 2 634
慢半拍i
慢半拍i 2020-12-14 20:26

Hi I am trying to draw a route map between two markers using javascript. I have tried various examples found online but my map is not loading while trying out different exam

2条回答
  •  醉梦人生
    2020-12-14 21:12

    Quite a few mistakes. First is the geolocation. Your second location is wrong as the longitude can only be from +180 to -180 so -181 doesn't exist in the earth! Secondly, as MrUpsidedown mentioned in the comment, you are calling a function within a function. Correct the geolocation first and then your function calls, that should fix the problems you're having.

提交回复
热议问题