Here API customization tools - android

I'm using Here Android SDK and trying to customize my map. I follow the example at enter link description here. But for some CustomizableVariables I can't assign color because I don't understand what exactly such parameter means. For example at mapbox has mapbox studio - it really simplifies the process of custom scheme creation. Is there anything like that for here maps?
It would be very useful at least be able to find specific areas on the real map, to decide what color or size to assign.
Maybe there is some way I can move the map to the area with specific CustomizableVariables? Or is there any docs, explaining what all such parameters means?

There is no high level user interface to mange map customization for Here Android SDK. The customization is based on using the available CustomizableVariables. For many of them, the naming is self explanatory. Otherwise it is a hit and trial approach to see how the variables affect the visuals of the map.

Related

OSMdroid and MBTiles: get area information

I am planning to build sort of a geography quiz app where you have to touch inside the borders of the searched country. So, I have to display a map (I want it to be offline) and be able to test the user click against the map in some way.
I've been searching a while now and found good OSM material from Natural Earth Data and TileMill for converting it to a MBTiles-file (sqlite-database containing all the png's and some meta-data too (using UTFGrid)).
On the Android-side, I would like to use OSMdroid for displaying the maps, mainly because it's open-source and highly maintained.
I've found some guides on how to use the MBTiles-database inside osmdroid but is there also an easy way to access the metadata or check otherwise if the user touched inside the right country area? I would like to avoid some sort of "boundary boxes"...
Any help is highly appreciated!
I'm pretty sure that bounding box calculation is best option.
Can you access metadata from the offline tile source? Yes, kind of. You can get a list of unique tile sources in the archive but that's it. There's an open issue regarding getting the bounds of a given offline archive. You can follow it here (or contribute)
https://github.com/osmdroid/osmdroid/issues/174
It's slightly complex because offline tiles are going to have a bounds per layer/source and per zoom level. There's also no guarantee that that bounds of that given zoom/layer is going to be contiguous. I.E. one zoom level can have both the US and western Europe in it.

MapBox Find terrain class by coordinates in Android

I spent several hours looking for simple solution and still haven't found one.
MapBox style editor uses this simple feature. That you can hover and click over map, and it shows small popup stating all terrain classes you enabled in your map.
Question, how to do it in Android version of MapBox given I have installed my style. Now I want click on any place in the map and get the same popup stating, for example, that this is building, woods, background here. Or other place would satte, that this is major road.
This IS doable as MapBox studio itself shows. i can't believe it uses some API not available for anyone, as this is one API no map provider gives, while still able correctly draw terrain. What so complex to add this API?
And NO I am not interested in address. I am interested exactly on terrain, for simple task - distinguiosh water from non-water, road from non-road, building, from non-building, don't care where it is by address, so reverse geolocation does not work. Or simpler - I need SIMPLER geolocation, than address.
Your questions kind of confusing but I'll try and help. If I'm reading correctly, you are trying to create an Android app that uses an API similar to Mapbox Studio that allows the user to select/distinguish the difference between objects on the map such as buildings, water, forest, etc.
If this is the case, then first you must understand that Mapbox Studio is using OpenStreetMap data to distinguish between objects. These objects are stored in a database with tags. It's tough to explain so i'll just leave a brief reading wiki page that might help.
To my knowledge, there isn't any API's specific to Android that will give you the kind of information you're looking for. However, if I was in your dilemma I'd take a look at the Overpass API as it's a complex query tool that allows you to send coordinates to it and it will return all the tags (such as building or water) at that location within a JSON object. From there you can parse and use the data in your app. It is very powerful so I suggest reading up on how to use it and test using a website called Overpass Turbo, that's if you decide to use it.
Nevertheless, I hope this helps and I understood your question correctly.

How to colour certain picture parts in Android?

I'm writing an app which allows the user to change the colour of countries on the world map by tapping on them. At the moment I'm struggling to find the apt way to store and display the map, allowing it to be partly coloured at the same time.
On of the solutions I had in mind was to use an SVG and a third-party library, but as far as I know none of them provides the necessary callback to modify the image once it's drawn.
I am merely at the beginning of understanding of what Canvas is, but even now it is clear to me that drawing such a complex object as a world map on Canvas is way too hard. It will probably take ages to load as well.
I have not implemented any of the mentioned things yet. I assume there is a better way that most developers use, so I'd like to find out what it is.
After more than a year I have finally found a working solution.
Google Map's Android API Utils provide a great means of applying various overlays to Google Map views and fragments as well as changing their individual components.
I went with a geojson layer upon the map and updated the fill colour of certain features.

I need help to integrate OpenStreetMap with Android

Good Morning,
Part of my question uses the word OpenStreetMap instead of osmdroid because part of what I need is a map visual reference/preference for users of my app but I need a grid reference of a map not just lat/long. I believe it was a link from SO that lead me to this: http://dhost.info/usngweb/USNG_OL.html. This is very much what I had in mind for the visual side of my app. The grid is right there. In other words part of what I need has already been created.
The author of the grid in above link uses JavaScript to create the grid of the Military Grid Reference System, which I am familiar with from IBM's tutorial - and zip j-coordconvert.
My question:
1.) In the above link there are radio buttons to switch from the type of map and also the meter zoom. Would it be good advice to use an Action Bar to allow user's to adjust these preference's? Has this also already been done?
2.) If the advice is to use an Action Bar - once user has selected a preference he/she will go to another choice with the original selection seldom changing - would I build that Action Bar up so that I have http interface with the above OpenStreetMap? If your advice was not to re-invent the wheel and use http to reference the already created grid, I would want to grab user's preference is there a code snippet to get the selected preference from http into Sqllite?
This last question my end up being the biggest part of this set off questions - getting the zoom level from http into Sqllite.
Of note:
-Will, at first only be needing one rather big city in U.S. so can cut tiles needed down
-Need rather quick solution on map side as other parts of app will take longer, so can build up my own map grid over time
-Could cut out the selecting of different map types but not grid zoom
-Using latest version of Android Studio
-Familiar with retrofit
-Referencing Busy Coder's Guide 6.6
-Would prefer to stay in Java rather than JavaScript
-Will be targeting newer phones/Android version above 3
I know this is a lot to ask but I am rather new to Android and my head is swimming with the amount of information out there (a good thing).
Thanks,
Terry
There is no "preference from map source to sqlite".
If you need to provide a TOC (that selector on top right) you need to build up your UI and do the logic for enabling/changing layers (what you see on the map).
You can use Google Maps API (v2) to have the map (just set the map type to NONE and add openstreetmap as a TileProvider, there's a lot of examples, just google it).
For the grid, a brief look at the page source code seems that the grid is created by javascript and is not a webservice that provides tiles (isn't it?). If so you have to create your logic that creates the tiles given the coordinates, this is a bit long to do, but you could look at some code online, for example Google I/O app has something with SVG files:
https://github.com/google/iosched/blob/master/android%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fsamples%2Fapps%2Fiosched%2Fui%2FSVGTileProvider.java
About preferences on enabled layers you can use SharedPreferences.

Creating an application using the google maps api that has a custom layer over top

So, my question is somewhat of an odd request I think. I was an intermediate java programmer making android apps a couple years ago, but I quit for other things. Now I'm back with a new and (I think) somewhat bold idea and I need help.
I'm wanting to know if it is possible to utilize the google maps api to act as a base for another map that I layer over the top. Think of it as I'm changing the way the map looks and that's about it.
I'm wanting to create a mobile app that has a map with a new/different look than what the base and satellite views have for a set small area of the city. Think of it as something like taking any old image and slapping it over the top of the google map and still being able to navigate with it (obviously if it was a random picture you wouldn't be able to see where it was taking you, but in theory you could essentially create a new map).
Is this possible in both java and obj c?
As far ask I know, you can't add your own tile layer to the Google Maps API for Android. However, you can use osmdroid and add your own tiles. You could also use mapsforge for Android. It comes with it's own tool for creating custom map tiles.

Categories

Resources