android-maps-v2

custom info window adapter with custom data in map v2

ぃ、小莉子 提交于 2019-11-26 16:02:54
I want to make custom info window adapter in map v2 in android as like below. I have seen below link but doesn't get more. 1 , 2, 3 , below is my content layout file. <?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" > <ImageView android:id="@+id/infocontent_iv_image" android:layout_width="150dp" android:layout_height="150dp" android:layout_alignParentTop="true" /> <RelativeLayout android:id="@+id/infocontent_rl_middle" android

“Error inflating class fragment” with google map

孤人 提交于 2019-11-26 13:51:55
问题 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

get latitude and longitude with geocoder and android Google Maps API v2

旧时模样 提交于 2019-11-26 12:38:49
问题 I\'m using the Google Maps API v2 for android and works properly. However, I am trying to use geocoder to get the longitude and latitude of an address, but without success. It has changed the way to do it from the v2? I am using the conventional code Geocoder gc = new Geocoder(context); //... List<Address> list = gc.getFromLocationName(\"1600 Amphitheatre Parkway, Mountain View, CA\", 1); Address address = list.get(0); double lat = address.getLatitude(); double lng = address.getLongitude(); /

Google map for android my location custom button

本小妞迷上赌 提交于 2019-11-26 12:12:09
问题 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? 回答1: 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

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

人走茶凉 提交于 2019-11-26 11:18:18
问题 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

Android: How to draw route directions google maps API V2 from current location to destination

て烟熏妆下的殇ゞ 提交于 2019-11-26 11:09:30
How to draw route direction from current location to destination which (latitude and longitude), i have code as below: import android.os.Bundle; import com.actionbarsherlock.app.SherlockActivity; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class DetailMapActivity extends SherlockActivity { private GoogleMap map; @Override protected void onCreate(Bundle savedInstanceState) { super

duplicated id with fragment

非 Y 不嫁゛ 提交于 2019-11-26 10:59:37
问题 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

Change position of Google Maps API&#39;s “My location” button

我是研究僧i 提交于 2019-11-26 05:17:52
问题 I am using the Google Maps Android API v2, and I need a way to chance the position of the \"My Location\" button. I get the \"My Location\" button like this: GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); final GoogleMap map = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map)).getMap(); // This gets the button map.setMyLocationEnabled(true); 回答1: Just use GoogleMap.setPadding(left, top, right, bottom), which allows you to indicate

custom info window adapter with custom data in map v2

蹲街弑〆低调 提交于 2019-11-26 04:40:50
问题 I want to make custom info window adapter in map v2 in android as like below. I have seen below link but doesn\'t get more. 1,2,3, below is my content layout file. <?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\" > <ImageView android:id=\"@+id/infocontent_iv_image\" android:layout_width=\"150dp\" android:layout

Android: How to draw route directions google maps API V2 from current location to destination

断了今生、忘了曾经 提交于 2019-11-26 03:29:43
问题 How to draw route direction from current location to destination which (latitude and longitude), i have code as below: import android.os.Bundle; import com.actionbarsherlock.app.SherlockActivity; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class DetailMapActivity extends