android-maps-utils

Google map Background color for Map type GoogleMap.MAP_TYPE_NONE

╄→尐↘猪︶ㄣ 提交于 2020-08-09 09:11:29
问题 I have used Ground overlay of my floorplan added to Google Map. It loads up perfectly. Code is as shown below. override fun onMapReady(map: GoogleMap) { mMap = map; mMap.setOnGroundOverlayClickListener(this); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(DEFAULT_LAT_LNG, 1F)); mMap.setMapType(GoogleMap.MAP_TYPE_NONE); mGroundOverlay = mMap.addGroundOverlay(GroundOverlayOptions() .image(BitmapDescriptorFactory.fromBitmap(bitmap)).anchor(0F, 1F) .position(DEFAULT_LAT_LNG, floorPlanWidth

ClusterManager setOnCameraIdleListener

我的梦境 提交于 2020-01-13 00:50:14
问题 While trying to implement use ClusterManager , I noticed that the getMap().setOnCameraChangeListener(clusterManager) is deprecated. Looking at the android-maps-utils sample on Github, I noticed that getMap().setOnCameraIdleListener(mClusterManager); When I try doing the same, I get an error because the default ClusterManager class doesn't implement GoogleMap.OnCameraIdleListener . Yet, in my gradle file, I am using what seems to me, the latest maps-util libraries: dependencies { compile 'com

How to get LatLngBounds of visible region in titled map in andorid

帅比萌擦擦* 提交于 2020-01-03 03:01:08
问题 I tried the following code. LatLngBounds b = googleMap.getProjection() .getVisibleRegion().latLngBounds; LatLng bNE = b.northeast; LatLng bSW = b.southwest; It's not giving correct bounding coordinates if tilt is set to the map 回答1: As mentioned in the Google Maps API doc VisibleRegion, the visible region for a map's camera can be in the form of a rectangle in case the camera is centered over the map region which will give you correct bounding coordinates. While it can also be in the form of

couldn't run Google Maps Android API Utility Demo

喜夏-厌秋 提交于 2019-12-30 11:01:07
问题 i'm having problems to run the Google Maps Android API Utility Demo, it shows this error: 04-03 16:32:37.397: E/dalvikvm(2592): Could not find class 'com.google.maps.android.utils.demo.ClusteringDemoActivity', referenced from method com.google.maps.android.utils.demo.MainActivity.onCreate 04-03 16:32:37.452: E/AndroidRuntime(2592): FATAL EXCEPTION: main 04-03 16:32:37.452: E/AndroidRuntime(2592): java.lang.NoClassDefFoundError: com.google.maps.android.utils.demo.ClusteringDemoActivity 04-03

Remove the last polyline line from Google Map Android?

我与影子孤独终老i 提交于 2019-12-25 09:15:28
问题 I created a class that select latitudes and longitude from sqlite then mark on map then draw polyLine . Problem : Every time I select my records 100 to 100, when I saw first 100 then I clear map then I get second 100 but when I start animate it show me last polyline how I can clear last polyline ? My code : public class PathActivity_F extends AppCompatActivity implements OnMapReadyCallback { private GoogleMap mMap; Query_DB QDB; private List<Marker> markers = new ArrayList<>(); private final

Android Get the markers that are not clustered

不想你离开。 提交于 2019-12-23 17:53:26
问题 I'm developing an android application and I'm using Google Maps Android API Utility Library. To be more specific I'm using the cluster part of that library. Now to my question: I'm interested in the markers that are shown on the map but that are currently not clustered. I've tried different stuff but can't wrap my head around it. The thing that kind of works is to save all the rendered marker items in a arraylist then compare the marker positions to LatLng bounds of the map on screen, if the

Disable clustering at max zoom level with Googles android-maps-utils

北战南征 提交于 2019-12-23 16:24:53
问题 I'm clustering markers on a Google map in Android using the clustering from android-maps-utils. I want to disable the clustering when the map is at it's max zoom level (ie always render individual ClusterItems if the map is at max zoom level, otherwise cluster as normal). I'm able to almost get it working by doing a test for zoom level in shouldRenderAsCluster() in a custom class extending DefaultClusterRenderer. However my solution lags one step behind the actual zoom level. For instance if

How to temporarily disable map marker clustering?

﹥>﹥吖頭↗ 提交于 2019-12-14 03:46:28
问题 I am using Google Maps V2 for Android together with maps utils extension library for marker clustering. Some parts of app does not need to get clustered markers. Is there any way to forbid clusterManager to cluster markers and after certain conditions let it cluster items again? 回答1: I found myself another solution. I figured out that on DefaultClusterRenderer method shouldRenderAsCluster is responsible for whether the marker will be rendered as cluster or not. So I created a CustomRenderer

Google map Android API v2 - InfoWindow on polyline?

。_饼干妹妹 提交于 2019-12-13 13:07:42
问题 I am drawing polyline on my map,I need to show some data to user now. How I can draw text or InfoWindow on each polyline ? I add polyline like : ArrayList<LatLng> points = null; PolylineOptions lineOptions = null; MarkerOptions markerOptions = new MarkerOptions(); // Traversing through all the routes for(int i=0;i<result.size();i++){ points = new ArrayList<LatLng>(); lineOptions = new PolylineOptions(); String color = colors[i % colors.length]; // Fetching i-th route List<HashMap<String,

Adding items to cluster manager & call to cluster() have no effect until AsyncTask finishes

僤鯓⒐⒋嵵緔 提交于 2019-12-13 07:25:27
问题 My situation: I use an AsyncTask to prepare data for a google map. Because this task takes some time, I'd like to display the objects as they are ready (and not all at once when finished). So I use publishProgress & onProgressUpdate to update the map. I use the Google Maps Android API utility library to add the markers to the map. I call ClusterManager.cluster() after data changes to force reloading of the markers. The problem: Nothing happens. Updating a ProgressBar from onProgressUpdate()