Alternative API to Google Maps for displaying lines and shape - android

I am looking for an alternative for using Google Maps in my android application. I want my app to guide a person around routes, not roads or paths but following others tracks, and I think this will contradict the Google Maps T&C which states it can't be used for navigation.
Anyway I am mainly using the maps to display lines and shapes, as well as the positions of other users, in fact the maps are merely used as background.
Would anyone know of a good alternative which could be used in a commercial product. A mapping api would be ideal although I have even thought about plotting the lines and shapes on a canvas (I'm converting GPS coords to utm myself so this is not a problem), but I don't know if this would work??
Thanks for the help
Gareth

You can use osmdroid. From the documentation:
osmdroid is a (almost) full/free replacement for Android's MapView (v1 API) class. It also includes a modular tile provider system with support for numerous online and offline tile sources and overlay support with built-in overlays for plotting icons, tracking location, and drawing shapes.
You can use it in your project adding the dependencies:
repositories {
mavenCentral()
}
dependencies {
compile 'org.osmdroid:osmdroid-android:5.5:release#aar'
}

Related

Graphic below specific area in some Android Map API

I'm looking form maps API that would allow me to put pattern in some form (maybe graphic) below forest area, to have something like this (image below) and not only plain colour. Later on I would need to put such images on different areas and roads, also ability to put some 3D building on map would be great.
I found only ways of adding 3D objects and chagning area colours. Maybe I'm using bad words but only results on stackverflow and google were for custom background in markes.
Can you recommend some map API? (If you have some open-source project where I can see how its done it would be awesome. Thank you for your help.
After a lot o research I found the solution. It is to use mapbox with it's vector tiles.
proiblem - area overlay:
Using mapbox styles you can use background-pattern,
fill-pattern, line-pattern, fill-extrusion-pattern, or icon-image properties to overlay specific area type, so you can have even SSJ Blue Songo face covering whole forests :D. Vector tiles same as google API can be also colored as you like.
problem - 3D objects
3D objects like buildings can be placed in desired position, I even found some screanshots with mapbox and car placed on map.
Additionally it seams that when using Vector tiles you can use isometric view. Not yest tested, but form this tutorial it looks like it is possible. For all that hate paying for map services I found that you can host your own tile server and it will works as long as you provide tiles that are compatible with their tile specification.
Alternative solution I decided to use is to render vector tiles on your own. There are two good services to obtain tiles:
Mapbox tiles in MVT format - any zoom, to get tile just use link https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v7/{z}/{x}/{y}.mvt?access_token={access_token}
MapTiler Tilehosting tiles in PBF format - zoom max 14, PBF format is basically same as Mapbox MVT (same parsers might be used), to get tile just use link https://free.tilehosting.com/data/v3/{z}/{x}/{y}.pbf?key={access_token}
When decoding thies some Polygons might not parse properly, here is answer for that question:
Mapbox vector tile MVT is missing data
Rendered tiles can be used with google API by TileOverlay, this gives all Google API features and it is easy to use (mMap.setMapType(GoogleMap.MAP_TYPE_NONE); to disable all google map labels). Downside is of course tile rendering that needs to be done on your won, but for me this is positive, because I have full control on what is displayed (I use OpenGL ES, I recommend EGL14, off-screen rendering here).

Lag when too many Marker Using ClusterItem Android Maps API

I use the util library maps android for Cluster item.
I have many marker but It's too slow on navigation.
Is there a way to optimize this apps?
You can see this video : https://youtu.be/lboDrBmI6xo
Here are suggestions to Optimize Maps with Many
Makers:
One approach at simplification is to render markers on the server. Google provides two services built into the API that make this easy to
achieve: FusionTablesLayer and KmlLayer. If you'd prefer to perform
computations on your own server, this can be accomplished by creating
a custom overlay from imagery that is pre-rendered, or rendered on the
fly.
Another useful optimization technique involves viewport marker management: restricting the markers rendered on the map into only
those that exist within the viewable area.
If you still want to display many markers on the map, consider creating a custom overlay that displays markers with minimal
functionality. This approach may garner performance improvements over
standard markers provided by the API.
Read more on the docs for optimization tips.
I believe that marker clustering is the way to go on Android and we have a utility library to use for this. You can check it out here

Add own image in OpenStreetMap

I am trying to implement an android application using maps. On a little research, I have narrowed down to either GoogleMaps or OpenStreetMap.
Since GoogleMaps doesn't allow us to save(cache) the maps offline, i have decided to use OpenStreetMap(OSM). But in that the satellite imagery can't be viewed after a zoom extent. So am planning to add my own images in OSM.
Is it possible to do so?
PS: This is know if it is feasible. I haven't started implementation yet.

Offline Map Application Development Android

I have a project , android application with offline Map. user should download map once, or It should come with the app and then without internet be able to make marks and so on.
Can you give me Idea, which maps should I use, and little example . Thanks
You can use osmdroid
osmdroid is a (almost) full/free replacement for Android's MapView class. It also includes a modular tile provider system with support for numerous online and offline tile sources and overlay support with built-in overlays for plotting icons, tracking location, and drawing shapes.
Also see osmbonuspack

heatmap using android maps api v2

I am trying to build a heatmap using Google Maps for Android API v2. The intensity is based on the number of markers in the given area.
I have gone though http://code.google.com/p/mapex/ which is for API v1 and uses Overlays for generating the heatmap. I have modified the code partially to work for me via a View(I create my own custom heatmapview which extends view and in the draw(), I create those RadialGradient patterns).
I also found some basic info online that for API V2, we need to use TileOverlay and TileProvider, which I need help with. Seems like all the examples I see are getting the data through UrlTileProvider, which would not be feasible for me. I have a set of LatLng points with me and would like to use it only.
Can anyone give me some hint on how to proceed?
As of a few days ago, you can now use the Google Maps Android Heatmap Utility. From the link:
The Google Maps Android API Utility Library includes a heatmap
utility, which you can use to add one or more heatmaps to a Google map
in your application. Heatmaps make it easy for viewers to understand
the distribution and relative intensity of data points on a map.
Rather than placing a marker at each location, heatmaps use color to
represent the distribution of the data.

Categories

Resources