I currently have an overlay set up in my app for google maps on a google maps activity.
The image lines up perfectly, but when you leave the area of the overlay you see the normal google maps view.
I want to hide everything except Custom Overlay, how can I go about doing that?
In order to prevent a user from zooming out from where I have the camera zoomed in and losing the custom overlay, can I lock the user to only be within certain gps coordinates? (The area covered by the custom overlay)
It looks like the answer is creating another overlay like I did, and like cYrixmorten said making it a huge size when putting it in. I used 10,000:
GroundOverlayOptions audubonTrailMap = new GroundOverlayOptions()
.image(BitmapDescriptorFactory.fromResource(R.drawable.trailmapimage))
.position(schlitzAudubon, 10000f, 10000f);
mMap.addGroundOverlay(audubonTrailMap);
Related
I am trying to make an indoor map of a hospital , when i click on certain buildings it would open their respective indoor maps and when i select a certain area of their respective floor it would show me further details.How can I achieve this?
Any suggestions would be appreciated.
P.S I have tried using image view but i can't get the image to scroll freely like a real map or a webview (pinch zoom in/zoom out ,rotation etc).
As you wanted your "floor" to have the behavior of a map you should have look for custom map implementations.
Then you may have found that you can use your own Tile Overlay using a Custom Map Tile Provider as described in Using custom map tiles with Google Map API V2 for Android?
Or if you don't want to use Google, you can look at Open Street Map Android SDK
Ether way you are still responsible for the graphical assets of tile layers. As well as any UI/UX leading to the custom map view.
Alternatively there are third-party libraries for 'deep zoom' of an image which may provide the expected touch behavior like: https://github.com/davemorrissey/subsampling-scale-image-view
You can have rooms as scolling views, with a background view image and buttons where you want to click. Clicking the buttons opens a popup with an image. You can also place transparent buttons on the buildings to have a natural feeling of click to open.
From your question it seems that you don't want to use web view, but you can code a regular html page/web app and use a web view to display it. That way, you only have a screen with a web view to deal with.
Then the possibilities are endless and fun and shifts in the web domain!
I'm using Tile Overlay feature of Google Map for Android to display custom map tiles, provided by third party service.
My problem is that, when user zooms the map, and it switches to next zoom level, already visible tiles are disappearing, and then getTile() method of my TileProvider implemetation is triggered. This causes unpleasant blinking of my map view, and moments when user can see only default map.
Standard Google Map behavior scales and "overzooms" currently visible tiles, until new ones are loaded. Is there any way I can create the same effect with Tile Overlay? I am aware that "overzoomed" tiles can be blurry, but that is ok in my case.
Remove custom tiles when zoom level changed is default Android GoogleMap behavior. To "suppress" it (showing previous map when tiles for zoom±1 level still downloading ) you can:
1) create GroundOverlay with screenshot of current map view. Screenshot of google map you can do like in answers for this question of DiscDev and remove it when tiles downloaded;
2) create custom view which extends MapView class like in this answer and show in overridden dispatchDraw() method whatever you want;
3) you can set ImageView over your MapView and show it with screenshot on it while zoom changed and new tiles loaded. And if necessary you can translate tap events from ImageView to MapView and so on.
I prefer p.2 - create MapView-based custom view, override dispatchDraw() and show temporary map within it while new map loading.
I've created an activity which shows a map v2. I would like to create a fixed pin at the center of the map. If panning around the screen the pin stays fixed at the view's center.
I've only found a tutorial showing how to create markers, but they keep they keep scrolling with the map when panning around. As an example, the UBER app uses this kind of fixed pin:
As you might see, the pin is in the middle of the screen and stays there also when panning around.
Any suggestions how to achieve that?
Some of the markers in google maps appear when zoomed in. However, when a user drag the map into a different place, the marker disappears, and when you drag it again on the previous place, the marker starts to animate in front of you (I hope you are getting what I'm trying to say). I want to know if there is such a way to do that. Thanks.
The same thing happens in Google Maps Android API v2 on street names, parks, etc.
There is no support for marker transparency as of this writing. You will have to code it yourself: posting to Handler until the animation finishes and setting new icon every "frame" with increasing opacity.
I have an app that use the old google map API and add a layer over the map to display a more precise map of my own over the map.
I'm trying to do this in the API v2 using the TileOverlay but the text of the google map are displayed over my tiles.
Here are 2 screenshots, one with the map, and one with the map with an overlay (just based on the API demo)
I tried to add a big Z-Index to the tiles without any results.
Is there any way to really cover the map with custom tiles ?
The reason why you keep seeing the labels, is that in google maps v2 the labels are rendered locally instead of being part of tile bitmaps. The benefit of this, is that you can rotate the map and still have the labels without rotation for easy reading.
Solution
The only solution I know so far is to disable the map base layer using setMapType(MAP_TYPE_NONE). However, this may have the undesireble effect of also disabling parts of the map that are not being covered by your overlay.
Regards.