Android Google Maps Maritime charts layers - android

I'm looking at displaying a map within my Android app that presents maritime charts, and also needs to work offline as there will be no network connectivity of any type available. I suspect that I will get my maritime charts supplied as a series of bitmap files with LAT/LON references of the area clipped.
My question is this - how do I go about implementing this ? I guess I have to add them as a layer somehow, can someone show me how to do this ?
Also, as the device will be offline, will there be a problem trying to use Google maps even if all the content is held locally, will the API just "not work" until it has connectivity ?
Thanks in advance.

As this just earned Tumbleweed, I thought I should update it.
I tried really hard to use the Maps API offline, with my bitmap as a layer - it didn't work out. The API is too reliant on the interweb and just seems to timeout when trying just about anything.
Simple solution, I have just extended the ImageView class to display my bitmap chart & overlays.

Related

SnapRoads - how to?

I've implemented a Google Location Api on my app to track my routes. I record my coordinates in a sqlite Db and then save these coordinates as a GPX file to see on map parsing and build via polylines.
There are a lot of points.
I see that unfortunately the position not seems follows the road even if I drive/walk in the middle of it.
Searching with google I've founded SnapToRoads as part of Google map API but, unfortunately not for Android, even if it seems that is possible to implements (but I don't know in which manner).
I wonder if someone knows how to solve this problem or some workarounds
At the end, I implemented SnapToRoad API to solve this problem, even if I have to use my key on source code (if I don't want implement a web site with Javascript)

Storing (caching) Google map with given radius and using it while offline

First of all if this one is a duplicate, please refer me to the original thread(s), as I have failed to find the exact thing I was searching for.
Basically for some time now I am developing an application for the client and it was all going well up until this point.
The client requests to be able to
I) While online:
Access Google map
Set the point by clicking on map
Store a portion of the map around the above mentioned point locally as per the radius he/she selected (eg. 3km)
II) While offline:
Access the map he stored in above steps.
The application should draw the path as he moves as per GPS coords received from another device via BT.
The ability to zoom in/out, scroll around map and everything else that standard google map allows.
I am completely lost on this one and would like at least someone to point out the right direction for something like this.
I'm well aware how to handle most of the above while Android device is online, but have no idea how to do this while offline.
I pretty much need help with I-3, II-1, and maybe II-3.
PS. I don't really need BT tutorials and guidance (mentioned in II-2), that part is handled, I just pointed out the source of coords.
Cheers
You can use TileProvider. The TileProvider provides the images that are used in the tile overlay. You should be able to save portion of map and create your own tileprovider and access tiles locally.

How do I add markers to streets only - Android Development

After plenty of searching, I haven't yet found a solution that works for me and I'm really hoping someone here could help me. First I'll explain my problem, and then I'll mention some of the approaches I've attempted/considered so far.
Basically, I'm developing an Android app where markers randomly appear around the user's location. The catch is, the markers need to be placed on streets only.
I've been working with Google Maps Android API V2 but I'm trying to work around using anything with "limitations" such as 'geocoding'.
I've considered using different map API's such as Nutiteq but I've had some trouble implementing them. It would be nice to stick to Google since I've become familiar with it but I'm willing to try any suggestions you may have.
I have even considered loading up Google Maps API V3 in an html file so that I can use GDirections to load a path from one point to itself and then parse this data to Google Maps Android API V2 using JS but turns out GDirections has a limit as well.
Anyone have any idea how I can go about doing this? Even if the solution is hacky, it's still something.
I'm fairly new to Android Development.
Funny what you want to achieve. You don't need to load API V3 html. You can use directions api directly: http://maps.googleapis.com/maps/api/directions/json?origin=51,19&destination=51,19&sensor=false
It still has limitations, but is was like 2000 or something a day a device. And you don't want to put more than 2000 markers on single user's screen, do you?
This is easy to parse, for example with Gson.

Downloading specific maptiles to cache in OSMDroid

I am currently working on a school project and I am trying to learn the techniques on downloading OSM map tiles into the phone's local memory/cache, so that users are able to view the maps when offline.
This is to be done by giving a specific location, and the map tiles that are within specific radius/distance from the location will be downloaded into the phone memory (when there is online connection) for offline display.
However, I am having some slight trouble in understanding OSMDroid's APIs. From my understanding, it seems that the classes involved are:
MapTileBase
MapDownloader
IFilesystemCache
Please do correct me if I'm mistaken.
Also, in MapTileBase (which I believe is the provider), the getMapTile returns android.graphics.drawable.Drawable.
Is this Drawable class even related to the concept of offline map display?
Hope someone can enlighten me on where exactly maps are being called to be downloaded into the phone's memory, and how we can edit the maps to display interface items such as routes, pins, etc.
I don't have an exactly answer as you're looking for a method to cache offline outside of an area the MapView hasn't already navigated to. The built in caching support is there, but not exactly how you want to do it.
You're going to need online download capabilities if you plan to cache and not just supply your own offline map tiles. I would take a look at the MapTileDownloader and maybe try to implement your own version of it. The MapTileDownloader.TileLoader.loadTile() method takes a MapTileRequestState which I believe the MapTileProviderArray calls when a map tile is needed.
If you can replicate the existing MapTileDownloader's TileLoader functionality, you can probably inject your own relative MapTileRequestState or straight up MapTile's to the one requested. e.g. Take the TileLoader called MapTileRequestState, inspect it, figure out how to construct new MapTileRequestState/MapTile representing tiles outside the current view. It won't be easy though as you'll have to deal with the different zoom levels, and depending on the zoom level, the radius should be smaller, etc... A lower zoom level of 18 would have a larger tile radius than a higher 10.
Personally I was recently working on trying to work 100% offline so I don't have any example code to help. Good luck even though its been a couple of months.
First, go right the source
https://github.com/osmdroid/osmdroid
There's a few wiki articles that will help, especially the offline map tiles article. In short, use MOBAC or the tool osmdroid provides. OSMBonuspack also has a tool to perform the same task on device.
Map tiles are actually downloaded using this class
https://github.com/osmdroid/osmdroid/blob/master/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileDownloader.java

develop "custom maps" offine no roaming charge

Firstly I am new to the site and new to android development
I want to design a tour of a local town that would run on android mobile phone. Its a historical tour so I want to to use my own custom map to represent the period and use GPS to figure out where the person is.
As it is for tourists who more than likely are roaming I do not want to connect to the internet. I have figured out that this rules Google maps and overlaying a customer map on it.
I'd be very grateful if someone could direct me to an alternative solution. A few pointers to put me on the right path would be great
You may want to check out Osmdroid which is a map library for OpenStreetMap data. if you really want your own custom map then it is possible with osmdroid but I have no experiance of it. A simpler solution would be to use the OSM data and contribute any updated you need to the map of your area to get it good enough for you. You do have the option of having static map data with Osmdroid so you can use it ofline.
There are a number of other libraries but Osmdroid is the one I use and am farmiliar with.
When using Eclipse, in the DDMS perspective, make sure the correct device (propably emulator-any ) is selected and highlighted. Only then will you get the logcat output in the logcat view.
Also, the Android plugin is a bit quircky, and sometimes only shows the last line in the logcat view. If this happens, try to clear the log. After that, you should get all the log entries again

Categories

Resources