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.
Related
I need to use my own image as a map and place markers (or a small flag-image) dynamically on the map at different positions (x,y coordinates or l,t,r,b parameters) on the map based on certain criteria. I am having problems implementing it with 'ImageView', 'ImageMap' & 'Drawable' and have searched all questions on stackoverflow. Any help would be appreciated.
I did something similar to this for my very first app. Inside of my activity, I created a custom View class, where I overrode the onDraw method and drew my map image, flags, etc. This is the tutorial I used, I recommend you check it out: Anddev.org (you may not need to implement scrolling, but the rest of it should be relevant).
Alternatively, you can use the Google Maps API to display their map with Overlays but it doesn't sound like that's what you're looking to do.
You have to user Overlays for displaying images on a map. A very good tutorial is given in the official docs.
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.
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
Is it possible in Android to animate between two points in a Google MapView in a predefined number of seconds?
I want to write some sort of game where an object is flying from the start point to the end point. But the Object will be centered on the screen and the map shall be moved.
Do you have any idea how to do this? :)
Best,
kiwaque
Call animateTo() on your MapController.
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.