Android: Draw route on map using KML file - android

I have a KML file which is created from maps.google.com. And i want to draw a route on google map.
I am using mapV_2 in my project. Also one more thing I read couple of threds here on SO saying that KML is no more working on google map One, Two. So is it really not working today for Android? Any othe way to get this done?

Related

How to connect Kml layer + Autocomplete in Kotlin Android?

I have a question about SDK Google maps in Android
I have a Autocomplete Place that works perfectly. When i write some text in the input, google show me locations, and when i click on any print coordinates.
Question:
Is there any way to know if those coordinates are in a polygon of a Google my maps kml file?
I tried:
KmlLayer(map,id for local file, context)
Documentation: https://developers.google.com/maps/documentation/android-sdk/utility/kml
The problem is that i need the local kml file on my local repository. I need to get KML file from URL with a map id (https://www.google.com/maps/d/u/0/viewer?mid=XXXXrsxRFHqpMEmYXXXXX)
That "mid", can change, since sometimes I will need to use another kml file with a different url.
Also, Autocomplete documentation: https://developers.google.com/maps/documentation/places/android-sdk/autocomplete
Thank you everyone.
Any help would be greatly appreciated! Thanks

Connecting the GPX track points

I am trying to draw a track on a OpenStreetMap in android. I am able to record the location and export it as a GPX file. I am also able to extract the latitude and longitude from the gpx file and overlay it as coordinates in the OSM. My question is, I am able to show only the coordinates of the trackpoints but I don't know how to connect these points to show as a route. Can somehow help me if you have achieved this?
As alternative, you can have a look at [skmaps]:
check the tracks menu in the demo project
if you have the route points/list of segments, then you can draw them on the map using a SkPolyline - see the getting started chapter: http://developer.skobbler.com/getting-started/android#sec009
You can use OSMBonusPack Polyline overlay.

how to make android app that has offline maps

i want to make a android app that already has the map tiles of a particular area in its apk and when the user installs the app he can see the map without having an internet connection in his phone. he should be able to see the map of that particular area offline. i have heard i could do this by osmdroid. but can i store actual Googlemaps (satellite view) with it.
Or is it possible to first store the png images of the map tiles of that particular area in your asset folder and then use it. if this is possible can you please tell me how to do this(i mean how to put tiles in asset folder and then display it using inputstream ). i am new to android. any help where to start from?
but can i store actual Googlemaps (satellite view) with it.
OSMDroid does not use Google Maps. There is no API in Maps V2 to cache tiles for offline use, at least not at the present time.
Or is it possible to first store the png images of the map tiles of that particular area in your asset folder and then use it.
You do not have Google Maps' map tiles as PNG images.
i am new to android. any help where to start from?
Use OSMDroid. Or, find some commercial mapping library that offers offline maps.

KMZ vector file over Google maps

I have a KMZ vector file which works fine on my Google Earth application, but i want to overlay this on my phone (android) through Google maps.
Is that possible?
A KMZ file is simply an archived structure, containing a main KML file and zero or more supporting files. I'm assuming you want the KML data? That's what represents the "route"-like content of the KMZ.
As far as displaying a KML file goes, it's been done before - check out this previous SO question - it involves parsing the KML with a SAX parser (or other compatible parsing class) and piecing it into a path. Once you have a list of coordinates, you can create a custom Overlay class, which could take in a coordinate list as an argument. Then, on the onDraw() method of the Overlay class you simply draw a path representing the list of coordinates. For more information on drawing routes, check this out.
If that's not what you're looking for, drop a comment and I'll see what I can do!

android + KML + support for "+to:" tag

I am facing a bit of problem with getting the route information from Google maps
I use the following url to get the complete route info. The query contains intermediate destination points
http://maps.google.com/maps?f=d&hl=en&saddr=45.414569,-75.707324&daddr=45.430579,-75.686953+to:45.436207,-75.684726+to:45.434764,-75.683417+to:45.43415,-75.682838+to:45.429996,-75.683098&ie=UTF8&om=0&dirflg=w&output=kml
This gives me back a kml file but the kml file contains route coordinates only till the first destination point and no futher however if i remove the output parameter, the google map draws all the destinations mentioned in the "+to:" clause
http://maps.google.com/maps?f=d&hl=en&saddr=45.414569,-75.707324&daddr=45.430579,-75.686953+to:45.436207,-75.684726+to:45.434764,-75.683417+to:45.43415,-75.682838+to:45.429996,-75.683098&ie=UTF8&om=0&dirflg=w
How to get all the route coordinates in KML including all the intermediate destination points
Thanks
surya
Same question as How to get KML of route with waypoints?
Bottomline: multistep routing is only supported inside google maps and not through the downloaded kml.

Categories

Resources