google-maps-android-api-2

Map not clickable around marker in Google Map SDK for Android

无人久伴 提交于 2019-12-06 04:10:14
I am building some app like image below, I want to force markers not to be clickable, but there is no setClickable(false) for Marker or MarkerOptions. Currently area around marker (see attachment) is not clickable ( click is passed to marker, not map) You have to use Overlay instead of marker in the Map to get exactly what you desire. You could follow this link, similar is done in JavaScript here . I found a way to manually handle clicks for markers. Add a touchable wrapper as described in this stackoverflow answer: https://stackoverflow.com/a/58039285/1499750 Add a gesture detector to your

Google Maps - making an animation like grab app to show the path direction

﹥>﹥吖頭↗ 提交于 2019-12-06 02:59:55
问题 I would like to make an animation which does a moving marker along a path. so i thought about how to do this using a marker that is slightly darker than the path line. and removing and updating its position very slowly so that it looks like its moving. but i just don't think that's what's happening in the video. because the market takes on the shape of the path entirely. it flows perfectly. here is what i have so far: fun showLineAtUsersLocation(loc_destination: LatLng) { val currentLoc =

Custom ViewPager to allow child GoogleMap control to scroll horizontally

瘦欲@ 提交于 2019-12-06 02:26:39
问题 I am using a GoogleMap (v2 api) inside of a Fragment inside of a ViewPager. The original issue I was having was that the ViewPager was capturing all horizontal scrolling gestures so the map could only be dragged if the user started in the vertical or diagonal directions. All horizontal dragging was captured by the ViewPager . I found that the solution is to create a derived ViewPager class and override the canScroll method. The View being dragged is passed to this method, so you can make a

Multiple InfoWindowAdatper's

故事扮演 提交于 2019-12-06 01:58:43
I have a map in which I am creating different types of markers. I cannot assign an info window adapter to a marker (gee wouldn't that be nice), I can only assign on InfoWindowAdapter for the entire map (at least I think). My problem is that I want to show a different type of info widow depending on what I clicked. Id the only way to set one InfoWindowAdapter that will handle creating the correct type of info window based on the marker that I am passed? Am I missing something easy? When you add a marker to the map, you are receiving back an ID, which uniquely identifies your marker. You can

add multiple ClusterManager to Google map

◇◆丶佛笑我妖孽 提交于 2019-12-05 22:08:57
问题 I am trying to use two ClusterManager for Google Map , But I am able to add only one clustermanager and it's item click event, googleMap.setOnMarkerClickListener(mClusterManager); and mClusterManager.setOnClusterItemClickListener(new OnClusterItemClickListener<Person>() { @Override public boolean onClusterItemClick(Person item) { Log.v("Cluster Click", "Item Click:"+item.getName()); return true; } }); How can I add one more clustermanager to googlemap? Thanks in advance. 回答1: yes, delegate

Android Google Map circle shape

允我心安 提交于 2019-12-05 21:32:53
I need to show google map in the circle shape like on picture below. The solution I'm using right now looks like this: <packagename.views.SquareWidthRelativeLayout android:id="@+id/map_wrapper" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:id="@+id/map_fragment" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent"/> <RelativeLayout android:id="@+id/map_button" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/map

android maps v2 crashes when reopened in fragment

梦想与她 提交于 2019-12-05 20:22:36
问题 google maps v2 android loads the first time and then I am switching to other fragments which works when I come back to map fragment it crashes.I have attached the code below :I really appreciate any help .Thanks in Advance. code for map in fragmentMain: public class FragmentMain extends Fragment { TextView textView; static final LatLng HAMBURG = new LatLng(53.558, 9.927); static final LatLng test = new LatLng(53.551, 9.993); private GoogleMap map; public FragmentMain() { } @Override public

Android marker custom infowindow

你。 提交于 2019-12-05 18:49:03
I am using Google Map V2. I need to show the ListView (custom ListView with Image) in custom InfoWindow . I tried it and got success only in View , the problem is I can't get the listItemClick event. googleMap.setInfoWindowAdapter(new InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { // TODO Auto-generated method stub return null; } @Override public View getInfoContents(Marker arg0) { View v = getLayoutInflater().inflate(R.layout.infowindow, null); try{ String[] names = {"The Mayfair (D22) Condominium, For Rent","The Mayfair (D22) Condominium, For Rent","The Mayfair (D22

MapView - Android

核能气质少年 提交于 2019-12-05 17:21:51
Hello I'm trying to add MapView to LinearLayout this is my code: GoogleMap mMap = mMapView.getMap(); if (mMap != null) { CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(-33.87365, 151.20689), 10); if (cameraUpdate != null) mMap.moveCamera(cameraUpdate); setUpMap(mMap); } documantation says; Wait for a GoogleMap to become available from a MapFragment or MapView that you have added to your application. You can verify that the GoogleMap is available by calling the getMap() method and checking that the returned object is not null. But i still get java.lang

Every 1 Minute Gps LatLong Getting From Server Showing In Map as Marker. But Marker Geting Duplicating

岁酱吖の 提交于 2019-12-05 17:04:13
1.In My app Gps LatLong is Getting from Server Every OneMinute. Saved in Shared Pref ,then getting the LatLong From shared pref Showing the Marker on the Map . 2.Every One Minute I want to Move the Marker based on the LatLong. 3.But While Changing the Marker Location. Getting Duplicates . Please Help me to Solve this Issue. Inside Oncreate method i Called below Snippet in Every 60 Secs for Calling a Method. try { Thread t = new Thread() { @Override public void run() { try { while (!isInterrupted()) { Thread.sleep(60*1000); getActivity().runOnUiThread(new Runnable() { @Override public void run(