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.
Related
Just like for marker where we can put drawable for its icon, such as with Marker's .SetIcon(), how to do the same with Mapbox's polyline?
I've searched Google but, CMIIW, seems like there isn't a way to do that yet? Some links I think are related:
Github - Dotted Polyline on Android
Runtime Styling API
Any suggestion?
Unfortunately, Polyline doesn't support custom patterns. What I'd suggest is using LineLayer with PropertyFactory.linePattern() where you pass ID of an image previously added to the map via MapboxMap#addImage().
Here is an example activity that uses LineLayer.
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.
I made sample project for map MapBox its done but when i am terrain map type set its show perfectly but issue is example(label) shown. How can i remove for this issue? Help me thanks in advance.
I show issue for this image.
This library is open source. Go in and remove the label by editing the source code. There is not a public API for this.
I have a question . I'm trying to use MapView in Google Maps Android API v2 . I'm read in document . They said that
MapView, a subclass of the Android View class, allows you to place a map in an Android View. A View represents a rectangular region of the screen, and is a fundamental building block for Android applications and widgets. Much like a MapFragment, the MapView acts as a container for the Map, exposing core map functionality through the GoogleMap object.
It may be MapView and MapFragment are the same thing . In Google Maps Android API v1 , MapView extend MapActivity . But in Google Maps Android API v2 , I can use it any more . I see the tutorial
How do you display Google Maps via new Google Maps API v2 on Android?
They advice to extend FragmentActivity . But in my layout xml , I just use
<com.google.android.gms.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
It doesn't have prefix fragment like MapFragment . And when it displays , It looks like when I use MapFragment . May be both of them is the same thing ???? I'm not clear about that . Anyone can explain for me . Sorry my English is not good !!!
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.