I am working on a mobile Android map of my university campus using Google's Android map API. I have currently used Polygons to color in each building according to their faculty. I have also placed GroundOverlays to show where each food place/ATM is. However, the Polygon's seem to lay on top of the Groundoverlays, but I want the opposite to happen. Is this possible?
you must use Zindex to change the layering of items:
put polygons without setting zIndex (or set a low value), then put ground overlay zIndex to hundreds (or thousands) and you are done!
https://developer.android.com/reference/com/google/android/gms/maps/model/GroundOverlay.html#setZIndex(float)
Related
I'm developing an app which needs maximum zoom set to level way past upper limit in Google Maps V2 (for an indoor navigation). I'm looking for a level 22, 23 or even 24.
Two solutions came into my mind:
Max zoom limit in Google Maps can be overwritten.
Use translation and render one small tile into a big square build from nine tiles or more. Tile quality is not an issue for me.
Are any of these ways possible? Or maybe there is another map engine, that supports zooming past level 21? Thank you in advance for your help.
Maybe googleMap.setMaxZoomPreference(value), but I didn't try.
You can use inbuilt method,
googleMap.getMaxZoomLevel()
Using above method you will get maximum zoom level, you don't need to set it manually.
I want to make an Android App, with a real map and a overlay for the map, where sprites are drawn (can be dots or small images).
This is a rather hard question, so I have made a sketch of a map of a small city, where only roads and streets can be seen. That might look something like this on the device:
Imagine the red dots to be bots, and they want to get to the yellow dot, assuming they know the position.
What Android Map API should I use to be able to:
Draw custom sprites on a given location on the map (geo-coordinates rather than screen coordinates).
Generate valid paths from the streets and roads on the map, which the dots can move on (black lines).
Use pathfinding to calculate the shortest routes, e.g. from red dot to yellow dot.
Must be able to draw more than 10 sprites on the map.
(the map doesn't have to support 3d views or street views. Plain old top-down view is just fine)
If no map API exists that does not meet these requirements, what are some other solutions?
I'm really excited about this project, but I'm having a lot of trouble getting started with it, so any help or guidance will be much appreciated.
EDIT:
It seems that there is no answer to my question. I will leave this open and report back with my own solution.
Google Maps Android API v2 and Marker class.
All valid paths? You probably should not need it if you use Android API v2 with real map drawn for you, but you can also try to use Google Directions API.
Google Directions API.
No API exist that can handle more than 10 objects. You probably need something from NASA.
Have fun coding.
I need to find a open-source Java framework/library/api that would generate an map image with multiple coordinates markers. In particular I need to customize the shape of the markers (i.e. making the marker circle size bigger or smaller depending on external additional data). Moreover, it would be nice that the map would fit to the markers (so if I place markers only in Europe, the image would show Europe only, not the whole globe). Does any one know an Java API that has such functionality? I looked at things like geotools or jmapviewer but they seem to lack the features I require.
I've created a map I want to classify my map into Let's say hexagon grids like cellular networks so I can be able to color each hexagon independently, the only work around I found was to manually draw circles using the overlay class and the ondraw method, but in order to manually do so I'll have to create like thousands of circles. I need a hexagrid on the whole map so when I need to color a hexagon I just find it by Let's say it's name or number. does Android support such feature?
No, Android does not have a built-in hexagon overlay for Google Maps. It is conceivable that you could find a third-party component for this, but more likely you will need to implement it yourself.
I'm trying to develop a 2D game to android using opengl.
I know how to print images on the screen and animate them. But in my game I have a map and a want to zoom in and out and scroll the map. But I can't figure out the best way of doing it.
Can anybody help me?
I don't have any api examples but I did games design at college so I'll give my two bits.
The method you use will depend on your map style, size, functionality and format.
For example if you are looking for a very static non changing map, use a simple picture image. You can use the API frame for a picture view, enabling you to zoom in and out as you do in the gallery and to scroll on zoomed images, or in this case, zoom locations on your map.
Alternatively, if your map is based off a tiling system, a good example of this is the original Pokémon and Legend of Zelda games from the old game boy, then each area stores a tile 'thumbnail' for itself as a bitmap. These are then put into their appropriate locations on a grid depending on what areas are discovered.
This is the probably the most flexible way to build your map as you are not relying on a set bitmap for the entirety your map meaning it can change its look efficiently; you can build it as desired to show areas of choice (useful for if the map only reveals places the gamer has covered) and it also means you can do tile based overlay:
ie - if a certain area should contain treasure, theres a treasure icon overlayed on that tiles x,y position on the map grid.
I used the tiling option in my game projects from college and it made everything else map related easier. It also made the map side of things smaller storage wise.
The simplest approach would be to just call glTranslatef(-scrollX,-scrollY,0) followed by glScalef(zoom,zoom,zoom) before you render your map.