Update cluster Items after adding
How to updated cluster Items after adding them without need for removing then re-adding them ?
I assume that you were referring to updating cluster item's position? If it is the case then you can call [clusterManager cluster] again after your update(s). Remember that for good performance, perform all your updates and call [clusterManager cluster] at the end.
But _items array is not accessible from outside so I can update the data
I'd imagine you could hold on to the items in a separate array when you add them to the clusterManager.
Items will passed by reference or value ?
By reference so you only need to update them in your original list.
@chlebta Have you got any luck? Can I close the ticket?
@mountainvat a question related to this. Imagine that we have a huge database and all the items will be markers on the map. Do we need to download all the information we need first and only after that update the cluster manager? This can cause a long delay before anything is being showed to the user. Do you know if there is any other way to handle this without losing performance? E.g. updating the cluster manager every time a marker is added.
Is the database on the mobile or on a server? If it is on a server, it is probably best to do some server side filtering. So you'd give the server your latitude ,longitude range of interest and the server will only return items within that range for example. Downloading all items to the client is not very scalable.
Closing this issue out as stale. Please re-open if this is still an issue. Thanks!
Hi, I have an array of cluster item and i am updating the position of particular cluster item, but the app is getting crashed. All i want a way is to update position of particular cluster item.
I am doing something like this: item.position = Some coordinate clusterManager?.cluster()
Following is the error i got when i updated the position. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'All items should be mapped to a distance'
Can some please tell me how to do it. Really appreciate quick response because i am stuck into this.
the same issues.
check lat: if lat > 85 || lat < -85 { //don't add clusterManager.add(item) } it a little code make app not crash, but I don't know why it run.
I ran into this issue too and it was due to using invalid lat long values.