Google Maps Android API v2 animate GoogleMap View - android

I am trying to animate that wraps the Google Maps Fragment in my layout. The following animation appears to have no effect.
ObjectAnimator mapAnimator = ObjectAnimator.ofFloat(view, "translationY", -view.getHeight(), view.getHeight());
I have tried wrapping the fragment in FrameLayout and animating that with no luck. I can only seem to hide and show the map with the FragmentManager.
According to this issue the Google Map uses a SurfaceView which can't be animated. I cannot find anything official to support this. Can anyone confirm?

I cannot find anything official to support this.
If "this" means the fact that Maps V2 uses SurfaceView, drop a ViewServer in your app, hook up Hierarchy View to your app running on a Maps V2-capable device, and see what you see. Cyril Mottier wrote comment #1 on the issue you cited; since he says it is a SurfaceView, I believe him.
If "this" means the fact that SurfaceView cannot be animated, that is confirmed by reading the documentation for TextureView.

Related

Android Map Extensions on zoom cluster transition

I was implementig maps extensions in my solution, and i cant figure out how to activate the cluster transition animation. There is a class called ClusterAnimator but is not used in the example.
So the question is, how can activate the cluster transitions in android map extensions implementation using the default clustering strategy?.
I want to get the same transition than the original maps library does on zoom in and out with the markers and clusters.
Have you set your clustermanager as the mapview's OnMapCameraChangeListener ?
Take a look at the BigClusteringDemoActivity demo-application, which does the following:
getMap().setOnCameraChangeListener(mClusterManager);
EDIT I wrongly assumed that the question was about Google Maps Android API utility library and its ClusterManager, which it wasn't.

sliding layout like google maps v7

Im trying to get the same result as new google maps, when you "tap" on any "marker" you get a little layout in bottom of the screen, all the info about the srteet view and other details shown there, when you hold and move your finger to top of the screen the layout moves and c over all screen or half of the screen. i was thinking use slidingDrawer but seems google depreceate this method on api 17. so how i can achieve this?
Im attaching the image of example:
you could look into using this SlidingUpPanel which appears to be exactly what you are looking for
Now from with Android Support Library 23.2 we can use Design Support Library: Bottom Sheets
Something that might be worth looking into is the answer to this question.
More specifically the answer that links here.
Basically the idea is that They realized that the sliding drawer left some things to be desired and they created a custom component with similar functionality. This will give you more freedom and a way around using deprecated classes. Let me know in comments if there's anything else that would be helpful to know.
Happy coding!

How to add basic grids to GoogleMap Api v2

I would like to add the basic grids to my GoogleMap that use to be on maps.
I read the docs but didnt found anything that could help, maybe the TileOverlay or GroundOverlay can do the trick, but i didnt found any examples or tutorials, not even in the official samples.
Can anybody suggest me some ways that could work ?
E D I T :
Yes i would like gridlines like this:
Seems like I have a code that does exactly that. I used it only for debugging, but here it is: DebugHelper.java.
Some notes:
you will also have to copy SphericalMercator.java
change IGoogleMap to original GoogleMap and IProjection to Projection
clusterSize parameter is in degrees, so you will have to change it depending on the zoom
finally: call drawDebugGrid in onCameraChange.
If you want to see it in action, you may run the demo of Android Maps Extensions. The only change you need to make to see grid is setting DEBUG_GRID to true on one of the first lines in GridClusteringStrategy.java.

View Animations alternatives for API<11

This google API tutorial shows how to animate Views. However it uses methods that are available from API level 11, such as View.setAlpha
Now, using a phone with android 2.1 (API 7) I can find many , many applications using the same kind of animations (the card flip animation is very popular)
Are there any Google libraries to do the animations shown in this tutorial that would work with ANY API prior to 11?
If not, any other alternatives?
P.S I am aware of this question But appearantly that was specifically about objectanimator and got an unuseful anser accepted
NineOldAndroids will be able to provide you with animation APIs that you see in 11+. For example...
ViewHelper.setAlpha(view, 0);
Easy animation such as transform, rotate, move (which it seems to be what you want) may be made with such classes as:
http://developer.android.com/reference/android/view/animation/AnimationUtils.html
http://developer.android.com/reference/android/animation/AnimatorSet.html
http://developer.android.com/reference/android/view/animation/Animation.html
In brief you will have create animation resources (or classes) and run it on views. After ending animation possibly you will have hide this view by visibility method.
Check this for details - http://jmsliu.com/779/android-view-animation-example.html.

GPolyline overlay in android MapView

I have a working mapview application in which I can hit a service and show GPoints on the map as overlay.
What I want to do next is show an encoded Gpolyline as an overlay on my mapView.
When I try to instantiate a GPolyline polyline object in my main activity, eclipse doesn't recognize the class. Is there a library import I am missing?
A quick example of adding a GPolyline to the mapView in an android application would be a great help.
I think the problem you're having is that there aren't GPolyline's in Android's version of Google Maps, they're Javascript/AJAX specific. What you want to do is draw out the lines manually in an Overlay or OverlayItem. See this answer, for more details on specifically how to do this.
The Hello, MapView tutorial has a short example on drawing to an Overlay and the com.google.android.maps package docs should show you what's available in Android's version of Google Maps.

Categories

Resources