google-maps-api-2

mapFragment.getMap() returns null

放肆的年华 提交于 2019-11-29 13:52:12
I'm trying to get a map from a SupportMapFragment but it returns null. From what I read this could be because the fragment is not yet fully displayed and therefore no map exists?! I tried fixing it using executePendingTransactions() but with no success so far. Any ideas how to fix it? Here is the code private GoogleMap map; private SupportMapFragment mapFragment; @Override public void onCreate( Bundle savedInstanceState ) { //... super.onCreate( savedInstanceState ); setContentView( R.layout.screen_mission2 ); GoogleMapOptions mapOptions = new GoogleMapOptions(); mapOptions.mapType(GoogleMap

Is it possible to show/hide Markers in Android Google maps api v2?

大憨熊 提交于 2019-11-29 12:33:54
问题 I would like (in my Android app using Google maps api v2) to hide or show markers on my GoogleMap object according to a category, just like in the google maps web api, for example: I have a GoogleMap with 50 Markers, 20 of them represent restaurants, 20 them represent bus stops, and 10 are cinemas. Is it possible on Android google maps api v2 to do filtering on these markers, by hiding all the restaurant markers if we un-tick a checkbox for example? I would like to do something like that but

Customizing clickable area on a Marker in Google Maps v2 for Android

丶灬走出姿态 提交于 2019-11-29 10:04:00
I am currently using Google Maps v2 API for Android and doing some custom overlays. For starters, I create a custom bitmap that is quite a big larger than the standard "marker". I know that using an older Maps API, you can create a custom overlayitem which controls the click-able area, but it must also be possible on the newer Maps API. I simply want my custom marker's click-able area to be the same as the custom bitmap icon I am setting it to. I have read over the examples and documentation and couldn't find anything. Any help would be appreciated. Thanks (Here is the doc I was reading) https

How to animate google map v2 marker on the polyline path?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 07:20:54
I already build an app using google maps V2 and put 2 markers on the map. First marker is to get user current location, and the second marker is user destination location. And then I add decodePoly method to draw line between those markers. I also add method to give user information about durations,start address and destination address using alert dialog. So, when I click the second marker, i want to animate that marker to "move" to first marker. But my problem is, the second marker is not moving on the polyline path. you can see at image below: This is MapActivity.java: @Override public

Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence referenced from method glt.a

老子叫甜甜 提交于 2019-11-29 04:52:55
I have an app where homepage is map. Do not know why i am getting this error and along with this error Could not find class 'gpr', referenced from method gps.a I have updated eclipse so i tried to change to API key with new SHA1 fingerprint. But that does not work. My app is to show current location when you open the app. It just landed into whole map but in LOG cat i get these error. Here is my Logcat `07-08 12:54:39.897: I/Google Maps Android API(25749): Google Play services client version: 5077000 07-08 12:54:39.907: I/dalvikvm(25749): Could not find method guj.a, referenced from method gqi

Google Maps Android API: SupportMapFragment vs MapFragment

心已入冬 提交于 2019-11-29 02:21:39
问题 I read through the google maps API documentation and under MapFragment, it advises to use the class only when targeting API 12 and above. Then I assume that SupportMapFragment targets API 11 and below, though google didn't explicit mention it in the documentation. Then what if I want to target a wide range of API lvl? Does SupportMapFragment also targets API above 11? 回答1: Then I assume that SupportMapFragment targets API 11 and below, though google didn't explicit mention it in the

How to disable android map marker click auto center

我们两清 提交于 2019-11-29 02:14:22
问题 I am looking for a way to disable my map fragment's auto centre on selected marker functionality. I still want the markers InfoWindow to show up, but just not centre the entire map on the marker I have selected. 回答1: Take a look at the following post: Don't snap to marker after click in android map v2 There is a method given there by @DMan , basically you need to consume the OnMarkerClick event and override the default behavior: // Since we are consuming the event this is necessary to //

mapview and cameraupdate in api v2

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 01:28:44
Why the CameraUpdateFactory class is not working in my project? The app crashes if it executes the following command: CameraUpdate pino= CameraUpdateFactory.newLatLng(new LatLng(location.getLatitude(), location.getLongitude())); If i remove that line (and of course the next one), the code successfully starts and shows the map. I need the mapView and i need to use the new api v2. I declare the mapView in layout in this way: <com.google.android.gms.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:id="@+id/mappa"

Equivalent of getBoundsZoomLevel() in gmaps api 3 [duplicate]

☆樱花仙子☆ 提交于 2019-11-28 22:34:38
问题 This question already has answers here : Google Maps V3 - How to calculate the zoom level for a given bounds (9 answers) Closed last year . In API v2, the map object had a handy method getBoundsZoomLevel(). I used it to get the zoom level which fits the bounds best, then manipulated this optimal zoom level somehow and finally set the desired zoom level. I cannot find similar function in API v3. (What a continuous frustrating experience when moving from v2 to v3) Do I really have to use map

Google Maps Android API v2: Visualizing the search radius with the helping of ValueAnimator

守給你的承諾、 提交于 2019-11-28 20:51:52
I want to add an animated circle to Google Maps view similar to the circle you see on this image. The circle should be pulsing from the center to the largest radius indicating current user's location and the area of searching. Here is relevant code block Circle circle = mMap.addCircle(new CircleOptions() .center(new LatLng(lat, lon)) .strokeColor(Color.CYAN).radius(1000)); valueAnimator = new ValueAnimator(); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { float animatedFraction = valueAnimator