google-maps-android-api-2

Along with title and snippet how to add extra data to marker?

微笑、不失礼 提交于 2019-12-06 22:32:19
问题 Problem : My remote server returns 10 multiple value for a request.i parsed my response and using for loop i added markers(here i added info to title and snippet) on a map.(here i want to add extra data to marker so that i can access it in on info window click event) in infoWindowClickListener i want to access that extra data. How to add extra data to marker/ how to access ph data for a particular marker click(other wise i will get last value of ph in all markers). i tried like this. private

Android PlaceFilter usage with Google Places API

冷暖自知 提交于 2019-12-06 21:22:48
问题 I am trying to use the Google Places API and I would like to filter my search to only gym types. I am using the code given at https://developers.google.com/places/ public void onPickButtonClick(View v) { // Construct an intent for the place picker try { PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder(); Intent intent = intentBuilder.build(this); // Start the intent by requesting a result, // identified by a request code. startActivityForResult(intent, REQUEST_PLACE

How do I get my current location in Google Maps API V2

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 19:36:56
问题 I'm creating an app where the user needs to see his/her geo location with getMyLocation(), but this is returning null. Is there any solution for this, because I did read that the getMyLocation() method is always returning null. I'm new to Google Maps, so any help will be appreciated! Code: GoogleMap map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); map.setMapType(GoogleMap.MAP_TYPE_HYBRID); map.setMyLocationEnabled(true); Location myLocation = map

Google Maps Android API v2 detect long press on map and add marker not working

戏子无情 提交于 2019-12-06 18:49:57
问题 I want to add a marker on map with long press. Toast in onMapClick() was display with normal tap. But long press is not working. Toast in onMapLongClick() is not displayed with long press. Also marker is not displayed on map. I'm using SupportMapFragment because I want to use my application on Android 2.x devices. I have tested my app on Nexus One which has Android version 2.3.7. This is my code. public class MainActivity extends FragmentActivity implements OnMapClickListener,

Implementing polygons with Google maps API V2 in Android

风流意气都作罢 提交于 2019-12-06 17:23:51
问题 I implemented the Google maps API V2 on Android, I got the map to show and also the polygon to show using this code: public class MainActivity extends FragmentActivity { Polygon polygon; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GoogleMap googleMap; googleMap = ((SupportMapFragment)(getSupportFragmentManager().findFragmentById(R.id.map))).getMap(); LatLng latLng = new LatLng(35.20418,-90.08342);

Google Maps Android API: Authorization failure. Ensure that the “Google Maps Android API v2” is enabled. Ensure that the following Android Key exists

大兔子大兔子 提交于 2019-12-06 13:33:41
I am getting this error: E/Google Maps Android API: Authorization failure. Please see https://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 (https://console.developers.google.com) Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists: API Key: [The key...] Android Application (<cert_fingerprint>;<package_name>): Instead of the map working correctly, this is what I see: In my app/build.gradle , I have this: implementation 'com.google

Using Two SupportMapFragment in one Activity but unable remove Marker from Second SupportMapFragment that i have added in First SupportMapFragment

谁都会走 提交于 2019-12-06 12:28:23
I have strange issue while using Two SupportMapFragment in two different Fragment in one Activity. Actually my problem is let say In OneFragment i have SupprtMapFragment added and i add 10 Marker in that map view and now i go to detail page by adding another Fragment and in that it have also SupprtMapFragment now in this Fragment i want to clear it and want to show Only one pin but it Still Showing 11 Marker over map . Here is my Source code: public class MapActivity extends FragmentActivity { private FragmentManager mFragmrg; public static String TAG_FRAGMENT_HOME="HomeFragment"; @Override

Google Maps API v2 for Android: Cannot draw like deprecated Overlay

流过昼夜 提交于 2019-12-06 11:54:20
问题 I have developing an Android application, and I have moved from Google Maps for Android API v1 to v2. With deprecated version 1 I created an Overlay for drawing some colored shapes (delimiting zones) and info text over my map, but now I have been viewing API v2 and cannot do the same. I have trying to use Polygon property, but it doesn't fill with any colour, maybe because my shapes cannot be drawing in counterclockwise due to the pattern of them, for example a shape with 'U' pattern. Also, I

Google Maps API V2 android app on API level 8 up to 17

流过昼夜 提交于 2019-12-06 11:40:51
问题 I am working with the Google maps API V2 and it is going fine. i have a 2.2.2 android device wich i use to debug my app. now i just got a Galaxy Note 2, and when i try to debug on that device the app imidiatly crashed "project has stopped working". So i just made a small example to test with. and again it runs great on 2.2.2 but not on 4.1.1. this is the code i have for the small example exercise Any suggestions would be much appreciated My Layout <RelativeLayout xmlns:android="http://schemas

Maps Activity Blank after uploaded to Play Store [duplicate]

情到浓时终转凉″ 提交于 2019-12-06 10:42:05
问题 This question already has answers here : Published App on Play Store can't communicate with Google Maps API and Facebook API (6 answers) Closed 2 years ago . As mentioned in the title, the Maps Activity shows blank (with Google logo underneath) after I've uploaded the application. I am aware this question has been asked many times but none of the solution is able to resolve my issue. This is what I've done so far: Generated Google Maps Release API Key (with SHA-1 signature) following the