google-maps-api-2

Adding multiple markers in Google Maps API v2 Android

喜欢而已 提交于 2019-12-17 10:29:14
问题 I want to add multiple markers in my map, but I don't know the way. At the moment, I'm using this, and it works correctly: Marker m1 = googleMap.addMarker(new MarkerOptions() .position(new LatLng(38.609556, -1.139637)) .anchor(0.5f, 0.5f) .title("Title1") .snippet("Snippet1") .icon(BitmapDescriptorFactory.fromResource(R.drawable.logo1))); Marker m2 = googleMap.addMarker(new MarkerOptions() .position(new LatLng(40.4272414,-3.7020037)) .anchor(0.5f, 0.5f) .title("Title2") .snippet("Snippet2")

How to get center of map for v2 android maps?

╄→尐↘猪︶ㄣ 提交于 2019-12-17 10:16:18
问题 In Google Maps for Android v1 , MapView had a convenience method: getMapCenter() . Now I cannot figure out how to get map center with v2 of this api. I have perused the API documentation, but there is no mention of such a feature. Please advise. Thanks, Igor 回答1: I had the same problem. It seems you can get the center this way: mMap.getCameraPosition().target where mMap is the GoogleMap instance from your activity. This will return a LatLng object which basically represents the center of the

Android - SupportMapFragment with GoogleMaps API 2.0 giving IllegalArgumentException

淺唱寂寞╮ 提交于 2019-12-17 04:27:16
问题 I am trying to use the latest Map API 2.0 provided for Android. I am using the Support Library as I want to support Android 2.2. Following is my code: Main Activity class public class MainActivity extends FragmentActivity { public FragmentManager fManager ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fManager = getSupportFragmentManager(); Button showMapButton = (Button) findViewById(R.id

Find distance between two points on map using Google Map API V2

谁都会走 提交于 2019-12-17 02:05:34
问题 I am using google map api v2 in my android application, I am able to show the map and put markers on it, but now I am stuck with the problem in which I need to find out the distance between two markers or points placed on map, I have already gone through the docs but didn't find anything helpful in this case. If anyone knows how to solve this then please help me. Thanks 回答1: You can use the following method that will give you accurate result public double CalculationByDistance(LatLng StartP,

Google Maps [API] view is gray on my mobile device

喜夏-厌秋 提交于 2019-12-14 03:51:32
问题 Hi guyes I really need your help. I've read the instructions on how to use Google API on this link: https://developers.google.com/maps/documentation/android/start I've followed all seven steps but I couldn't display Google Map in my app. [I have already got tired from trying to get the Emulator to work so I've decided to generate an APK file instead and send it to my smartphone] After intalling the app, once I open it I can only see a grey screen and 'Google' signeture at the bottem left of

“Google Play services are updating” in Google Maps API

时光怂恿深爱的人放手 提交于 2019-12-14 00:50:23
问题 I have an Android app which makes use of Google Maps. All of a sudden, it stopped working in release mode. The Map view tells Google Play services are updating on the emulator and on real devices. Searching on the net everyone talks about the API key file, but this is not my problem! I have tried every possible different combination of release settings, and I have found out that the problem occurs when I set debuggable = false in the build configuration (with debuggable = true it works). I

Could not find class 'gpr', referenced from method gps.a

最后都变了- 提交于 2019-12-13 17:08:30
问题 I don't know why this error is occuring. I didn't update anything. I generated new keys from the google api console but the error is stil appearing. I wanted to do this example [Android SearchView widget with Google Places API][1]. debug->res->values->google_maps_api.xml I also have a release folder with the same structure and I entered the same key in both files. Log: 3151-3151/com.example.onur I/Google Maps Android API﹕ Google Play services client version: 4242000 07-18 10:28:13.655 3151

getLastLocation() always null in GoogleApiClient

我的梦境 提交于 2019-12-13 14:16:46
问题 Am trying to build an application that requests the current location using the GoogleClientApi and LocationServices, but the Location is always null even that I enabled the WiFi,Mobile Data and GPS , tested it on several devices all the same the permissions from the manifest.xml : <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android

Google Map showing Blank

故事扮演 提交于 2019-12-13 07:35:49
问题 I have Developed an application that have Google Map functionality so i use new google play services library but when i launch Google map activity its showing map but blank so what is wrong with my code my manifest file xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.apa" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="18" /> <permission android

onLocationChanged just called once using network provider

被刻印的时光 ゝ 提交于 2019-12-13 07:31:48
问题 i have a problem using location listener and location manager. I'm using class that i found on the Internet public class MyLocationListener implements LocationListener { public void onLocationChanged(Location location) { home_text.setText("Location Change"); } public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } public void onProviderEnabled(String