google-maps-android-api-2

Using one Google Maps API key for different android applications

让人想犯罪 __ 提交于 2019-12-05 08:15:05
I just generated the Google Maps API key to use in my android app. I had to provide the SHA-1 fingerprint and the package name for the application. It looked something like this: BB:0D:AC:74:D3:21:E1:43:67:71:9B:62:91:AF:A1:66:6E:44:5D:75;com.example.android.mapexample As you can see I had to provide the package name for the app. So, does this mean that I need to get a different API key for different applications? PS: Curiously, somehow, Google generated two API keys for the SHA-1 and package name combination I entered. Is this normal? And so, which one should I use? You can use the same

Google Maps Android Clustering OnCameraChangeListener() deprecated

自古美人都是妖i 提交于 2019-12-05 08:02:35
Using the tutorial here , I successfully implemented clustering in my Android app. Since OnCameraChangeListener() is now deprecated in com.google.android.gms:play-services:9.4.0 is there a new way to implement the part below? private ClusterManager<MyItem> mClusterManager; googleMap.setOnCameraChangeListener(mClusterManager); EDIT: I tried directly replacing setOnCameraChangeListener by setOnCameraMoveListener like googleMap.setOnCameraMoveListener(mClusterManager); This does not work since setOnCameraMoveListener() is expecting an object of class OnCameraMoveListener. Casting mClusterManager

Google Map API v2 - Get Driving Distance from Current Location to Known Locations

帅比萌擦擦* 提交于 2019-12-05 07:41:43
问题 I'm trying to figure out how to display the driving distance from the current location to four known locations. I'm not showing a map on the screen, I just need to display how many miles away the user currently is from those locations. I took an example from Here and modified it a little. It is bringing back the correct distance but I can't figure out how to pass in each of the 4 end locations, or differentiate between them. What do I need to do in order to get the distance to each of the 4

Strange exception from the new google maps v2

泪湿孤枕 提交于 2019-12-05 07:16:43
问题 I have recently came up with the following exception from one of the users that is using my application, has anyone got this sort of exception? Edit: It is a Confirmed Bug . Here is the stacktrace: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x10000000 (has extras) } in maps.z.bz@407c91c8 at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:722) at android.os.Handler.handleCallback(Handler.java:587) at android.os

Animate marker on Polyline path

故事扮演 提交于 2019-12-05 07:09:25
I have 3 markers on a Google Map. Two Markers to show starting and ending points Here is the code using to draw a Polyline between these two points: private void polyLine() { LatLng starting = new LatLng(##.######, ##.######); LatLng ending = new LatLng(##.######, ##.######); PolylineOptions line = new PolylineOptions().add(starting, ending); mGoogleMap.addMarker(new MarkerOptions().position(starting).title("Start")); mGoogleMap.addMarker(new MarkerOptions().position(ending).title("End")); mGoogleMap.addPolyline(line); } One Marker to show current Location [HUE_ROSE] And to animate marker to

Animated Transparent Circle on Google Maps v2 is NOT animating correctly

别等时光非礼了梦想. 提交于 2019-12-05 06:19:10
I was able to animate a basic circle on Android Google Maps v2, but I wanted to take it a step forward. I wanted the animated circle to be similar to Tinders animated circles, is that possible? Example: http://jsfiddle.net/Y3r36/9/ Right now, I am getting a fidgety animation that is very unacceptable. Here is my code: public void onMapReady(GoogleMap map) { double latitude = 33.750587; double longitude = -84.4199173; LatLng latLng = new LatLng(latitude,longitude); map.moveCamera(CameraUpdateFactory.newLatLng(latLng)); map.animateCamera(CameraUpdateFactory.zoomTo(13)); map.addMarker(new

Android map api-2 disable click

北城以北 提交于 2019-12-05 06:17:08
I'm in the middle of migrating one of my app to the Android map V2. I'm showing a marker on the map and don't want to send touch events to the map to change the position/zoom level etc. in the earlier version, i was able to disable touch by setting android:clickable="false" in the MapView . how can i do the same thing in the Android map V2? S.Prapagorn yourmap.getUiSettings().setAllGesturesEnabled(false); Figured it out myself. mMapFragment.getView().setClickable(false); 来源: https://stackoverflow.com/questions/14873288/android-map-api-2-disable-click

How to mark the Latitude,Longitude in Google Map ?

会有一股神秘感。 提交于 2019-12-05 05:04:10
问题 I am using Google Map. I have a array that have multiple Latitude and Longitude. I have a center point of Latitude Longitude. So I want to mark all the Latitude ,Longitude that comes inside the radius of 10 meters from the center point. Activity Code: LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); double longitude = location.getLongitude(); double latitude = location.getLatitude();

Blurry map tiles at start of android app based on google Maps API v2

ε祈祈猫儿з 提交于 2019-12-05 04:36:11
问题 I have an app including a Google Map APIv2. After starting the app the map tiles are blurry. (sometimes just some parts) The tiles are getting sharp, only when the user moves the mapview a little. Moving the mapview by code does not solve the problem. Any ideas? 回答1: I has similar issue where the map would render blurry/low fidelity until I dragged the map with finger. The issue I think was because I was updating the map with googleMap.animateCamera(cameraUpdate); once every second but I wasn

Google maps - camera position with marker at bottom

二次信任 提交于 2019-12-05 03:39:32
If you look at google navigation, it always keeps the driver marker close to bottom and when you move the camera it offers to reset it back to bottom. I'm wondering how to achieve the same thing given a marker. There was a similar question before , but the offered answers do not consider the map to be tilted which results in wrong projection. The current location marker always to bottom of the screen while moving also. For that we have to set map.setPadding(0,320,0,0); So, we set pdding top to the map 320 then it takes some space from the top of the screen. In your final code like this