rvlvr / revclustermap Goto Github PK
View Code? Open in Web Editor NEWSimple Clustering API for MKMapView
Home Page: http://revolver.be/blog/mapkit-clustering-for-ios/
Simple Clustering API for MKMapView
Home Page: http://revolver.be/blog/mapkit-clustering-for-ios/
If two or more annotation pin will have same coordinate then it never gets separate out
I think it should separate out at last most zoom level and shows two pins as like shows in without clustering.
Hi,
I'm not sure if it is already implemented in the current version.
I would like to prevent pins clustering and show single annotations if the visible pins count is < than a specified integer.
Thanks
i use story board how can i use this lib step by step Can U help me
Hi
Thanks for sharing this, it seems like quite a nice API.
I just tried it and failed because I think it doesn't support a Viewcontroller loaded from nib is this right?
Hello,
i have tried this code with iPhone 6 but it still give me crash.can you have any advice on that?i have a crash on when "REVClusterAnnotationView" when i tap on map, it crash on same time,this is not happen with any other iOS device.
The original method inherited from MKMapView seems to be messing up your clustering info. I think it's because it's not implemented in your custom REVClusterMapView.
I could solve it by adding the single pin using addAnnotations: with an array of one single object, so no problem. But I think It could be a nice feature to add to your component :)
I got problem in height of MKMapview in Revcluster map.
file of REVClusterManage.h ---> mapView.visibleMapRect.size.height
I got "0" (Zero) value in this height so no one pin adding into mapview.
please some one have this question answer then tell me solutions for it.
Maybe I'm wrong here, but I thought that if you decrease BASE_RADIUS I could see more annotations.
However BASE_RADIUS and MINIMUM_LATITUDE_DELTA are not used anywhere.
Everything else seems great!
When I turn on the user location
[m_MapView setShowsUserLocation:true];
Then I pinch to zoom in or out, the user location reanimates it's self as if It was just turned on for the first time. Rather annoying.
So, If I modify REVClusterMap so the MKUserLocaiton is not removed from the annotation collection as such...
- (void) mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
{
if( [self mapViewDidZoom] )
{
//[super removeAnnotations:self.annotations];
//self.showsUserLocation = self.showsUserLocation;
//Make sure we remove all the annotations first, except the user location
for (int i =0; i < [self.annotations count]; i++)
{
if (![[self.annotations objectAtIndex:i] isKindOfClass:[MKUserLocation class]])
{
[self removeAnnotation:[self.annotations objectAtIndex:i]];
}
}
}
//...rest of the code...
}
Then the user location does not reanimate it's self. Great!! However, the clustering has strange artifacts.
Sometimes I see clusters on top of other clusters. And the number of pins and clusters do not always add up. If I undo my changes then the strange artifacts go away.
Is there another way NOT to reanimate the user location each time the zoom is changed?
Or, if you try the code above, did you happen to solve the strange artifacts that show up?
Thanks,
Brian.
This should we have some flag for pins if we don't want to clustered any any.
This is a part of improvement but we should have this I think.
I currently have REVClusterMap integrated into my app. When the map first loads, it fetches objects from the network and loads the objects onto the map. Everything is fine until I reload objects (tap refresh). Objects aren't removed from the map until after I scroll (regionDidChange:animated). I call removeAnimations: but doesn't seem to perform anything, until I start scrolling.
[self.mapView removeAnnotations:self.allPosts];
self.allPosts = [NSMutableArray array];
for (PFObject *object in objects) {
REVClusterPin *newPost = [[JSClusterPin alloc] initWithPFObject:object withIndex:[objects indexOfObject:object]];
[self.allPosts addObject:newPost];
}
[self.mapView addAnnotations:self.allPosts];
self.mapPinsPlaced = YES;
Any ideas why this is happening? I tried to implement the removeAnnotations: method in REVClusterMap like so...
- (void)removeAnnotations:(NSArray *)annotations
{
self.annotationsCopy = [NSArray copy];
[super removeAnnotations:annotations];
}
But no luck
I am implementing cluster map using REVClusterMap. Its Same as our requirement but some changes required.
Ex. I have 2 category of pin(Land, Building).
If cluster have same category pin with no. of count then for Land green and for building Blue colour of cluster count background.
And if cluster have both type of pin(Land & Building) then its showing combination of half-2 colour circle of cluster background.
So please suggest me a way.. of customisations of categorisation
how to turn off clustering on specific zoom level
Hi there,
I really owe you a beer for putting up REVClusterMap on Github, saved me a lot of time. Thank you.
I've got two views, one is your REVClusterMapView and the other one is a list of annotations. I want to replace the annotations when tapping a cluster pin with its clustered annotations.
I thought I had to implement this in
-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
which wasn't called until I seted the title attribute of the cluster annotations (MKAnnotation documentation says that you have to set the title attribute to show a callout and therefor call the delegate method).
Ok, the delegate method gets called but now I'm a bit lost how to access the clustered annotations within the cluster pin. I've found the RVSAnnotationCollection, so I think this should be possible, can you give me a hint?
REVClusterMap is a great project I found for this too long.
But found some problems in my project.
I'm addAnnotations for many times, and need keep old annotations, but seems i will lost the old annotations.
I'm looked into the code, I think the problem should happen in REVClusterMapView the functions regionDidChangeAnimated and addAnnotations
in addAnnotations
annotationsCopy = [annotations copy];
and after this I move the map, we will call regionDidChangeAnimated
[super removeAnnotations:self.annotations];
NSArray *add = [REVClusterManager clusterAnnotationsForMapView:self forAnnotations:annotationsCopy blocks:self.blocks minClusterLevel:self.minimumClusterLevel];
we remove all, and just add new.
we have below code
for ( REVClusterBlock *block in clusteredBlocks )
{
if( [block count] > 0 )
{
if( ![REVClusterManager clusterAlreadyExistsForMapView:mapView andBlockCluster:block] )
{
[newPins addObject:[block getClusteredAnnotation]];
}
}
}
return newPins;
in + (NSArray *) clusterAnnotationsForMapView:(MKMapView *)mapView forAnnotations:(NSArray *)pins blocks:(NSUInteger)blocks minClusterLevel:(NSUInteger)minClusterLevel
method.
How can I manage the clusteredBlocks so that they deal with the whole map and not only on visible rect of map.
i wanna show custom callout view and center annotation view when user touch annotation pin,but there is some problem.When I called center map region and add my custom callout view in - (void)mapView:(MKMapView *)mapView
didSelectAnnotationView:(MKAnnotationView *)view u will remove all annotation view,
and my custom callout view is also removed.
Please help me thx
Hi
When add new annotations to the map, the one that you have already added are deleted. Is that something that is needed for the API?
I am able to get title and subtitle of single annotation by selecting single annotation pin. But how can I select clustered annotations and get the title of all pins included in that cluster. For example, If I have a cluster of 5 pins. I want to get the title and subtitle of all the 5 pins.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.