google-maps-android-api-2

android map in fragment

本秂侑毒 提交于 2019-12-01 09:03:59
I am trying to create a android app that has one activity and multiple fragments. Each fragment will ocupy the entire screen when it is in view and with a replace transaction it should be switched to another fragment. <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> This is the container for the fragments. The problem is that a fragment that I want to use is a GoogleMap. This is my code for the map fragment: public class Map extends Fragment{ private final static String TAG = "MAP Fragment"; public GoogleMap googleMap =

Remove default user's location icon

强颜欢笑 提交于 2019-12-01 09:03:11
Im developing an app using Google Maps v2 for Android and I managed to put a custom icon to the user's position but I can't remove the default one, so it overlays my custom icon like in the image: (It is that big just for now :p ) My code is like: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); map.setMyLocationEnabled(true); map.setOnMyLocationChangeListener(new OnMyLocationChangeListener() { @Override public

Map fragment V2 in a Fragment

試著忘記壹切 提交于 2019-12-01 08:39:57
I am facing some issue"Null pointer Expcepttion at getmap()" in Google Map Fragments . I want to insert mapfragment in a fragment Please review the code and let know whether I am taking the right appraoch or not .. and let me know what exactly I need to do with my code to make it work My Layout file : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@drawable/bg2" android:weightSum="100"> <Button android:id="@

google map - runtimeexception - error inflating class fragment

谁说胖子不能爱 提交于 2019-12-01 08:23:43
问题 I just try to view a map on the display, but it does not work. I get an runtimeexception: 01-17 19:16:47.066: E/AndroidRuntime(6605): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.maptest/com.example.maptest.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment Java: import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps

How to manage click on marker which is not in Cluster in Android Google Map API?

五迷三道 提交于 2019-12-01 08:20:59
问题 I am having trouble implementing OnClickListener for Marker(s) which are not in Cluster, i.e. not added using: mClusterManager.addItem(markerCluster); I have set OnMarkerClickLister as follows: mMap.setOnCameraIdleListener(mClusterManager); mMap.setOnMarkerClickListener(mClusterManager); If I just use: mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker marker) { return false; } }); the click on markers is not working at all. For

how to show multiple marker on google map android

旧街凉风 提交于 2019-12-01 08:20:37
问题 i want to show location with multiple markers on google maps android, the problem is when i run my apps, it just show one location/marker, this is my code : public class koordinatTask extends AsyncTask<String, String, String> { @Override protected void onPreExecute() { super.onPreExecute(); setProgressBarIndeterminateVisibility(true); } protected String doInBackground(String... args) { String url = "http://absc?action=p04&prov="+link_kode+"&tipe="; JSONArray data = null; try { JSONParser

Android - Google Maps Extensions - IllegalArgumentException

亡梦爱人 提交于 2019-12-01 08:19:48
I'm getting an IllegalArgumentException when I call this createMarker() method: private void createMarker(GoogleMap map, MarkerOptions options, OnMarkerCreateListener listener) { Log.e("LazyMarker", "Options var val: "+options); Log.i("LazyMarker", "GoogleMap Value:"+map); Log.i("LazyMarker", "OnMarkerCreateListener Value:"+listener); marker = map.addMarker(options); //Log.i("LazyMarker", "The value of Marker is:"+map.addMarker(options)); if (listener != null) { listener.onMarkerCreate(this); } } Here is the logcat output: 06-14 11:40:38.627: I/OGT.RideTracking(25590): Map value is: com.google

Customize marker of myLocation Google Maps v2 Android

对着背影说爱祢 提交于 2019-12-01 07:54:16
问题 I'm developing an android application that uses google maps v2. But i have a problem. I want to customize blue dot point(marker) of myLocation that google map gives us. Somebody can tell me how to customize this?? I want to change blue marker for an image and put a info window associated to marker. Thanks. Regards. 回答1: As of version 3.1.36 of the API v2, the blue dot cannot be changed. I suggest not enabling the blue dot and instead using LocationClient and the location data to display

android map in fragment

烂漫一生 提交于 2019-12-01 07:20:51
问题 I am trying to create a android app that has one activity and multiple fragments. Each fragment will ocupy the entire screen when it is in view and with a replace transaction it should be switched to another fragment. <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> This is the container for the fragments. The problem is that a fragment that I want to use is a GoogleMap. This is my code for the map fragment: public class

Google map touch on bottom sheet dialog

浪子不回头ぞ 提交于 2019-12-01 07:15:31
问题 I have a google map fragment on the top of my bottom sheet dialog. I disabled the draggable touch action on the bottom sheet behavior so that I could control the map. The problem is that I can't scroll the map using up or down touch actions because of my bottom sheet draggable disabled. I was thinking to disable the touch action of the bottom sheet behavior when the user touches the map but I don't know how to do this. How can I fix this? 回答1: Try adding nestedScrollingEnabled="true" to the