1

First of all, I am new to android and trying to learn new things.

I want to display a google map route in a view (probably mapview). I have some google map URLs for my routes something like this:

removed the link

I just want to display this route in my app. Zoom-in and zoom-out to route can be perfect.

How can I do that? I need your assistance.

Thanks in advance.

PS: I do a research and I can not find a solution to display the route from the URL.

  • Sorry for posting external links but [what's that](https://www.youtube.com/watch?v=VNDfD6YnJE8) or [this one](https://www.youtube.com/watch?v=wRDLjUK8nyU)? – Blind Kai Aug 21 '19 at 06:59
  • duplicate of https://stackoverflow.com/questions/43467062/how-to-draw-route-between-two-points-in-mapfragment-using-google-maps-android-ap – shubham vashisht Aug 21 '19 at 07:10
  • @BlindKai thanks but the links you shared are for drawing a route. My route is ready. I just want to display it. – Orhan Ozden Aug 21 '19 at 07:11
  • @shubhamvashisht it is not what I want. I do not want the user enter a location. I have several routes which I shared one of them above. I just want to display it in the app. – Orhan Ozden Aug 21 '19 at 07:15
  • The link you are using an internal Google Maps route. What Google provides for free with MapView is just the map engine & tiles. You are responsible for drawing any route lines. Google does have a [Directions API](https://developers.google.com/maps/documentation/directions/start) but will cost money to use. – Morrison Chang Aug 21 '19 at 07:17
  • @MorrisonChang thanks a lot. You mean there is no way to do it for free :( I do in a webview but it is not what I want. – Orhan Ozden Aug 21 '19 at 07:19
  • You can [send the user to the full Google Maps app via an Intent with a directions request](https://developers.google.com/maps/documentation/urls/guide) is another option. – Morrison Chang Aug 21 '19 at 07:26
  • thanks @MorrisonChang. I will do that. – Orhan Ozden Aug 21 '19 at 07:29

1 Answers1

0

The link you are using an internal Google Maps route. What Google provides for free with MapView is just the map engine & tiles. You are responsible for drawing any route lines. Google does have a Directions API but will cost money to use.

As a alternate, you can send the user to the full Google Maps app via an Intent with directions request

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77