android-maps-v2

“Error inflating class fragment” with google map

…衆ロ難τιáo~ 提交于 2019-11-27 07:53:11
I tried to make a sample project using Google Map, but I couldn't. Help me please! Test Device : Android 4.0.4 Error Message : 12-29 23:45:32.605: E/AndroidRuntime(9437): FATAL EXCEPTION: main 12-29 23:45:32.605: E/AndroidRuntime(9437): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test_googlemap/com.example.test_googlemap.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment 12-29 23:45:32.605: E/AndroidRuntime(9437): android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1968) 12-29 23:45:32.605: E

Google map for android my location custom button

谁都会走 提交于 2019-11-27 06:50:29
How can I change google map my location default button? I set my location enable and map draw standard image to find location, is it possible to change default image? See below xml file to custom button: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <fragment android:id="@+id/maps" android:name="pl.mg6.android.maps.extensions.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" />

Google Maps API v2: How to make markers non-clickable?

孤街醉人 提交于 2019-11-27 06:00:07
问题 I mean if i click marker OnMarkerClickListener is called, so the OnMapClickListener did not. Even if i set mMap.setOnMarkerClickListener(null); marker object still masks all click events for underlying map and objects. How can i set Marker transparent for all user interractions? 回答1: This is indeed a "limitation" of markers as of 3.1.59 version of the library. If you really need them to be markers, please post a feature request on gmaps-api-issues for MarkerOptions.clickable and Marker

Google Play services out of date. Requires 3025100 but found 2012110

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 05:55:49
问题 I'm using the Google maps v2 in my app and am debugging it in the emulator. Since the update on the 26th Feb I now get this error message Google Play services out of date. Requires 3025100 but found 2012110 I now wonder if anyone has the updated files necessary to run google play services rev 5 in the emulator? I've tried to run the app with rev 4 of Google play services, but the emulator is not having it and asks for me to update Google play services. Does anyone have any other ideas perhaps

Is there a way to implement rounded corners to a Mapfragment?

£可爱£侵袭症+ 提交于 2019-11-27 04:40:17
I want to give the map a nice looking rounded corners as the two boxes below it have. I can't do it with the map fragment it self because there is not a background property to a fragment. setting the map inside a layout and setting it background to a rounded shape didn't help me as well and this is the result: I could merge the map but this would make it smaller and i would like to avoid it. EDIT: @Ryan this is the new result #2: I guess this is not bad, no even close to the corners on the other boxes, but still not bad with a little more work a could get somewhere close i just dont have a

duplicated id with fragment

浪子不回头ぞ 提交于 2019-11-27 04:01:17
I'm trying to applicate drawernavigation (my first fragment is a map & the others are just some fragments with simple layouts).So it runs fine & I can navigate between my fragments but when I return to the first fragment which is a map I got a crash logcat: 11-20 11:03:27.306: E/AndroidRuntime(13787): FATAL EXCEPTION: main 11-20 11:03:27.306: E/AndroidRuntime(13787): android.view.InflateException: Binary XML file line #6: Error inflating class fragment 11-20 11:03:27.306: E/AndroidRuntime(13787): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697) 11-20 11:03:27.306: E

Google map android API V2 crashed

守給你的承諾、 提交于 2019-11-27 03:33:06
问题 I want to load the google map API on my android. I try everything I search but it still crash. this is my MainActivity.java package com.example.androidmapsv2; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle

TileProvider method getTile - need to translate x and y to lat/long

跟風遠走 提交于 2019-11-27 01:22:02
问题 I’m porting an iOS app to Android, and using Google Maps Android API v2. The application needs to draw a heatmap overlay onto the map. So far, it looks like the best option is to use a TileOverlay and implement a custom TileProvider . In the method getTile , my method is given x, y, and zoom, and needs to return a bitmap in the form of a Tile . So far, so good. I have an array of heatmap items that I will use to draw radial gradients onto the bitmap, each with a lat/long. I am having trouble

How to change the position of a Marker on a Android Map v2

☆樱花仙子☆ 提交于 2019-11-27 00:54:19
问题 I need to do the following: I have a Marker on the map and I need to change the position of it. So I tried the following: MarkerOptions a = new MarkerOptions() .position(new LatLng(50,6))); map.addMarker(a); a.position(new LatLng(50,5)); where map is a GoogleMap . I think I have to refresh the map or somthing equal? 回答1: Found the solution, Need to do it like this: MarkerOptions a = new MarkerOptions() .position(new LatLng(50,6))); Marker m = map.addMarker(a); m.setPosition(new LatLng(50,5));

Restoring MapView's state on rotate and on back

痴心易碎 提交于 2019-11-27 00:07:16
问题 Background I have a larger application in which I had/have several problems with new Google Maps API. I tried to describe it in a different question but since it seems too complex I decided to start a new project, as simple as possible and try to reproduce problems. So here it is. The situation I'm using Fragments and want to put MapView inside. I don't want to use MapFragment . The sample project I prepared may be not very beautiful but I tried to make it as simple as possible and it had to