google-maps-android-api-2

How do I get the coordinates of a map on tap with MapFragment (not MapView)?

霸气de小男生 提交于 2019-12-05 17:01:35
问题 I have searched around on how to get the coordinates of a location when the map is tapped. However, most, if not all the examples require a MapView as a parameter. For example: public boolean onTap(GeoPoint p, MapView map){ if ( isPinch ){ return false; }else{ Log.i(TAG,"TAP!"); if ( p!=null ){ handleGeoPoint(p); return true; // We handled the tap }else{ return false; // Null GeoPoint } } } @Override public boolean onTouchEvent(MotionEvent e, MapView mapView) { int fingers = e.getPointerCount

For Android Map api v2 Description references non existing library google-play-services_lib\bin\google-play-services_lib.jar

早过忘川 提交于 2019-12-05 16:48:51
问题 I have import google-play-services_lib into my workspace and Add google project into MYProject it give mr error: Description Resource Path Location Type The container 'Android Dependencies' references non existing library 'D:\Android Workspace\google-play-services_lib\bin\google-play-services_lib.jar' HBuddy Build path Build Path Problem Description Resource Path Location Type The project cannot be built until build path errors are resolved HBuddy Unknown Java Problem and I have already

Google Maps Android v2 not working with ActionBarSherlock Fragment Activity

♀尐吖头ヾ 提交于 2019-12-05 16:20:20
I've followed the steps on Using ActionBarSherlock With the New SupportMapFragment to use the new Google Maps Android v2 API, but I'm getting some errors that is causing the application to crash on startup. I'm using Maven on my application, so I'm posting my AndroidManifest and POM files too. Can you help me please? Here's the error from logcat: 12-22 14:35:41.319: ERROR/AndroidRuntime(8565): FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source) at com.google.android.gms

how to make maps work offline in google maps api for android?

时间秒杀一切 提交于 2019-12-05 16:13:16
I am totally new to this api and I was wondering if there is a way that I can use the maps offline. I don't mind the size of the application be large so if there are anyways involved caching or something else size related, it is not a problem Any suggestions? ps: if it is not possible in google's api,is there a way to do this with another api form another source which provides a mapping service? You can try to use osmdroid to work offline with Google Maps. Osmdroid is a replacement for Android's MapView class. It also includes a modular tile provider system with support for numerous online and

Google Maps API 2 MapView Not Updating

末鹿安然 提交于 2019-12-05 12:42:20
I'm displaying a Google Maps API v2 MapView in an Android app, but it's curiously not updating properly in a consistent fashion. I'm using the GPS to update the map position (tried both LocationManager and LocationClient) and although the map moves to the position, about fifty percent of the time either the street name layer fails to update or there's a fuzzy/blurry section that fails to update--until I do a manual drag (scroll) of the map. Then the entire map updates instantly. I've stripped out a lot of the processing in the app to see if I was somehow preventing a refresh, but it didn't

get bounds of a location in google map android v2

被刻印的时光 ゝ 提交于 2019-12-05 10:33:17
问题 Consider I have the LatLng of location A in the map. how can I get the Latlng of B and C position on the map? I want to get the bounds of the red box. EDIT: I want to get the bound of this box and limit the camera to that bound, so user can not change the camera and go outside this bound 回答1: The code I posted in this answer: MKCoordinateRegionMakeWithDistance equivalent in Android will get bounds for you. Usage: LatLngBounds bounds = boundsWithCenterAndLatLngDistance(centerPointPosition,

Cluster markers overlay by User's current location icon in Android

[亡魂溺海] 提交于 2019-12-05 09:30:38
I'm using google map that implemented Clustering marker inside. However, my markers has been overlaid by User's current location icon like Image below this is my code: protected void onBeforeClusterRendered(Cluster<CurationLocation> cluster, MarkerOptions markerOptions) { if (isAdded()) { final Drawable clusterIcon = getResources().getDrawable(R.drawable.oval_bg); mClusterIconGenerator.setBackground(clusterIcon); mClusterIconGenerator.setTextAppearance(R.style.AppTheme_WhiteTextAppearance); LayoutInflater myInflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE)

generating signature with SHA256withRSA rather than SHA1withRSA

做~自己de王妃 提交于 2019-12-05 08:47:31
I been trying to generate the sha1 key for using google maps v2 on windows7. According to google docs after running below command: keytool -list -v -keystore "C:\Users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android the output should be similar to this( https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2 ) Alias name: androiddebugkey Creation date: Jan 01, 2013 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate[1]: Owner: CN=Android Debug, O=Android, C=US Issuer: CN=Android

customize the pin of map Android

萝らか妹 提交于 2019-12-05 08:24:38
问题 Hello I would like to add a dynamic display with a number in my point. As in the picture, I already have the icons on the map. Adding the numbers in point? 回答1: You may use android-maps-utils to achieve such effect. Simply create 9-patch out of your pin with empty rectangle above and make rectangle be the content. Then use IconGenerator to create a Bitmap with your text and 9-patch like here: IconGenerator factory = new IconGenerator(context); factory.setBackground(your9PatchDrawable);

Converting a Drawable to a Bitmap to change the color of a Marker in Google Maps Android API v2

隐身守侯 提交于 2019-12-05 08:20:31
I'm converting an old application from v1 to v2, and I'm having a problem with the color of my Marker icons. I have a basic, white icon, and It needs to be colorized. In v1, I did it this way : Drawable d = DrawableUtils.resizeImageToDrawable( MapViewFragment.mapviewActivity, Configuration.Display.getDrawableFix(i), Configuration.MapView.getWaypointIconWidth(), Configuration.MapView.getWaypointIconHeight()); d.setColorFilter(color, Mode.MULTIPLY); overlay = new MyFplnFixListItimizedOverlay(d); Since v2 Markers do not accept Drawables for their icons, I thought about converting the Drawable to