bguidolim / TiClusteredMapKit

MIT License
3 stars 1 forks source link

Map cluster #1

Open ankesh27 opened 9 years ago

ankesh27 commented 9 years ago

Does it supports map clustering? If yes, how ?

I donot see any example.

bguidolim commented 9 years ago

Hi Ankesh.

I'm sorry, this module doesn't have any documentation, I will provide it sometime. Yes, it's enables clustering map automatically. Yes, it's possible to use a custom view as pins and get the pins count.

bguidolim commented 9 years ago

Here is a sample: https://gist.github.com/bguidolim/aeb922d9959529766802

ankesh27 commented 9 years ago

Seems like the longitudeDelta and latitudeDelta is not working, I am unable to zoom map to a certain level.

Also, does it support all default listner of Ti.MAP ?

ankesh27 commented 9 years ago

Sorry my mistake, I was Implementing it wrong.. It does change :)

Sorry to bug you again and again but how do i capture the event once the user moves the MAP.

regionChanged seems not to be working.

ankesh27 commented 9 years ago

@bguidolim can you please check on the various event listeners. Seems they are not working/responding.

bguidolim commented 9 years ago

They are not implemented.

ankesh27 commented 9 years ago

Well I managed to add regionChanged event listener in the module. The other thing that I am stuck with is the click event of the cluster, The click on list should return the object of all the Annotations in the cluster. Any Idea on this ?

ankesh27 commented 9 years ago

Here is the code for region changed, please add this inside the method _regionDidChangeAnimated_

Request you to please help me out in getting the objects of all the Annotations under the cluster.

[self.clusteringController refresh:YES];
     NSMutableDictionary* theDict = [NSMutableDictionary dictionary];
    [theDict setObject:NUMFLOAT(mapView.region.center.latitude) forKey:@"latitude"];
    [theDict setObject:NUMFLOAT(mapView.region.center.longitude) forKey:@"longitude"];
    [theDict setObject:NUMFLOAT(mapView.region.span.latitudeDelta) forKey:@"latitudeDelta"];
    [theDict setObject:NUMFLOAT(mapView.region.span.longitudeDelta) forKey:@"longitudeDelta"];
    if ([self.mapViewProxy _hasListeners:@"regionChanged"])
    {   //TODO: Deprecate old event
        NSDictionary * props = [NSDictionary dictionaryWithObjectsAndKeys:
                                @"regionChanged",@"type",
                                [NSNumber numberWithDouble:mapView.region.center.latitude],@"latitude",
                                [NSNumber numberWithDouble:mapView.region.center.longitude],@"longitude",
                                [NSNumber numberWithDouble:mapView.region.span.latitudeDelta],@"latitudeDelta",
                                [NSNumber numberWithDouble:mapView.region.span.longitudeDelta],@"longitudeDelta",nil];
        [self.mapViewProxy fireEvent:@"regionChanged" withObject:props];
    }
    if ([self.mapViewProxy _hasListeners:@"regionchanged"])
    {
        NSDictionary * props = [NSDictionary dictionaryWithObjectsAndKeys:
                                @"regionchanged",@"type",
                                [NSNumber numberWithDouble:mapView.region.center.latitude],@"latitude",
                                [NSNumber numberWithDouble:mapView.region.center.longitude],@"longitude",
                                [NSNumber numberWithDouble:mapView.region.span.latitudeDelta],@"latitudeDelta",
                                [NSNumber numberWithDouble:mapView.region.span.longitudeDelta],@"longitudeDelta",
                                NUMBOOL(animated),@"animated",nil];
        [self.mapViewProxy fireEvent:@"regionchanged" withObject:props];
    }
bguidolim commented 9 years ago

Feel free to make a PR

— Sent from Mailbox

On Tue, Jun 2, 2015 at 2:50 AM, Ankesh notifications@github.com wrote:

Here is the code for region changed, please add this inside the method _regionDidChangeAnimated_ Request you to please help me out in getting the objects of all the Annotations under the cluster.

[self.clusteringController refresh:YES];
     NSMutableDictionary* theDict = [NSMutableDictionary dictionary];
    [theDict setObject:NUMFLOAT(mapView.region.center.latitude) forKey:@"latitude"];
    [theDict setObject:NUMFLOAT(mapView.region.center.longitude) forKey:@"longitude"];
    [theDict setObject:NUMFLOAT(mapView.region.span.latitudeDelta) forKey:@"latitudeDelta"];
    [theDict setObject:NUMFLOAT(mapView.region.span.longitudeDelta) forKey:@"longitudeDelta"];
    if ([self.mapViewProxy _hasListeners:@"regionChanged"])
    { //TODO: Deprecate old event
        NSDictionary * props = [NSDictionary dictionaryWithObjectsAndKeys:
                                @"regionChanged",@"type",
                                [NSNumber numberWithDouble:mapView.region.center.latitude],@"latitude",
                                [NSNumber numberWithDouble:mapView.region.center.longitude],@"longitude",
                                [NSNumber numberWithDouble:mapView.region.span.latitudeDelta],@"latitudeDelta",
                                [NSNumber numberWithDouble:mapView.region.span.longitudeDelta],@"longitudeDelta",nil];
        [self.mapViewProxy fireEvent:@"regionChanged" withObject:props];
    }
    if ([self.mapViewProxy _hasListeners:@"regionchanged"])
    {
        NSDictionary * props = [NSDictionary dictionaryWithObjectsAndKeys:
                                @"regionchanged",@"type",
                                [NSNumber numberWithDouble:mapView.region.center.latitude],@"latitude",
                                [NSNumber numberWithDouble:mapView.region.center.longitude],@"longitude",
                                [NSNumber numberWithDouble:mapView.region.span.latitudeDelta],@"latitudeDelta",
                                [NSNumber numberWithDouble:mapView.region.span.longitudeDelta],@"longitudeDelta",
                                NUMBOOL(animated),@"animated",nil];
        [self.mapViewProxy fireEvent:@"regionchanged" withObject:props];
    }

Reply to this email directly or view it on GitHub: https://github.com/bguidolim/TiClusteredMapKit/issues/1#issuecomment-107817082

ankesh27 commented 9 years ago

I am more of an Android dev, just learning the IOS stuffs and this is why I am stuck. However, I am happy to help. Great module, let's make it better :)