Google Maps API Version difference

后端 未结 9 1648
野趣味
野趣味 2020-11-28 23:22

I\'m trying to show route between two places, I want to used Google Places API V3 for route steps between two points.


Before I was using Old Google Maps API, a

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 23:54

    It seems there are enough answers but for this subject, i benefit this link. But it didn't work when i downloaded and imported. So i implemented on my own application. And there is a mistake in that code. When you want to second time calculate a route, the app. breaks.

        if (mMarkerPoints.size() > 1) {
    
                    mMarkerPoints.clear();
                    map.clear();
                    // LatLng startPoint = new LatLng(nearbyLatitude,
                    // nearbyLongitude);
                    // drawMarker(startPoint);
                }
    

    Find that lines and make comment as i have done. Anyway, actually you asked to draw a route not whole code, so you can check code on that web-site. It is good at to draw route between to points (markers). Have a good day.

提交回复
热议问题