I have a particular need with a mapView and i can't find any good solution.
I have a Mapview with some markers displayed on it, and it works perfectly.
My need is that i want to put a kind of layer/background on the screen, in order to "mask" the map, but i always want to see the markers, and keep all the mapview functionnalities (zoom, move, etc.)
Is there any solution available to do it?
I hope you understand my need.
Many thanks in advance.
Create an overlay that mask (cover) the part of the map that you want to cover. In the onDraw() of this oevrlay just draw something that achive your mask requirements (areas, colors and opacity).
To ensure that markers are always visible, you need to add the overlay with markers after you add the overlay that mask map to the mapView.getOverlays.add().
Enjoy it.
Related
I want to create an overlay over map so that when map is scrolled the center/marker will be fixed and i can get Location data from that point.Take a look at image for what i want to achieve.
I google a lot Please Suggest me little how to achieve this functionality.I don't think it's possible using ground overlay.
I need to finish my thesis.
I want to make like an GIS on my android.
All I need is build android application that can show the map, draw polygon overlay on it, add house button in it, and save as an image.
I'd already know how to show Google-Maps on my android, but I don't know how to draw polygon overlay on it.
All I need seems like this screenshot.
http://i.stack.imgur.com/CcMIE.jpg
thank you.
To overlay the two needed surfaces, you can use the merge tag. take a look at this tutorial
I'm developing an application in which i have to show a map with the aim on it. just like it is on the picture. When a user drags map with a finger, map is moving and the aim isn't. I can make a translucent layout over the map, but can't understand how to draw a transparent circle. Please give me some ideas. Thanks!
I suppose it depends how you're drawing the translucent overlay, but if you were using Canvas methods, you can try with the clip methods to intersect with a path. http://developer.android.com/reference/android/graphics/Canvas.html#clipPath(android.graphics.Path)
I have balloon popups showing in Android MapView when a user tap:s on specific points on the map. Depending on where the user taps the balloon does not always fit insize the MapView. I solve this now by using MapController.animateTo to always have the tapped point in center. However, this is not the way I prefer it to be. I would like to animate the MapView only so much that the balloon layout fits inside MapView.
Any tips on how this can be solved?
One way to fit the balloon overlay is to override the dispatchDraw method, check the bounds of the display using getMeasuredWidth and getMeasuredHeight, and, draw the balloon such that it fits within the display area.
I am not sure if you have seen the Android MapView Balloons project on github. I have been using this code for a while and it is excellent, may be you can find some pointers to your problem from there.
Hope this helps.
I can locate the pin for corresponding locations in MapView. I want to animate that pin dropping down onto the map.
How to use animation for that? Any ideas?
first of all, take a look at this tutorial that explains how to create pin overlays:
http://www.androidguys.com/2008/09/09/maps-itemizedoverlay-and-you/
then note the onDraw method of the inherited overlay.
that's where you can animate the bonds in which the pin is drawn.
Check out
http://developer.android.com/guide/topics/graphics/2d-graphics.html
It will show you how to use tween animations and transormations.