Google Maps with custom map in Android - android

Is there a way to display a custom map using the Google Maps API and draw polylines on it using (x, y) coordinates? I am not interested in geolocation, since I just want to create a demo scenario for an indoor navigation app.

Depending on your needs you can use Tile Overlays that allows you to load your own map using the tile engine of the map or Ground Overlays that draws a fixed image on a given coordinate.
As both are map overlays you can still draw polylines, polygons, markers, ... on the map

Related

OpenStreetMap Android MapView load Tiles after Zoom

i am developing an android app using osmdroid. I am drawing an overlay on the map, depending where your current location is. Depending on the zoomlevel should the overlay get more details (level of detail). In other words, i have to draw the overlay on every zoomlevel. My Problem is the onCreate function is called only once and so is my function to draw the overlay.
I have to optimize the overlay algorithm. The overlay i am drawing on the map should be detailed as necessary and not more. On a zoomlevel of 0, it is not necessary to draw a little polygon with several thousands points.

Android Is it possible to change the appearance of the map in the google maps API

I have been searching in the documentation and throughout google. I would like to know if it is possible to place an image over the map the api comes from to use something else as a visual but with the maps gps functionality. Does anyone know if this is possible?
You can use two types of Overlays:
TileOverlays (reference)
A TileOverlay defines a set of images that are added on top of the base map tiles. You can also use tile overlays to add extra features to the map by providing transparent tile images. You need to provide the tiles for each zoom level that you want to support. If you have enough tiles at multiple zoom levels, you can supplement Google's map data for the entire map.
GroundOverlay (reference)
A ground overlay is an image that is fixed to a map. Unlike markers, ground overlays are oriented against the Earth's surface rather than the screen, so rotating, tilting or zooming the map will change the orientation of the image. Ground overlays are useful when you wish to fix a single image at one area on the map. If you want to add extensive imagery that covers a large portion of the map, you should consider a Tile overlay.

Android calculate bounding box for mapview

I am not using Google maps or Openstreet maps. I am using another third party custom maps which do not provide any bounding box classes or methods. So What i want to achieve is to zoom to fit all markers on the map or zoom to route drawn on map. Like Google provide LatLngBounds bounds = mMap.getProjection().getVisibleRegion().latLngBounds; classes and OpenStreetMaps provides zoomToBoundingBox() to achieve this functionality. I only have latlng points and map dimensions width/height. How can i calculate bounds or bounding box zoom level for markers or route drawn on map to fit it to screen? Any formula or mathematical calculations?

Show a moving bus in google maps api v2 android

I am trying to show the position of a moving bus in google maps api v2 in an android application. I am able to mark the stops and draw routes using the markers and polylines. Now, I am trying to have an image(bus/Marker) that moves along the route that is there in the map. I am using GroundOverlay to achieve this, but I am not able to re draw the moving image/marker using GroundOverlay.
The problem I am facing is that, as I am drawing the map in the OnCreate function, the map, markers, routes and all the positions of the moving marker are displayed only once at the end of the oncreate function. I think I am going in the wrong direction. Is there a way to redraw only the moving marker? Is it possible to have a view on top of a map and draw on the view using projection? (is this possible in V2? If Yes, do we have some demo or sample available online?)

Google Map API, with my own created Map figure

In android, is it possible that I would create my own Map figure, and then use this Map with the gps location from Google Map API
Example, I draw a map for my own house, then apply Google Map API to be able to make the location of each point in the map
Yes, I believe you can. A couple of options are as follows:
Draw your 'map figure' in an overlay - if the background is translucent, then you'll be able to see the Google map underneath.
Alternatively, use a dummy Google maps API key - in this case the MapView layer is rendered as a grey background but all the API calls appear to work. Again render your 'map figure' in the Overlay draw method.
In both cases, you'll have to ensure the map projection (scale, position, etc) match up with the coordinates of your 'map figure', especially if you scroll or zoom the map view.
It might be best going with the first option, initially, then you'll have a visual confirmation if you're code is correct.

Categories

Resources