google-maps-android-api-2

Clear markers from Google Map in Android

百般思念 提交于 2019-11-27 12:36:54
问题 I have added map on fragment activity and added several marker using addMarker function, but i am able to remove all markers , I am getting notification for different list of markers, Now i wants to remove all markers and add new one. one way to keep all markers in list and remove one by one, (marker.remove()) Is there any better way to clear all marker. 回答1: If you want to clear "all markers, overlays, and polylines from the map", use clear() on your GoogleMap. 来源: https://stackoverflow.com

Ensure that the “Google Maps Android API v2” is enabled. I am getting this error when I try to Implement Google Maps

核能气质少年 提交于 2019-11-27 12:23:06
I am working on google maps and I am getting this error. I had done the following things: Got My sha1 fingerprint. Registered my project and got my project key. I don't know to how to get Google Maps Android API v2 enable because all the links I have tried are old and Google had changed it's site design. Please help me. I already have wasted a lot of time on this. My Logcat: Authorization failure. Please see developers.google.com/maps/documentation/android-api/start for how to correctly set up the map. E/Google Maps Android API: In the Google Developer Console (console.developers.google.com)

Where is com.google.android.gms?

感情迁移 提交于 2019-11-27 12:20:04
问题 Today I updated Android SDK components to the newest version and somehow the whole com.google.android.gms package is gone. Instead, there is only com.google.android.maps with different classes than those in gms package. Is it a big change form Google or have I done something wrong? I have been using GoogleMap and LatLng classes to work with google maps and now I have just errors in my project. 回答1: Is it a big change form Google or have I done something wrong? com.google.android.gms comes

Google maps v2: Authorization failure

耗尽温柔 提交于 2019-11-27 12:19:37
问题 Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map. Ensure that the following correspond to what is in the API Console: Package Name: com.company.app , API Key: AIzaSyC***OsTeo , Certificate Fingerprint: 4E5285***6BF53ED3 Failed to contact Google servers. Another attempt will be made when connectivity is established. Failed to load map. Error contacting Google servers. This is probably an authentication issue

How to hide “Navigation” and “GPS Pointer” buttons when I click the marker on the android google map

╄→гoц情女王★ 提交于 2019-11-27 11:51:57
When I click the marker on the google map, "Navigation" and "GPS Pointer" buttons come out.How can I hide those two buttons programatically in android development? For the button group you have outlined in red, you can disable it using the setMapToolbarEnabled() method in UISettings . From the documentation: Sets the preference for whether the Map Toolbar should be enabled or disabled. If enabled, users will see a bar with various context-dependent actions, including 'open this map in the Google Maps app' and 'find directions to the highlighted marker in the Google Maps app'. Code example to

Android Maps API requires openGL es 2

假装没事ソ 提交于 2019-11-27 11:47:26
The Maps v2 documentation states: Because version 2 of the Google Maps Android API requires OpenGL ES version 2, you must add a <uses-feature> element as a child of the manifest element in AndroidManifest.xml: <uses-feature android:glEsVersion="0x00020000" android:required="true"/>` This notifies external services of the requirement. In particular, it has the effect of preventing Google Play Store from displaying your app on devices that don't support OpenGL ES version 2. In fact, it throws an exception if this is not in the manifest. I don't want to filter my app in the store, I plan to keep

zoom level listener in google maps v2 in android

自古美人都是妖i 提交于 2019-11-27 11:30:15
问题 I'm developing an Android app that is supposed to use Google Maps v2. Now i'm stuck at finding when zoom level of map has changed. Can anyone help me?Thanks in advance. 回答1: Create an implementation of OnCameraChangeListener, and pass an instance of it to setOnCameraChangeListener() of your GoogleMap. Your listener should be called with onCameraChange() whenever the user changes the zoom, center, or tilt. You find out the new zoom level from the CameraPosition object that you are passed. 回答2:

How to use google map V2 inside fragment?

时光毁灭记忆、已成空白 提交于 2019-11-27 11:29:07
I have a fragment which is a part of Viewpager, and I want to use Google Map V2 inside that fragment. This is what I have tried so far, In my fragment, private SupportMapFragment map; private GoogleMap mMapView; @Override public void onActivityCreated(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onActivityCreated(savedInstanceState); FragmentManager fm = getChildFragmentManager(); map = (SupportMapFragment) fm.findFragmentById(R.id.map); if (map == null) { map = SupportMapFragment.newInstance(); fm.beginTransaction().replace(R.id.map, map).commit(); } } @Override

Highlight a specified route on Google Maps v2 Android

孤者浪人 提交于 2019-11-27 11:23:12
问题 Right, so I'm currently using the Google Directions API in my app to retrieve the route between two locations. When I send a request for a route directions, I retrieve a number of details in JSON regarding the route including the names of every road along the route, their corresponding start and end lat-long co-ordinates, and their polyline value. For example: If I send the request http://maps.googleapis.com/maps/api/directions/json?origin=redfern+ave,+dublin&destination=limetree+ave,+dublin

How to show my current location in Google Map Android using google API client

[亡魂溺海] 提交于 2019-11-27 11:15:42
I want to show my location on a map and zoom in on it. I want to use the GoolgeAPIClient. The map renders and the the pointer is created but the location so wrong. I feel that the onMapReady is executed first even before the onConnected method of the GoogleAPIClient is called. Please help this is my code. import android.location.Location; import android.support.v4.app.FragmentActivity; import android.os.Bundle; import android.util.Log; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api