Display toolbar for Google Maps marker automatically

The overlay that appears when a marker is clicked, is created and destroyed on-the-spot implicitly. You can’t manually show that (yet). If you must have this functionality, you can create an overlay over your map with 2 ImageViews, and call appropriate intents when they’re clicked: // Directions Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse( “http://maps.google.com/maps?saddr=51.5, 0.125&daddr=51.5, … Read more

Can I draw a curved dashed line in Google Maps Android?

You can implement the curved dashed polyline between two points. For this purpose you can use Google Maps Android API Utility Library that has SphericalUtil class and apply some math in your code to create a polyline. You have to include the utility library in your gradle as compile ‘com.google.maps.android:android-maps-utils:0.5’. Please have a look at … Read more

Setting a LongClickListener on a map Marker

I have another proposition. First i make the marker draggable: mapa.addMarker(new MarkerOptions() … .setDraggable(true); After you can make a listener setOnMarkerDragListener like this: mapa.setOnMarkerDragListener(new OnMarkerDragListener() { @Override public void onMarkerDragStart(Marker marker) { // TODO Auto-generated method stub //Here your code } @Override public void onMarkerDragEnd(Marker marker) { // TODO Auto-generated method stub } @Override public … Read more

How to use google map V2 inside fragment?

Create a frame for map in which it will be added in your xml layout <RelativeLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:id=”@+id/map_container”> <!– The map fragments will go here –> </RelativeLayout> Don’t include class=”com.google.android.gms.maps.SupportMapFragment” in xml either in your fragment class do get it manually inside onActivityCreated @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); FragmentManager fm = getChildFragmentManager(); … Read more

Google Maps V2 – Error inflating class Fragment

I know this is probably a dead thread but just in case someone stumbles upon here having an identical problem – your manifest might be missing the following meta information: <meta-data android:name=”com.google.android.gms.version” android:value=”@integer/google_play_services_version” /> Declare it within the <application> element and your code should work. I ran into the same issue following a youtube tutorial … Read more