Comments (5)
Are you calling clusterManager.cluster()
after you call addItems?
from android-maps-utils.
Thanks for the report - do you have a minimal test case I can debug against?
from android-maps-utils.
Thanks for the quick response :)
so the case is.
I initialize map and add clusterMangaer and hook listners and then call addItems function in which i'm starting AsyncTask passsing clustermanger object to it and there i'm getting coordinates data via http request and on success of request m adding coordinates in clustermanger .. It works fine some of time but sometimes markers don't appear untill i zoom in or zoom out the map .. i've debugged i'm getting no error in data and even markers are there but they only show up on zoom in or zoom out .
from android-maps-utils.
great .. i wasn't .. thanks alot ..saved my day .. closing the issue.. thanks alot once again :)
from android-maps-utils.
I have a method that setMarkersOnMap(){...}
1.At first I clear items mClusterManager?.clearItems()
2.I add items to cluster manager by mClusterManager?.addItem(poi)
3.Simultanieously i the same loop I take only first 6 items in order to count LatLngBounds boundBuilder.include(poi.latLng)
4. When I leave loop I animateCamer according to the LatLngBounds
5. I call mClusterManager?.cluster()
When I call the function first time it works fine, after I call it again markers are not present unless I zoom out - what force IdleListener to make clustering. My Code is
protected fun setMarkersOnMap(poiList : List<POI>){
clearMap()
if(poiList.isEmpty()){
return
}
val boundBuilder : LatLngBounds.Builder = LatLngBounds.builder()
poiList.forEachIndexed { index, poi -> run{
poi.icon = getIconForType(poi.typeName)
poi.setAnchor(0.5f, 0.6f)
mClusterManager?.addItem(poi)
// Add new coordinates in order to establish map zoom
if (index < 6)
boundBuilder.include(poi.latLng)
}}
mClusterManager?.cluster()
// Adjust Map zoom to Marker position
val mapPadding = Tools.dpToPx(12) // offset from edges of the map in pixels
val mCurrentLatLng : LatLng = LatLng(mLocation.latitude, mLocation.longitude)
boundBuilder.include(mCurrentLatLng)
val latLngBounds = boundBuilder.build()
mGoogleMap?.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds, mapPadding), cameraUpdateListener)
if(!isClusterManagerListenToMap){
handler.postDelayed({
// listen for changes. After Zoom will be updated we set ClusterManager listener
isClusterManagerListenToMap = true
mGoogleMap?.setOnCameraIdleListener(mClusterManager)
mClusterManager?.cluster()
}, 500)
}else{
handler.postDelayed({
mClusterManager?.cluster()
}, 500)
}
}
from android-maps-utils.
Related Issues (20)
- Adult HOT 2
- Upgrade some of our libraries HOT 1
- Kmz with empty coordinates HOT 3
- Add a REQUEST_DENIED value to the StreetMap Utility HOT 2
- ClusterItem position is centered at the bottom HOT 4
- Add support for Advanced Markers HOT 1
- Ability to specify `anchor` marker option for `ClusterItem`
- Refdocs stuck at v3.4.0 HOT 3
- Change documentation link to GitHub page HOT 1
- Set documentation title as "android-maps-utils" HOT 1
- A lot of unnecessary warnings HOT 1
- Add StreetViewSource parameter to fetchStreetViewData HOT 2
- Remove outdated CHANGELOG.md file HOT 2
- Add kml layer in compose HOT 1
- Creating Kotlin demos for android-maps-utils
- Add Header Check to android-maps-utils
- Improve javadoc descriptions to marker clustering algorithms
- java.lang.IllegalArgumentException : Unmanaged descriptor HOT 3
- Android Map development encountered Google Map deadlock issue: HOT 3
- Incorrect operation of the marker information window HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-maps-utils.