Skip to content

Instantly share code, notes, and snippets.

@mousebird
Last active October 4, 2019 21:32
Show Gist options
  • Save mousebird/6658dc58ed29949d081a to your computer and use it in GitHub Desktop.
Save mousebird/6658dc58ed29949d081a to your computer and use it in GitHub Desktop.
Marker Cluster Example
NSMutableArray *markers = [NSMutableArray array];
UIImage *pinImage = [UIImage imageNamed:@"map_pin"];
// Work through the locations
for (unsigned int ii=0;ii<howMany;ii++)
{
LocationInfo *location = &locations[ii];
MaplyScreenMarker *marker = [[MaplyScreenMarker alloc] init];
marker.image = pinImage;
marker.size = CGSizeMake(32,32);
marker.loc = MaplyCoordinateMakeWithDegrees(location->lon , location->lat);
marker.layoutImportance = 1.0;
[markers addObject:marker];
}
markerClusterObj = [baseViewC addScreenMarkers:markers desc:@{kMaplyClusterGroup: @(0)} mode:MaplyThreadAny];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment