├── .gitignore ├── Documentation ├── Doxyfile ├── html │ ├── _o_c_algorithms_8h.html │ ├── _o_c_algorithms_8h_source.html │ ├── _o_c_algorithms_8m.html │ ├── _o_c_algorithms_8m_source.html │ ├── _o_c_annotation_8h.html │ ├── _o_c_annotation_8h_source.html │ ├── _o_c_annotation_8m.html │ ├── _o_c_annotation_8m_source.html │ ├── _o_c_distance_8h.html │ ├── _o_c_distance_8h_source.html │ ├── _o_c_distance_8m.html │ ├── _o_c_distance_8m_source.html │ ├── _o_c_grouping_8h.html │ ├── _o_c_grouping_8h_source.html │ ├── _o_c_map_view_8h.html │ ├── _o_c_map_view_8h_source.html │ ├── _o_c_map_view_8m.html │ ├── _o_c_map_view_8m_source.html │ ├── annotated.html │ ├── bc_s.png │ ├── class_o_c_algorithms-members.html │ ├── class_o_c_annotation-members.html │ ├── class_o_c_map_view-members.html │ ├── classes.html │ ├── closed.png │ ├── doxygen.css │ ├── doxygen.png │ ├── files.html │ ├── functions.html │ ├── functions_func.html │ ├── functions_prop.html │ ├── functions_vars.html │ ├── globals.html │ ├── globals_enum.html │ ├── globals_eval.html │ ├── globals_func.html │ ├── hierarchy.html │ ├── index.html │ ├── installdox │ ├── interface_o_c_algorithms.html │ ├── interface_o_c_annotation.html │ ├── interface_o_c_annotation.png │ ├── interface_o_c_map_view.html │ ├── jquery.js │ ├── nav_f.png │ ├── nav_h.png │ ├── ocmapview_logo.png │ ├── open.png │ ├── protocol_o_c_algorithm_delegate-p-members.html │ ├── protocol_o_c_algorithm_delegate-p.html │ ├── protocol_o_c_grouping-p.html │ ├── protocol_o_c_grouping-p.png │ ├── search │ │ ├── all_5f.html │ │ ├── all_61.html │ │ ├── all_62.html │ │ ├── all_63.html │ │ ├── all_64.html │ │ ├── all_66.html │ │ ├── all_67.html │ │ ├── all_69.html │ │ ├── all_6d.html │ │ ├── all_6f.html │ │ ├── all_72.html │ │ ├── all_73.html │ │ ├── all_74.html │ │ ├── classes_6f.html │ │ ├── close.png │ │ ├── enums_6f.html │ │ ├── enumvalues_6f.html │ │ ├── files_6f.html │ │ ├── functions_61.html │ │ ├── functions_62.html │ │ ├── functions_63.html │ │ ├── functions_64.html │ │ ├── functions_66.html │ │ ├── functions_67.html │ │ ├── functions_69.html │ │ ├── functions_72.html │ │ ├── functions_73.html │ │ ├── functions_74.html │ │ ├── mag_sel.png │ │ ├── nomatches.html │ │ ├── properties_61.html │ │ ├── properties_63.html │ │ ├── properties_64.html │ │ ├── properties_6d.html │ │ ├── search.css │ │ ├── search.js │ │ ├── search_l.png │ │ ├── search_m.png │ │ ├── search_r.png │ │ ├── variables_5f.html │ │ ├── variables_61.html │ │ ├── variables_62.html │ │ ├── variables_63.html │ │ ├── variables_64.html │ │ ├── variables_73.html │ │ └── variables_74.html │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ └── tabs.css └── ocmapview_logo.png ├── LICENSE.txt ├── OCMapView.podspec ├── OCMapView ├── OCAlgorithmDelegate.h ├── OCAlgorithms.h ├── OCAlgorithms.m ├── OCAnnotation.h ├── OCAnnotation.m ├── OCDistance.h ├── OCDistance.m ├── OCGrouping.h ├── OCMapView.h └── OCMapView.m ├── OClusterMapView+Sample.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── OClusterMapView+Sample ├── Images │ ├── Default-568h@2x.png │ ├── Logo │ │ ├── ocmapview_logo.png │ │ ├── ocmapview_logo512x512.png │ │ ├── ocmapview_logo@2x.png │ │ └── ocmapview_logo~ipad.png │ └── sample_pins │ │ ├── banana.png │ │ ├── banana@2x.png │ │ ├── bananas.png │ │ ├── bananas@2x.png │ │ ├── orange.png │ │ ├── orange@2x.png │ │ ├── oranges.png │ │ ├── oranges@2x.png │ │ ├── regular.png │ │ └── regular@2x.png ├── OCDistanceCalculationPerformance.h ├── OCDistanceCalculationPerformance.m ├── OCMapViewSampleHelpAnnotation.h ├── OCMapViewSampleHelpAnnotation.m ├── OClusterMapView+Sample-Info.plist ├── OClusterMapView+Sample-Prefix.pch ├── OClusterMapView_SampleAppDelegate.h ├── OClusterMapView_SampleAppDelegate.m ├── OClusterMapView_SampleViewController-iPad.xib ├── OClusterMapView_SampleViewController-iPhone.xib ├── OClusterMapView_SampleViewController.h ├── OClusterMapView_SampleViewController.m └── main.m ├── README.md └── screenshots.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | ehthumbs.db 3 | Thumbs.db 4 | xcuserdata 5 | 6 | -------------------------------------------------------------------------------- /Documentation/html/_o_c_algorithms_8m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: /Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCAlgorithms.m File Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 |
60 |
61 |
62 |
/Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCAlgorithms.m File Reference
63 |
64 |
65 |
#import "OCAlgorithms.h"
66 | #import "OCAnnotation.h"
67 | #import "OCDistance.h"
68 | #import "OCGrouping.h"
69 | #import <math.h>
70 |
71 |

Go to the source code of this file.

72 | 73 |
74 |
75 | 76 |
80 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
81 | 82 | 83 |
84 | 87 |
88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Documentation/html/_o_c_annotation_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: /Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCAnnotation.h File Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 |
60 |
61 |
62 | Data Structures
63 |
64 |
/Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCAnnotation.h File Reference
65 |
66 |
67 |
#import <UIKit/UIKit.h>
68 | #import <MapKit/MapKit.h>
69 | #import "OCGrouping.h"
70 |
71 |

Go to the source code of this file.

72 | 73 | 75 | 76 | 77 |

74 | Data Structures

class  OCAnnotation
 Annotation class which represents a Cluster. More...
78 |
79 | 80 |
84 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
85 | 86 | 87 |
88 | 91 |
92 | 93 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Documentation/html/_o_c_annotation_8m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: /Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCAnnotation.m File Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 |
60 |
61 |
62 |
/Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCAnnotation.m File Reference
63 |
64 |
65 |
#import "OCAnnotation.h"
66 |
67 |

Go to the source code of this file.

68 | 69 |
70 |
71 | 72 |
76 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
77 | 78 | 79 |
80 | 83 |
84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Documentation/html/_o_c_grouping_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: /Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCGrouping.h File Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 |
60 |
61 |
62 | Data Structures
63 |
64 |
/Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCGrouping.h File Reference
65 |
66 |
67 |
#import <Foundation/Foundation.h>
68 |
69 |

Go to the source code of this file.

70 | 71 | 73 | 74 | 75 |

72 | Data Structures

protocol  <OCGrouping>
 Protocol which is needed to use different groups of clusters. More...
76 |
77 | 78 |
82 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
83 | 84 | 85 |
86 | 89 |
90 | 91 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Documentation/html/_o_c_map_view_8m.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: /Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCMapView.m File Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 |
60 |
61 |
62 | Data Structures
63 |
64 |
/Users/Boti/Documents/coding/iPhone Development/OCMapView+Sample/OCMapView/OCMapView.m File Reference
65 |
66 |
67 |
#import "OCMapView.h"
68 |
69 |

Go to the source code of this file.

70 | 71 | 73 | 74 |

72 | Data Structures

class  OCMapView(private)
75 |
76 | 77 |
81 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
82 | 83 | 84 |
85 | 88 |
89 | 90 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Documentation/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Data Structures 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 61 |
62 |
63 |
64 |
Data Structures
65 |
66 |
67 |
Here are the data structures with brief descriptions:
68 | 69 | 70 | 71 | 72 | 73 |
<OCAlgorithmDelegate>Protocol for notifying on Cluster events. NOT in use yet
OCAlgorithmsClass containing clustering algorithms
OCAnnotationAnnotation class which represents a Cluster
<OCGrouping>Protocol which is needed to use different groups of clusters
OCMapViewMapView which should be used instead of MKMapView
74 |
75 | 76 |
80 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
81 | 82 | 83 |
84 | 87 |
88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Documentation/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/bc_s.png -------------------------------------------------------------------------------- /Documentation/html/class_o_c_algorithms-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Member List 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 60 |
61 |
62 |
63 |
OCAlgorithms Member List
64 |
65 |
66 | This is the complete list of members for OCAlgorithms, including all inherited members. 67 | 68 | 69 | 70 |
bubbleClusteringWithAnnotations:andClusterRadius:OCAlgorithms [static]
delegateOCAlgorithms [protected]
gridClusteringWithAnnotations:andClusterRect:OCAlgorithms [static]
71 | 72 |
76 |  All Classes Files Functions Variables Enumerations Enumerator Properties
77 | 78 | 79 |
80 | 83 |
84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Documentation/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Data Structure Index 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 61 |
62 |
63 |
64 |
Data Structure Index
65 |
66 |
67 |
O
68 | 69 |
  O  
70 |
OCAlgorithms   OCAnnotation   OCGrouping   OCMapView   
OCAlgorithmDelegate   
O
71 |
72 | 73 |
77 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
78 | 79 | 80 |
81 | 84 |
85 | 86 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /Documentation/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/closed.png -------------------------------------------------------------------------------- /Documentation/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/doxygen.png -------------------------------------------------------------------------------- /Documentation/html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Globals 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 | 67 |
68 |
69 |   74 |
75 | 76 |
80 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
81 | 82 | 83 |
84 | 87 |
88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Documentation/html/globals_eval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Globals 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 | 67 |
68 |
69 |   77 |
78 | 79 |
83 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
84 | 85 | 86 |
87 | 90 |
91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Documentation/html/globals_func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Globals 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 59 | 67 |
68 |
69 |   79 |
80 | 81 |
85 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
86 | 87 | 88 |
89 | 92 |
93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /Documentation/html/hierarchy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Class Hierarchy 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 61 |
62 |
63 |
64 |
Class Hierarchy
65 |
66 |
67 |
This inheritance list is sorted roughly, but not completely, alphabetically:
76 |
77 | 78 |
82 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
83 | 84 | 85 |
86 | 89 |
90 | 91 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Documentation/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Main Page 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 |
54 |
55 |
56 |
OCMapView Documentation
57 |
58 |
59 |
60 | 61 |
65 |  All Data Structures Files Functions Variables Enumerations Enumerator Properties
66 | 67 | 68 |
69 | 72 |
73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Documentation/html/installdox: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | %subst = ( ); 4 | $quiet = 0; 5 | 6 | while ( @ARGV ) { 7 | $_ = shift @ARGV; 8 | if ( s/^-// ) { 9 | if ( /^l(.*)/ ) { 10 | $v = ($1 eq "") ? shift @ARGV : $1; 11 | ($v =~ /\/$/) || ($v .= "/"); 12 | $_ = $v; 13 | if ( /(.+)\@(.+)/ ) { 14 | if ( exists $subst{$1} ) { 15 | $subst{$1} = $2; 16 | } else { 17 | print STDERR "Unknown tag file $1 given with option -l\n"; 18 | &usage(); 19 | } 20 | } else { 21 | print STDERR "Argument $_ is invalid for option -l\n"; 22 | &usage(); 23 | } 24 | } 25 | elsif ( /^q/ ) { 26 | $quiet = 1; 27 | } 28 | elsif ( /^\?|^h/ ) { 29 | &usage(); 30 | } 31 | else { 32 | print STDERR "Illegal option -$_\n"; 33 | &usage(); 34 | } 35 | } 36 | else { 37 | push (@files, $_ ); 38 | } 39 | } 40 | 41 | foreach $sub (keys %subst) 42 | { 43 | if ( $subst{$sub} eq "" ) 44 | { 45 | print STDERR "No substitute given for tag file `$sub'\n"; 46 | &usage(); 47 | } 48 | elsif ( ! $quiet && $sub ne "_doc" && $sub ne "_cgi" ) 49 | { 50 | print "Substituting $subst{$sub} for each occurrence of tag file $sub\n"; 51 | } 52 | } 53 | 54 | if ( ! @files ) { 55 | if (opendir(D,".")) { 56 | foreach $file ( readdir(D) ) { 57 | $match = ".html"; 58 | next if ( $file =~ /^\.\.?$/ ); 59 | ($file =~ /$match/) && (push @files, $file); 60 | ($file =~ /\.svg/) && (push @files, $file); 61 | ($file =~ "navtree.js") && (push @files, $file); 62 | } 63 | closedir(D); 64 | } 65 | } 66 | 67 | if ( ! @files ) { 68 | print STDERR "Warning: No input files given and none found!\n"; 69 | } 70 | 71 | foreach $f (@files) 72 | { 73 | if ( ! $quiet ) { 74 | print "Editing: $f...\n"; 75 | } 76 | $oldf = $f; 77 | $f .= ".bak"; 78 | unless (rename $oldf,$f) { 79 | print STDERR "Error: cannot rename file $oldf\n"; 80 | exit 1; 81 | } 82 | if (open(F,"<$f")) { 83 | unless (open(G,">$oldf")) { 84 | print STDERR "Error: opening file $oldf for writing\n"; 85 | exit 1; 86 | } 87 | if ($oldf ne "tree.js") { 88 | while () { 89 | s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (xlink:href|href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g; 90 | print G "$_"; 91 | } 92 | } 93 | else { 94 | while () { 95 | s/\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\", \"\2/\"$1:$subst{$1}\" ,\"$subst{$1}/g; 96 | print G "$_"; 97 | } 98 | } 99 | } 100 | else { 101 | print STDERR "Warning file $f does not exist\n"; 102 | } 103 | unlink $f; 104 | } 105 | 106 | sub usage { 107 | print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n"; 108 | print STDERR "Options:\n"; 109 | print STDERR " -l tagfile\@linkName tag file + URL or directory \n"; 110 | print STDERR " -q Quiet mode\n\n"; 111 | exit 1; 112 | } 113 | -------------------------------------------------------------------------------- /Documentation/html/interface_o_c_annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/interface_o_c_annotation.png -------------------------------------------------------------------------------- /Documentation/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/nav_f.png -------------------------------------------------------------------------------- /Documentation/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/nav_h.png -------------------------------------------------------------------------------- /Documentation/html/ocmapview_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/ocmapview_logo.png -------------------------------------------------------------------------------- /Documentation/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/open.png -------------------------------------------------------------------------------- /Documentation/html/protocol_o_c_algorithm_delegate-p-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OCMapView: Member List 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 |
23 |
OCMapView 1.0
24 |
Simple and easy to use clustering mapView.
25 |
29 |
30 | 53 | 60 |
61 |
62 |
63 |
<OCAlgorithmDelegate> Member List
64 |
65 |
66 | This is the complete list of members for <OCAlgorithmDelegate>, including all inherited members. 67 | 68 | 69 | 70 |
algorithmClusteredPartially<OCAlgorithmDelegate>
algorithmDidBeganClustering<OCAlgorithmDelegate>
algorithmDidFinishClustering<OCAlgorithmDelegate>
71 | 72 | 77 | 78 | 79 |
80 | 83 |
84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Documentation/html/protocol_o_c_grouping-p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/protocol_o_c_grouping-p.png -------------------------------------------------------------------------------- /Documentation/html/search/all_5f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | _groupTag 13 | OCAnnotation 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/all_62.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | backgroundClusterQueue 13 | OCMapView 14 |
15 |
16 |
17 |
18 | 19 | OCAlgorithms 20 |
21 |
22 |
Searching...
23 |
No Matches
24 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /Documentation/html/search/all_63.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | clusterByGroupTag 13 | OCMapView 14 |
15 |
16 |
17 |
18 | clusteringEnabled 19 | OCMapView 20 |
21 |
22 |
23 |
24 | clusteringMethod 25 | OCMapView 26 |
27 |
28 |
29 |
30 | clusterSize 31 | OCMapView 32 |
33 |
34 |
35 | 42 |
43 |
Searching...
44 |
No Matches
45 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /Documentation/html/search/all_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | delegate 13 | OCAlgorithms 14 |
15 |
16 | 25 |
26 |
27 | doClustering 28 | OCMapView 29 |
30 |
31 |
Searching...
32 |
No Matches
33 | 39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /Documentation/html/search/all_66.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | 13 | OCMapView 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/all_67.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 | 19 |
20 | 27 |
28 |
29 |
30 | 31 | OCAlgorithms 32 |
33 |
34 |
Searching...
35 |
No Matches
36 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /Documentation/html/search/all_69.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | init 13 | OCAnnotation 14 |
15 |
16 |
17 |
18 | initSetUp 19 | OCMapView 20 |
21 |
22 | 31 |
32 |
33 | 34 | OCAnnotation 35 |
36 |
37 |
Searching...
38 |
No Matches
39 | 45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /Documentation/html/search/all_6d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | minLongitudeDeltaToCluster 13 | OCMapView 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/all_72.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | 13 | 17 |
18 |
19 |
20 |
21 | 22 | 26 |
27 |
28 |
Searching...
29 |
No Matches
30 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /Documentation/html/search/all_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 | 18 |
19 |
20 |
21 | 22 | OCAnnotation 23 |
24 |
25 |
26 |
27 | 28 | OCAnnotation 29 |
30 |
31 |
32 |
33 | 34 | OCAnnotation 35 |
36 |
37 |
38 |
39 | 40 | OCMapView 41 |
42 |
43 |
44 |
45 | 46 | OCAnnotation 47 |
48 |
49 |
Searching...
50 |
No Matches
51 | 57 |
58 | 59 | 60 | -------------------------------------------------------------------------------- /Documentation/html/search/all_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | title 13 | 17 |
18 |
19 |
Searching...
20 |
No Matches
21 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /Documentation/html/search/classes_6f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 | 14 |
15 |
16 |
17 | OCAlgorithms 18 |
19 |
20 |
21 |
22 | OCAnnotation 23 |
24 |
25 |
26 |
27 | OCGrouping-p 28 |
29 |
30 |
31 |
32 | OCMapView 33 |
34 |
35 |
Searching...
36 |
No Matches
37 | 43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /Documentation/html/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/search/close.png -------------------------------------------------------------------------------- /Documentation/html/search/enums_6f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | OCClusteringMethod 13 | OCAlgorithms.h 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/enumvalues_6f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | OCClusteringMethodBubble 13 | OCAlgorithms.h 14 |
15 |
16 |
17 |
18 | OCClusteringMethodGrid 19 | OCAlgorithms.h 20 |
21 |
22 |
Searching...
23 |
No Matches
24 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /Documentation/html/search/files_6f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | OCAlgorithms.h 13 |
14 |
15 |
16 |
17 | OCAlgorithms.m 18 |
19 |
20 |
21 |
22 | OCAnnotation.h 23 |
24 |
25 |
26 |
27 | OCAnnotation.m 28 |
29 |
30 |
31 |
32 | OCDistance.h 33 |
34 |
35 |
36 |
37 | OCDistance.m 38 |
39 |
40 |
41 |
42 | OCGrouping.h 43 |
44 |
45 |
46 |
47 | OCMapView.h 48 |
49 |
50 |
51 |
52 | OCMapView.m 53 |
54 |
55 |
Searching...
56 |
No Matches
57 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_61.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | algorithmClusteredPartially 13 | OCAlgorithmDelegate-p 14 |
15 |
16 |
17 |
18 | algorithmDidBeganClustering 19 | OCAlgorithmDelegate-p 20 |
21 |
22 |
23 |
24 | algorithmDidFinishClustering 25 | OCAlgorithmDelegate-p 26 |
27 |
28 |
29 |
30 | annotations 31 | OCMapView 32 |
33 |
34 |
35 |
36 | annotationsInCluster 37 | OCAnnotation 38 |
39 |
40 |
41 |
42 | 43 | 47 |
48 |
49 |
50 |
51 | 52 | 56 |
57 |
58 |
Searching...
59 |
No Matches
60 | 66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_62.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | 13 | OCAlgorithms 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_63.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | coordinate 13 | OCAnnotation 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | displayedAnnotations 13 | OCMapView 14 |
15 |
16 |
17 |
18 | doClustering 19 | OCMapView 20 |
21 |
22 |
Searching...
23 |
No Matches
24 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_66.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | 13 | OCMapView 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_67.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 | 19 |
20 | 27 |
28 |
29 |
30 | 31 | OCAlgorithms 32 |
33 |
34 |
Searching...
35 |
No Matches
36 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_69.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | init 13 | OCAnnotation 14 |
15 |
16 |
17 |
18 | initSetUp 19 | OCMapView 20 |
21 |
22 | 31 |
32 |
33 | 34 | OCAnnotation 35 |
36 |
37 |
Searching...
38 |
No Matches
39 | 45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_72.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | 13 | 17 |
18 |
19 |
20 |
21 | 22 | 26 |
27 |
28 |
Searching...
29 |
No Matches
30 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | subtitle 13 | OCAnnotation 14 |
15 |
16 |
17 |
18 | 19 | OCAnnotation 20 |
21 |
22 |
23 |
24 | 25 | OCAnnotation 26 |
27 |
28 |
29 |
30 | 31 | OCAnnotation 32 |
33 |
34 |
35 |
36 | 37 | OCMapView 38 |
39 |
40 |
41 |
42 | 43 | OCAnnotation 44 |
45 |
46 |
Searching...
47 |
No Matches
48 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /Documentation/html/search/functions_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | title 13 | OCAnnotation 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/search/mag_sel.png -------------------------------------------------------------------------------- /Documentation/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
No Matches
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Documentation/html/search/properties_61.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | annotations 13 | OCMapView 14 |
15 |
16 |
17 |
18 | annotationsInCluster 19 | OCAnnotation 20 |
21 |
22 |
23 |
24 | annotationsToIgnore 25 | OCMapView 26 |
27 |
28 |
Searching...
29 |
No Matches
30 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /Documentation/html/search/properties_63.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | clusterByGroupTag 13 | OCMapView 14 |
15 |
16 |
17 |
18 | clusteringEnabled 19 | OCMapView 20 |
21 |
22 |
23 |
24 | clusteringMethod 25 | OCMapView 26 |
27 |
28 |
29 |
30 | clusterSize 31 | OCMapView 32 |
33 |
34 |
Searching...
35 |
No Matches
36 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /Documentation/html/search/properties_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | displayedAnnotations 13 | OCMapView 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/properties_6d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | minLongitudeDeltaToCluster 13 | OCMapView 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/search.css: -------------------------------------------------------------------------------- 1 | /*---------------- Search Box */ 2 | 3 | #FSearchBox { 4 | float: left; 5 | } 6 | 7 | #searchli { 8 | float: right; 9 | display: block; 10 | width: 170px; 11 | height: 36px; 12 | } 13 | 14 | #MSearchBox { 15 | white-space : nowrap; 16 | position: absolute; 17 | float: none; 18 | display: inline; 19 | margin-top: 8px; 20 | right: 0px; 21 | width: 170px; 22 | z-index: 102; 23 | } 24 | 25 | #MSearchBox .left 26 | { 27 | display:block; 28 | position:absolute; 29 | left:10px; 30 | width:20px; 31 | height:19px; 32 | background:url('search_l.png') no-repeat; 33 | background-position:right; 34 | } 35 | 36 | #MSearchSelect { 37 | display:block; 38 | position:absolute; 39 | width:20px; 40 | height:19px; 41 | } 42 | 43 | .left #MSearchSelect { 44 | left:4px; 45 | } 46 | 47 | .right #MSearchSelect { 48 | right:5px; 49 | } 50 | 51 | #MSearchField { 52 | display:block; 53 | position:absolute; 54 | height:19px; 55 | background:url('search_m.png') repeat-x; 56 | border:none; 57 | width:116px; 58 | margin-left:20px; 59 | padding-left:4px; 60 | color: #909090; 61 | outline: none; 62 | font: 9pt Arial, Verdana, sans-serif; 63 | } 64 | 65 | #FSearchBox #MSearchField { 66 | margin-left:15px; 67 | } 68 | 69 | #MSearchBox .right { 70 | display:block; 71 | position:absolute; 72 | right:10px; 73 | top:0px; 74 | width:20px; 75 | height:19px; 76 | background:url('search_r.png') no-repeat; 77 | background-position:left; 78 | } 79 | 80 | #MSearchClose { 81 | display: none; 82 | position: absolute; 83 | top: 4px; 84 | background : none; 85 | border: none; 86 | margin: 0px 4px 0px 0px; 87 | padding: 0px 0px; 88 | outline: none; 89 | } 90 | 91 | .left #MSearchClose { 92 | left: 6px; 93 | } 94 | 95 | .right #MSearchClose { 96 | right: 2px; 97 | } 98 | 99 | .MSearchBoxActive #MSearchField { 100 | color: #000000; 101 | } 102 | 103 | /*---------------- Search filter selection */ 104 | 105 | #MSearchSelectWindow { 106 | display: none; 107 | position: absolute; 108 | left: 0; top: 0; 109 | border: 1px solid #7C7C7C; 110 | background-color: #F7F7F7; 111 | z-index: 1; 112 | padding-top: 4px; 113 | padding-bottom: 4px; 114 | -moz-border-radius: 4px; 115 | -webkit-border-top-left-radius: 4px; 116 | -webkit-border-top-right-radius: 4px; 117 | -webkit-border-bottom-left-radius: 4px; 118 | -webkit-border-bottom-right-radius: 4px; 119 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 120 | } 121 | 122 | .SelectItem { 123 | font: 8pt Arial, Verdana, sans-serif; 124 | padding-left: 2px; 125 | padding-right: 12px; 126 | border: 0px; 127 | } 128 | 129 | span.SelectionMark { 130 | margin-right: 4px; 131 | font-family: monospace; 132 | outline-style: none; 133 | text-decoration: none; 134 | } 135 | 136 | a.SelectItem { 137 | display: block; 138 | outline-style: none; 139 | color: #000000; 140 | text-decoration: none; 141 | padding-left: 6px; 142 | padding-right: 12px; 143 | } 144 | 145 | a.SelectItem:focus, 146 | a.SelectItem:active { 147 | color: #000000; 148 | outline-style: none; 149 | text-decoration: none; 150 | } 151 | 152 | a.SelectItem:hover { 153 | color: #FFFFFF; 154 | background-color: #2A2A2A; 155 | outline-style: none; 156 | text-decoration: none; 157 | cursor: pointer; 158 | display: block; 159 | } 160 | 161 | /*---------------- Search results window */ 162 | 163 | iframe#MSearchResults { 164 | width: 60ex; 165 | height: 15em; 166 | } 167 | 168 | #MSearchResultsWindow { 169 | display: none; 170 | position: absolute; 171 | left: 0; top: 0; 172 | border: 1px solid #000; 173 | background-color: #E8E8E8; 174 | } 175 | 176 | /* ----------------------------------- */ 177 | 178 | 179 | #SRIndex { 180 | clear:both; 181 | padding-bottom: 15px; 182 | } 183 | 184 | .SREntry { 185 | font-size: 10pt; 186 | padding-left: 1ex; 187 | } 188 | 189 | .SRPage .SREntry { 190 | font-size: 8pt; 191 | padding: 1px 5px; 192 | } 193 | 194 | body.SRPage { 195 | margin: 5px 2px; 196 | } 197 | 198 | .SRChildren { 199 | padding-left: 3ex; padding-bottom: .5em 200 | } 201 | 202 | .SRPage .SRChildren { 203 | display: none; 204 | } 205 | 206 | .SRSymbol { 207 | font-weight: bold; 208 | color: #313131; 209 | font-family: Arial, Verdana, sans-serif; 210 | text-decoration: none; 211 | outline: none; 212 | } 213 | 214 | a.SRScope { 215 | display: block; 216 | color: #313131; 217 | font-family: Arial, Verdana, sans-serif; 218 | text-decoration: none; 219 | outline: none; 220 | } 221 | 222 | a.SRSymbol:focus, a.SRSymbol:active, 223 | a.SRScope:focus, a.SRScope:active { 224 | text-decoration: underline; 225 | } 226 | 227 | .SRPage .SRStatus { 228 | padding: 2px 5px; 229 | font-size: 8pt; 230 | font-style: italic; 231 | } 232 | 233 | .SRResult { 234 | display: none; 235 | } 236 | 237 | DIV.searchresults { 238 | margin-left: 10px; 239 | margin-right: 10px; 240 | } 241 | -------------------------------------------------------------------------------- /Documentation/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/search/search_l.png -------------------------------------------------------------------------------- /Documentation/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/search/search_m.png -------------------------------------------------------------------------------- /Documentation/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/search/search_r.png -------------------------------------------------------------------------------- /Documentation/html/search/variables_5f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | _groupTag 13 | OCAnnotation 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/variables_61.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | allAnnotations 13 | OCMapView 14 |
15 |
16 |
17 |
18 | annotationsInCluster 19 | OCAnnotation 20 |
21 |
22 |
Searching...
23 |
No Matches
24 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /Documentation/html/search/variables_62.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | backgroundClusterQueue 13 | OCMapView 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/variables_63.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | coordinate 13 | OCAnnotation 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/variables_64.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | delegate 13 | OCAlgorithms 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/variables_73.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | subtitle 13 | OCAnnotation 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/search/variables_74.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
Loading...
10 |
11 |
12 | title 13 | OCAnnotation 14 |
15 |
16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /Documentation/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/tab_a.png -------------------------------------------------------------------------------- /Documentation/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/tab_b.png -------------------------------------------------------------------------------- /Documentation/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/tab_h.png -------------------------------------------------------------------------------- /Documentation/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/html/tab_s.png -------------------------------------------------------------------------------- /Documentation/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | } 7 | 8 | .tabs2 { 9 | font-size: 10px; 10 | } 11 | .tabs3 { 12 | font-size: 9px; 13 | } 14 | 15 | .tablist { 16 | margin: 0; 17 | padding: 0; 18 | display: table; 19 | } 20 | 21 | .tablist li { 22 | float: left; 23 | display: table-cell; 24 | background-image: url('tab_b.png'); 25 | line-height: 36px; 26 | list-style: none; 27 | } 28 | 29 | .tablist a { 30 | display: block; 31 | padding: 0 20px; 32 | font-weight: bold; 33 | background-image:url('tab_s.png'); 34 | background-repeat:no-repeat; 35 | background-position:right; 36 | color: #131313; 37 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 38 | text-decoration: none; 39 | outline: none; 40 | } 41 | 42 | .tabs3 .tablist a { 43 | padding: 0 10px; 44 | } 45 | 46 | .tablist a:hover { 47 | background-image: url('tab_h.png'); 48 | background-repeat:repeat-x; 49 | color: #fff; 50 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 51 | text-decoration: none; 52 | } 53 | 54 | .tablist li.current a { 55 | background-image: url('tab_a.png'); 56 | background-repeat:repeat-x; 57 | color: #fff; 58 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 59 | } 60 | -------------------------------------------------------------------------------- /Documentation/ocmapview_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/Documentation/ocmapview_logo.png -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | * * * * * * * * * * * * * * * * * 2 | * OCMapView for iOS 3 | * Copyright (c) 2012, Botond Kis 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright notice, this list 10 | * of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright notice, this list 13 | * of conditions and the following disclaimer in the documentation and/or other materials 14 | * provided with the distribution. 15 | * 16 | * 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /OCMapView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'OCMapView' 3 | s.version = '0.1.0' 4 | s.platform = :ios 5 | s.summary = 'Simple, easy and fast class for clustering in MKMapViews.' 6 | s.homepage = 'https://github.com/yinkou/OCMapView' 7 | s.authors = { 'Botond Kis' => 'boti.kis@gmx.at', 'Markus Emrich' => 'markus@nxtbgthng.com' } 8 | s.source = { :git => 'https://github.com/yinkou/OCMapView.git', :tag => "#{s.version}" } 9 | s.requires_arc = true 10 | s.source_files = 'OCMapView' 11 | s.frameworks = 'MapKit', 'CoreLocation' 12 | s.license = "LICENSE.txt" 13 | 14 | s.description = 'OpenClusterMapView is a simple and easy to use drop-in replacement for MKMapView on iOS. If ' \ 15 | 'you are displaying a lot of annotations on the map, this class is made for you. ' \ 16 | 'OCMapView automatically creates clusters by combining annotations super fast. It ' \ 17 | 'works with any iOS application. You dont even need to change any code other than replacing' \ 18 | 'the MKMapView class.' 19 | end 20 | -------------------------------------------------------------------------------- /OCMapView/OCAlgorithmDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCAlgorithmDelegate.h 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Markus on 24.09.13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | /// Protocol for notifying on Cluster events. NOT in use yet. 12 | /** Implement this protocol if you are using asynchronous clustering algorithms. 13 | In fact, there isn't one yet. This just demonstrates where this class will develop to in future.*/ 14 | @protocol OCAlgorithmDelegate 15 | @required 16 | /// Called when an algorithm finishes a block of calculations 17 | - (NSArray *)algorithmClusteredPartially; 18 | @optional 19 | /// Called when algorithm starts calculating. 20 | - (void)algorithmDidBeganClustering; 21 | /// Called when algorithm finishes calculating. 22 | - (void)algorithmDidFinishClustering; 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /OCMapView/OCAlgorithms.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCAlgorythms.h 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 15.07.11. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | /// Enumaration for the clustering methods 12 | /** Contains all clustering methods which are aviable in OCMapView yet*/ 13 | typedef enum { 14 | OCClusteringMethodBubble, 15 | OCClusteringMethodGrid 16 | } OCClusteringMethod; 17 | 18 | /// Class containing clustering algorithms. 19 | /** The first release of OCMapView brings two different algorithms. 20 | This class is supposed to hold those algorithms. 21 | More algorithms are planned for future releases of OCMapView. 22 | 23 | Note for OCMapView developers: 24 | Every algorithm has to be a class method which returns an array of OCAnnotations or a subclass of it. 25 | OR for future releases they can be instance methods if they run asynchronously. The instance holder 26 | needs to implement the delegate protocol and the method needs to call the delegate. 27 | */ 28 | @interface OCAlgorithms : NSObject 29 | 30 | /// Bubble clustering with iteration 31 | /** This algorithm creates clusters based on the distance 32 | between single annotations. 33 | 34 | @param annotationsToCluster contains the Annotations that should be clustered 35 | @param radius represents the cluster size. 36 | 37 | It iterates through all annotations in the array and compare their 38 | distances. If they are near engough, they will be clustered.*/ 39 | + (NSArray*)bubbleClusteringWithAnnotations:(NSArray*)annotationsToCluster 40 | clusterRadius:(CLLocationDistance)radius 41 | grouped:(BOOL)grouped; 42 | 43 | 44 | 45 | /// Grid clustering with predefined size 46 | /** This algorithm creates clusters based on a defined grid. 47 | 48 | @param annotationsToCluster contains the Annotations that should be clustered 49 | @param tileRect represents the size of a grid tile. 50 | 51 | It iterates through all annotations in the array and puts them into a grid tile based on their location.*/ 52 | + (NSArray*)gridClusteringWithAnnotations:(NSArray*)annotationsToCluster 53 | clusterRect:(MKCoordinateSpan)tileRect 54 | grouped:(BOOL)grouped; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /OCMapView/OCAlgorithms.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCAlgorythms.m 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 15.07.11. 6 | // 7 | 8 | #import "OCAlgorithms.h" 9 | #import "OCAnnotation.h" 10 | #import "OCDistance.h" 11 | #import "OCGrouping.h" 12 | 13 | static double euclidDistanceSquared(CLLocationCoordinate2D a, CLLocationCoordinate2D b) 14 | { 15 | double latDelta = a.latitude-b.latitude; 16 | double lonDelta = a.longitude-b.longitude; 17 | return latDelta*latDelta + lonDelta*lonDelta; 18 | } 19 | 20 | @implementation OCAlgorithms 21 | 22 | // Bubble clustering with iteration 23 | + (NSArray*)bubbleClusteringWithAnnotations:(NSArray*)annotationsToCluster 24 | clusterRadius:(CLLocationDistance)radius 25 | grouped:(BOOL)grouped; 26 | { 27 | NSMutableArray *clusteredAnnotations = [[NSMutableArray alloc] init]; 28 | 29 | double radiusSquared = radius*radius; 30 | 31 | // Clustering 32 | for (id annotation in annotationsToCluster) 33 | { 34 | // Find fitting existing cluster 35 | BOOL foundCluster = NO; 36 | CLLocationCoordinate2D annotationCoordinate = [annotation coordinate]; 37 | for (OCAnnotation *clusterAnnotation in clusteredAnnotations) { 38 | // If the annotation is in range of the cluster, add it 39 | if(euclidDistanceSquared(annotationCoordinate, [clusterAnnotation coordinate]) <= radiusSquared) { 40 | // check group 41 | if (grouped && [annotation conformsToProtocol:@protocol(OCGrouping)]) { 42 | if (![clusterAnnotation.groupTag isEqualToString:((id )annotation).groupTag]) 43 | continue; 44 | } 45 | 46 | foundCluster = YES; 47 | [clusterAnnotation addAnnotation:annotation]; 48 | break; 49 | } 50 | } 51 | 52 | // If the annotation wasn't added to a cluster, create a new one 53 | if (!foundCluster){ 54 | OCAnnotation *newCluster = [[OCAnnotation alloc] initWithAnnotation:annotation]; 55 | [clusteredAnnotations addObject:newCluster]; 56 | 57 | // check group 58 | if (grouped && [annotation conformsToProtocol:@protocol(OCGrouping)]) { 59 | newCluster.groupTag = [(id)annotation groupTag]; 60 | } 61 | } 62 | } 63 | 64 | // whipe all empty or single annotations 65 | NSMutableArray *returnArray = [[NSMutableArray alloc] init]; 66 | for (OCAnnotation *anAnnotation in clusteredAnnotations) { 67 | if ([anAnnotation.annotationsInCluster count] == 1) { 68 | [returnArray addObject:[anAnnotation.annotationsInCluster lastObject]]; 69 | } else if ([anAnnotation.annotationsInCluster count] > 1){ 70 | [returnArray addObject:anAnnotation]; 71 | } 72 | } 73 | 74 | return returnArray; 75 | } 76 | 77 | 78 | // Grid clustering with predefined size 79 | + (NSArray*)gridClusteringWithAnnotations:(NSArray*)annotationsToCluster 80 | clusterRect:(MKCoordinateSpan)tileRect 81 | grouped:(BOOL)grouped; 82 | { 83 | NSMutableDictionary *clusteredAnnotations = [[NSMutableDictionary alloc] init]; 84 | 85 | // iterate through all annotations 86 | for (id annotation in annotationsToCluster) 87 | { 88 | // calculate grid coordinates of the annotation 89 | NSInteger row = ([annotation coordinate].longitude+180.0)/tileRect.longitudeDelta; 90 | NSInteger column = ([annotation coordinate].latitude+90.0)/tileRect.latitudeDelta; 91 | NSString *key = [NSString stringWithFormat:@"%d:%d", (int)row, (int)column]; 92 | 93 | // add group tag to key 94 | if (grouped && [annotation conformsToProtocol:@protocol(OCGrouping)]) { 95 | key = [NSString stringWithFormat: @"%@:%@", key, [(id)annotation groupTag]]; 96 | } 97 | 98 | // get the cluster for the calculated coordinates 99 | OCAnnotation *clusterAnnotation = [clusteredAnnotations objectForKey:key]; 100 | 101 | // if there is none, create one 102 | if (clusterAnnotation == nil) { 103 | clusterAnnotation = [[OCAnnotation alloc] init]; 104 | 105 | CLLocationDegrees lon = row * tileRect.longitudeDelta + tileRect.longitudeDelta/2.0 - 180.0; 106 | CLLocationDegrees lat = (column * tileRect.latitudeDelta) + tileRect.latitudeDelta/2.0 - 90.0; 107 | clusterAnnotation.coordinate = CLLocationCoordinate2DMake(lat, lon); 108 | 109 | // check group 110 | if (grouped && [annotation conformsToProtocol:@protocol(OCGrouping)]) { 111 | clusterAnnotation.groupTag = [(id)annotation groupTag]; 112 | } 113 | 114 | [clusteredAnnotations setValue:clusterAnnotation forKey:key]; 115 | } 116 | 117 | // add annotation to the cluster 118 | [clusterAnnotation addAnnotation:annotation]; 119 | } 120 | 121 | // return array 122 | NSMutableArray *returnArray = [[NSMutableArray alloc] init]; 123 | 124 | // add single annotations directly without OCAnnotation 125 | for (OCAnnotation *anAnnotation in [clusteredAnnotations allValues]) { 126 | if ([anAnnotation.annotationsInCluster count] == 1) { 127 | [returnArray addObject:[anAnnotation.annotationsInCluster lastObject]]; 128 | } else if ([anAnnotation.annotationsInCluster count] > 1) { 129 | [returnArray addObject:anAnnotation]; 130 | } 131 | } 132 | 133 | return returnArray; 134 | } 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /OCMapView/OCAnnotation.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCAnnotation.h 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 14.07.11. 6 | // 7 | 8 | #import 9 | #import "OCGrouping.h" 10 | 11 | /// Annotation class which represents a Cluster. 12 | /** OCAnnotation stores all annotations which are in its area. 13 | Objects of this class will be handed over to the MKMapView delegate method "viewForAnnotation". 14 | Implements OCGrouping protocol. @see OCGrouping 15 | */ 16 | @interface OCAnnotation : NSObject 17 | 18 | @property (nonatomic, copy) NSString *title; 19 | @property (nonatomic, copy) NSString *subtitle; 20 | @property (nonatomic, copy) NSString *groupTag; 21 | @property (nonatomic, assign) CLLocationCoordinate2D coordinate; 22 | 23 | /// Init with annotations 24 | /** Init cluster with containing annotations*/ 25 | - (id)initWithAnnotation:(id)annotation; 26 | 27 | /// List of annotations in the cluster. 28 | /** Returns all annotations in the cluster. */ 29 | - (NSArray*)annotationsInCluster; 30 | 31 | // Adds an annotation to the cluster 32 | /// Adds a single annotation to the cluster. 33 | /** Adds a given annotation to the cluster and sets the title to the number of containing annotations. */ 34 | - (void)addAnnotation:(id)annotation; 35 | 36 | /// Adds multiple annotations to the cluster. 37 | /** Adds multiple annotations to the cluster and sets the title to the number of containing annotations. 38 | Calls addAnnotation in a loop. */ 39 | - (void)addAnnotations:(NSArray *)annotations; 40 | 41 | /// Removes a single annotation from the cluster. 42 | /** Removes a given annotation from the cluster and sets the title to the number of containing annotations. */ 43 | - (void)removeAnnotation:(id)annotation; 44 | 45 | /// Removes multiple annotations from the cluster. 46 | /** Removes multiple annotations from the cluster and sets the title to the number of containing annotations. */ 47 | - (void)removeAnnotations:(NSArray*)annotations; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /OCMapView/OCAnnotation.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCAnnotation.m 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 14.07.11. 6 | // 7 | 8 | #import "OCAnnotation.h" 9 | 10 | /// Compares two objects using -isEqual:. For the border case where both objects 11 | /// are nil, it returns YES too (whereas [nil isEqual:nil] == NO and this leads 12 | /// to incorrect comparison behaviour...) 13 | static BOOL eql(id a, id b) 14 | { 15 | if(a == b) { 16 | return YES; 17 | } else { 18 | return [a isEqual:b]; 19 | } 20 | } 21 | 22 | static CLLocationDegrees const OCMinimumInvalidDegree = 400.0; 23 | 24 | @interface OCAnnotation () 25 | 26 | @property (nonatomic, strong) NSMutableArray *annotationsInCluster; 27 | @property (nonatomic, assign) CLLocationCoordinate2D minCoordinate; 28 | @property (nonatomic, assign) CLLocationCoordinate2D maxCoordinate; 29 | 30 | @end 31 | 32 | 33 | 34 | @implementation OCAnnotation 35 | 36 | - (id)init 37 | { 38 | self = [super init]; 39 | if (self) { 40 | _annotationsInCluster = [[NSMutableArray alloc] init]; 41 | _minCoordinate.latitude = OCMinimumInvalidDegree; 42 | _maxCoordinate.latitude = OCMinimumInvalidDegree; 43 | } 44 | return self; 45 | } 46 | 47 | - (id)initWithAnnotation:(id)annotation; 48 | { 49 | self = [self init]; 50 | if (self) { 51 | CLLocationCoordinate2D annotationCoordinate = [annotation coordinate]; 52 | _minCoordinate = annotationCoordinate; 53 | _maxCoordinate = annotationCoordinate; 54 | _coordinate = annotationCoordinate; 55 | [_annotationsInCluster addObject:annotation]; 56 | 57 | if ([annotation respondsToSelector:@selector(title)]) { 58 | self.title = [annotation title]; 59 | } 60 | if ([annotation respondsToSelector:@selector(subtitle)]) { 61 | self.subtitle = [annotation subtitle]; 62 | } 63 | } 64 | 65 | return self; 66 | } 67 | 68 | // 69 | // List of annotations in the cluster 70 | // read only 71 | - (NSArray*)annotationsInCluster; 72 | { 73 | return [_annotationsInCluster copy]; 74 | } 75 | 76 | #pragma mark add / remove annotations 77 | 78 | - (void)addAnnotation:(id)annotation; 79 | { 80 | CLLocationCoordinate2D annotationCoordinate = annotation.coordinate; 81 | // check if min and max have been set 82 | if (self.minCoordinate.latitude >= OCMinimumInvalidDegree) { 83 | _minCoordinate = annotationCoordinate; 84 | } 85 | if (self.maxCoordinate.latitude >= OCMinimumInvalidDegree) { 86 | _maxCoordinate = annotationCoordinate; 87 | } 88 | 89 | // Add annotation to the cluster 90 | [_annotationsInCluster addObject:annotation]; 91 | 92 | // recompute center coordinate 93 | _minCoordinate.latitude = MIN(_minCoordinate.latitude, annotationCoordinate.latitude); 94 | _minCoordinate.longitude = MIN(_minCoordinate.longitude,annotationCoordinate.longitude); 95 | _maxCoordinate.latitude = MAX(_maxCoordinate.latitude, annotationCoordinate.latitude); 96 | _maxCoordinate.longitude = MAX(_maxCoordinate.longitude, annotationCoordinate.longitude); 97 | 98 | _coordinate.latitude = _minCoordinate.latitude + (_maxCoordinate.latitude-_minCoordinate.latitude)/2.0; 99 | _coordinate.longitude = _minCoordinate.longitude + (_maxCoordinate.longitude-_minCoordinate.longitude)/2.0; 100 | } 101 | 102 | - (void)addAnnotations:(NSArray *)annotations; 103 | { 104 | for (id annotation in annotations) { 105 | [self addAnnotation: annotation]; 106 | } 107 | } 108 | 109 | - (void)removeAnnotation:(id)annotation; 110 | { 111 | // Remove annotation from cluster 112 | [_annotationsInCluster removeObject:annotation]; 113 | } 114 | 115 | - (void)removeAnnotations:(NSArray*)annotations; 116 | { 117 | for (id annotation in annotations) { 118 | [self removeAnnotation: annotation]; 119 | } 120 | } 121 | 122 | #pragma mark equality 123 | 124 | - (BOOL)isEqual:(OCAnnotation*)annotation; 125 | { 126 | if (![annotation isKindOfClass:[OCAnnotation class]]) { 127 | return NO; 128 | } 129 | 130 | if(self.coordinate.latitude == annotation.coordinate.latitude && 131 | self.coordinate.longitude == annotation.coordinate.longitude && 132 | eql(self.title, annotation.title) && 133 | eql(self.subtitle, annotation.subtitle) && 134 | eql(self.groupTag, annotation.groupTag)) 135 | { 136 | // I compare in two steps so the set computations don't have to be done so often. 137 | NSSet *a_annotationsInCluster = [[NSSet alloc] initWithArray:self.annotationsInCluster]; 138 | NSSet *b_annotationsInCluster = [[NSSet alloc] initWithArray:annotation.annotationsInCluster]; 139 | if([a_annotationsInCluster isEqual:b_annotationsInCluster]) { 140 | return YES; 141 | } 142 | } 143 | 144 | return NO; 145 | } 146 | 147 | - (NSUInteger)hash 148 | { 149 | return self.title.hash*97 + self.subtitle.hash*13 + (NSUInteger)(self.coordinate.latitude*999); 150 | } 151 | 152 | @end 153 | 154 | -------------------------------------------------------------------------------- /OCMapView/OCDistance.h: -------------------------------------------------------------------------------- 1 | // 2 | // OEDistance.h 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 14.02.11. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | /** @fn double CLLocationCoordinateDistance(CLLocationCoordinate2D c1, CLLocationCoordinate2D c2) 12 | @brief calculates the distance between two given coordinates in meters 13 | */ 14 | double CLLocationCoordinateDistance(CLLocationCoordinate2D c1, CLLocationCoordinate2D c2); 15 | 16 | /// Returns YES if pt is contained within the bounds or region 17 | BOOL MKCoordinateRegionContainsPoint(MKCoordinateRegion region, CLLocationCoordinate2D pt); 18 | 19 | /// Returns YES if b is fully contained in a (i.e. the intersection of a and b = b) 20 | BOOL MKCoordinateRegionContainsRegion(MKCoordinateRegion a, MKCoordinateRegion b); 21 | -------------------------------------------------------------------------------- /OCMapView/OCDistance.m: -------------------------------------------------------------------------------- 1 | // 2 | // OEDistance.h 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 14.02.11. 6 | // 7 | 8 | #import "OCDistance.h" 9 | 10 | #define kDegreesToRadians (M_PI / 180.0) 11 | 12 | /// calculates the distance between two given coordinates in meters 13 | double CLLocationCoordinateDistance(CLLocationCoordinate2D a, CLLocationCoordinate2D b) 14 | { 15 | double earthRadius = 6371.01; // Earth's radius in Kilometers 16 | 17 | // Get the difference between our two points then convert the difference into radians 18 | double nDLat = (a.latitude - b.latitude) * kDegreesToRadians; 19 | double nDLon = (a.longitude - b.longitude) * kDegreesToRadians; 20 | 21 | double fromLat = b.latitude * kDegreesToRadians; 22 | double toLat = a.latitude * kDegreesToRadians; 23 | 24 | double nA = pow ( sin(nDLat/2), 2 ) + cos(fromLat) * cos(toLat) * pow ( sin(nDLon/2), 2 ); 25 | 26 | double nC = 2 * atan2( sqrt(nA), sqrt( 1 - nA )); 27 | double nD = earthRadius * nC; 28 | 29 | return nD * 1000; // Return our calculated distance in meters 30 | } 31 | 32 | /// Calculates x = (pt + k*modul) such that x is in [0, modul) and k is a natural number 33 | static double modulo(double pt, double modul) 34 | { 35 | while(pt < 0) { 36 | pt += modul; 37 | } 38 | while(pt >= modul) { 39 | pt -= modul; 40 | } 41 | return pt; 42 | } 43 | 44 | /// Returns YES if and only if value is contained in the intervall [pt-range/2, pt+range/2] 45 | /// all calculations are done in R/(modul*N) 46 | /// or equivalently: x and (x+modul) are treated as equivalent values forall x in R 47 | /// (R=real numbers, N=natural numbers) 48 | static BOOL rangeContainsValueModulo(double pt, double range, double value, double modul) 49 | { 50 | double halfRange = range * 0.5; 51 | pt = modulo(pt, modul); 52 | double start = modulo(pt-halfRange, modul); 53 | double end = modulo(pt+halfRange, modul); 54 | if(start <= end) { 55 | return start <= value && value <= end; 56 | } else { 57 | return end <= value || value <= start; 58 | } 59 | return NO; 60 | } 61 | 62 | BOOL MKCoordinateRegionContainsPoint(MKCoordinateRegion region, CLLocationCoordinate2D pt) 63 | { 64 | return rangeContainsValueModulo(region.center.longitude, region.span.longitudeDelta, pt.longitude, 360.0) && 65 | rangeContainsValueModulo(region.center.latitude, region.span.latitudeDelta, pt.latitude, 180.0); 66 | } 67 | 68 | BOOL MKCoordinateRegionContainsRegion(MKCoordinateRegion a, MKCoordinateRegion b) 69 | { 70 | double bHalfLatDelta = b.span.latitudeDelta*0.5; 71 | double bHalfLonDelta = b.span.longitudeDelta*0.5; 72 | CLLocationCoordinate2D b_northWest = CLLocationCoordinate2DMake(b.center.latitude-bHalfLatDelta, b.center.longitude-bHalfLonDelta); 73 | CLLocationCoordinate2D b_southEast = CLLocationCoordinate2DMake(b.center.latitude+bHalfLatDelta, b.center.longitude+bHalfLonDelta); 74 | if(!MKCoordinateRegionContainsPoint(a, b_northWest)) 75 | return NO; 76 | if(!MKCoordinateRegionContainsPoint(a, b_southEast)) 77 | return NO; 78 | 79 | return YES; 80 | } 81 | -------------------------------------------------------------------------------- /OCMapView/OCGrouping.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCGrouping.h 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Botond Kis on 13.02.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// Protocol which is needed to use different groups of clusters 12 | /** Implement this protocol in an annotation to enable clustering of groups 13 | */ 14 | @protocol OCGrouping 15 | @property (nonatomic, readonly, copy) NSString *groupTag; 16 | @end 17 | -------------------------------------------------------------------------------- /OCMapView/OCMapView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMapView.h 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 14.07.11. 6 | // 7 | 8 | #import 9 | 10 | #import "OCDistance.h" 11 | #import "OCAnnotation.h" 12 | #import "OCAlgorithms.h" 13 | 14 | /// MapView replacement for MKMapView 15 | /** OCMapView works like the standard MKMapView but 16 | creates clusters from all added annotations.*/ 17 | @interface OCMapView : MKMapView 18 | 19 | // 20 | /// List of annotations which will be ignored by the clustering algorithm. 21 | /** The objects in this array must adopt the @see MKAnnotation protocol. 22 | The clustering algorithms will automatically ignore this annotations.*/ 23 | @property(nonatomic, strong) NSMutableSet *annotationsToIgnore; 24 | 25 | /// The complete list of annotations displayed on the map including clusters (read-only). 26 | /// The objects in this array adopt the @see MKAnnotation protocol. 27 | /// It contains all annotations as they are on the MapView. 28 | @property(nonatomic, readonly) NSArray *displayedAnnotations; 29 | 30 | /// Enables or disables clustering. 31 | @property(nonatomic, assign) BOOL clusteringEnabled; 32 | 33 | // 34 | /// Defines the clustering algorithm which should be used. 35 | /** @see OCClusteringMethod for more information 36 | 37 | default: OCClusteringMethodBubble*/ 38 | @property(nonatomic, assign) OCClusteringMethod clusteringMethod; 39 | 40 | 41 | // 42 | /// Defines the cluster size in units of the map width. 43 | /** eg. clusterSize 0.5 is the half of the map. 44 | default: 0.2*/ 45 | @property(nonatomic, assign) float clusterSize; 46 | 47 | // 48 | /// Enables multiple clusters 49 | /** If enabled, tha mapview will generate different clusters for Tags 50 | implemented by the OCGrouping protocol. 51 | default: NO*/ 52 | @property(nonatomic, assign) BOOL clusterByGroupTag; 53 | 54 | // 55 | /// Defines the "zoom" from where the map should start clustering. 56 | /** If the map is zoomed below this value it won't cluster. 57 | default: 0.0 (no min. zoom)*/ 58 | @property(nonatomic, assign) CLLocationDegrees minLongitudeDeltaToCluster; 59 | 60 | // 61 | /// Defines how many annotations are needed to build a cluster 62 | /** If a cluster contains less annotations, they will shown as they are 63 | default: 0 (no minimum count)*/ 64 | @property(nonatomic, assign) NSUInteger minimumAnnotationCountPerCluster; 65 | 66 | // 67 | /// Clusters all annotations, even if they are outside of the visible MKCoordinateRegion 68 | /* default: NO (checks for boundaries)*/ 69 | @property (nonatomic, assign) BOOL clusterInvisibleViews; 70 | 71 | /// Handles the ignoreList of annotations, calls the defined clustering 72 | /// algorithm and adds the clustered annotations to the map. 73 | - (void)doClustering; 74 | 75 | @end 76 | 77 | 78 | -------------------------------------------------------------------------------- /OClusterMapView+Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/Default-568h@2x.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/Logo/ocmapview_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/Logo/ocmapview_logo.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/Logo/ocmapview_logo512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/Logo/ocmapview_logo512x512.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/Logo/ocmapview_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/Logo/ocmapview_logo@2x.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/Logo/ocmapview_logo~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/Logo/ocmapview_logo~ipad.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/banana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/banana.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/banana@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/banana@2x.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/bananas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/bananas.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/bananas@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/bananas@2x.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/orange.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/orange@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/orange@2x.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/oranges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/oranges.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/oranges@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/oranges@2x.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/regular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/regular.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/Images/sample_pins/regular@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/OClusterMapView+Sample/Images/sample_pins/regular@2x.png -------------------------------------------------------------------------------- /OClusterMapView+Sample/OCDistanceCalculationPerformance.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCDistanceCalculationPerformance.h 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Markus on 25.09.13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface OCDistanceCalculationPerformance : NSObject 12 | 13 | + (void)testDistanceCalculationPerformance; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OCDistanceCalculationPerformance.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCDistanceCalculationPerformance.m 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Markus on 25.09.13. 6 | // 7 | // 8 | 9 | #import 10 | #include 11 | 12 | #import "OCDistanceCalculationPerformance.h" 13 | 14 | void show(NSString *string); 15 | void show(NSString *string) 16 | { 17 | CFShow((__bridge CFTypeRef)string); 18 | } 19 | 20 | double CLLocationCoordinateDistanceM(CLLocationCoordinate2D c1, CLLocationCoordinate2D c2); 21 | double CLLocationCoordinateDistanceM(CLLocationCoordinate2D c1, CLLocationCoordinate2D c2) 22 | { 23 | CLLocationDegrees deltaLat = c1.latitude - c2.latitude; 24 | CLLocationDegrees deltaLong = c1.longitude - c2.longitude; 25 | return sqrt(deltaLat*deltaLat + deltaLong*deltaLong); 26 | } 27 | 28 | double CLLocationCoordinateDistancePow(CLLocationCoordinate2D c1, CLLocationCoordinate2D c2); 29 | double CLLocationCoordinateDistancePow(CLLocationCoordinate2D c1, CLLocationCoordinate2D c2) 30 | { 31 | return sqrt(pow(c1.latitude - c2.latitude , 2.0) + 32 | pow(c1.longitude - c2.longitude, 2.0)); 33 | } 34 | 35 | @implementation OCDistanceCalculationPerformance 36 | 37 | + (void)testDistanceCalculationPerformance; 38 | { 39 | NSNumberFormatter *numFormatter = [[NSNumberFormatter alloc] init]; 40 | [numFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; 41 | 42 | // Performance Test 43 | @autoreleasepool { 44 | NSDate *startDate = [NSDate date]; 45 | int count = 250000, runs = 500; 46 | CLLocation *randomLoc = [self randomCoordinatesGenerator:1][0]; 47 | NSArray *otherLocs = [self randomCoordinatesGenerator:count]; 48 | 49 | show([NSString stringWithFormat:@"Device/OS: '%@', iOS %@", [self platform], [[UIDevice currentDevice] systemVersion]]); 50 | show([NSString stringWithFormat:@"Testing %zd runs of distance calculation per method with %@ coords", runs, [numFormatter stringFromNumber:@(count)]]); 51 | show([NSString stringWithFormat:@">> This will be %@ distance calculations.", [numFormatter stringFromNumber:@(count*runs)]]); 52 | CGFloat firstDuration = 0; 53 | for (int type=0; type<2; type++) { 54 | NSDate *dateForType = [NSDate date]; 55 | for (int i=0; i firstDuration) { 77 | show([NSString stringWithFormat: @"POW was %.3f%% faster.", duration/firstDuration - 1.0]); 78 | } else { 79 | show([NSString stringWithFormat: @"MULTIPLY was %.3f%% faster.", firstDuration/duration - 1.0]); 80 | } 81 | } else { 82 | firstDuration = duration; 83 | } 84 | } 85 | show([NSString stringWithFormat: @"This needed %.2fs in total.", [[NSDate date] timeIntervalSinceDate:startDate]]); 86 | } 87 | } 88 | 89 | // 90 | // Help method which returns an array of random CLLocations 91 | // You can specify the number of coordinates by setting numberOfCoordinates 92 | + (NSArray *)randomCoordinatesGenerator:(int)numberOfCoordinates 93 | { 94 | MKCoordinateRegion sampleRegion = MKCoordinateRegionMake(CLLocationCoordinate2DMake(52.0,13.0), MKCoordinateSpanMake(20.0, 20.0)); 95 | 96 | numberOfCoordinates = MAX(0,numberOfCoordinates); 97 | NSMutableArray *coordinates = [[NSMutableArray alloc] initWithCapacity:numberOfCoordinates]; 98 | for (int i = 0; i < numberOfCoordinates; i++) { 99 | 100 | // start with top left corner 101 | CLLocationDistance longitude = sampleRegion.center.longitude - sampleRegion.span.longitudeDelta/2.0; 102 | CLLocationDistance latitude = sampleRegion.center.latitude + sampleRegion.span.latitudeDelta/2.0; 103 | 104 | // Get random coordinates within current map rect 105 | NSInteger max = NSIntegerMax; 106 | longitude += (arc4random()%max)/(CGFloat)max * sampleRegion.span.longitudeDelta; 107 | latitude -= (arc4random()%max)/(CGFloat)max * sampleRegion.span.latitudeDelta; 108 | 109 | CLLocation *loc = [[CLLocation alloc]initWithLatitude:latitude longitude:longitude]; 110 | [coordinates addObject:loc]; 111 | } 112 | return coordinates; 113 | } 114 | 115 | #pragma mark device info 116 | 117 | + (NSString *) getSysInfoByName:(char *)typeSpecifier 118 | { 119 | size_t size; 120 | sysctlbyname(typeSpecifier, NULL, &size, NULL, 0); 121 | 122 | char *answer = malloc(size); 123 | sysctlbyname(typeSpecifier, answer, &size, NULL, 0); 124 | 125 | NSString *results = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding]; 126 | 127 | free(answer); 128 | return results; 129 | } 130 | 131 | + (NSString *) platform 132 | { 133 | return [self getSysInfoByName:"hw.machine"]; 134 | } 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OCMapViewSampleHelpAnnotation.h: -------------------------------------------------------------------------------- 1 | // 2 | // OCMapViewSampleHelpAnnotation.h 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 17.07.11. 6 | // 7 | 8 | #import 9 | #import 10 | #import "OCGrouping.h" 11 | 12 | @interface OCMapViewSampleHelpAnnotation : NSObject 13 | 14 | @property (nonatomic, assign) CLLocationCoordinate2D coordinate; 15 | @property (nonatomic, copy) NSString *title; 16 | @property (nonatomic, copy) NSString *subtitle; 17 | @property (nonatomic, copy) NSString *groupTag; 18 | 19 | - (id)initWithCoordinate:(CLLocationCoordinate2D)aCoordinate; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OCMapViewSampleHelpAnnotation.m: -------------------------------------------------------------------------------- 1 | // 2 | // OCMapViewSampleHelpAnnotation.m 3 | // openClusterMapView 4 | // 5 | // Created by Botond Kis on 17.07.11. 6 | // 7 | 8 | #import "OCMapViewSampleHelpAnnotation.h" 9 | 10 | @implementation OCMapViewSampleHelpAnnotation 11 | 12 | - (id)initWithCoordinate:(CLLocationCoordinate2D)aCoordinate 13 | { 14 | self = [super init]; 15 | if (self) { 16 | _coordinate = aCoordinate; 17 | } 18 | return self; 19 | } 20 | 21 | #pragma mark equality 22 | 23 | - (BOOL)isEqual:(OCMapViewSampleHelpAnnotation*)annotation; 24 | { 25 | if (![annotation isKindOfClass:[OCMapViewSampleHelpAnnotation class]]) { 26 | return NO; 27 | } 28 | 29 | return (self.coordinate.latitude == annotation.coordinate.latitude && 30 | self.coordinate.longitude == annotation.coordinate.longitude && 31 | [self.title isEqualToString:annotation.title] && 32 | [self.subtitle isEqualToString:annotation.subtitle] && 33 | [self.groupTag isEqualToString:annotation.groupTag]); 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OClusterMapView+Sample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | ocmapview_logo 14 | ocmapview_logo~ipad 15 | 16 | CFBundleIdentifier 17 | com..${PRODUCT_NAME:rfc1034identifier} 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | ${PRODUCT_NAME} 22 | CFBundlePackageType 23 | APPL 24 | CFBundleShortVersionString 25 | 1.0 26 | CFBundleVersion 27 | 1.0 28 | LSRequiresIPhoneOS 29 | 30 | UISupportedInterfaceOrientations 31 | 32 | UIInterfaceOrientationPortrait 33 | UIInterfaceOrientationLandscapeLeft 34 | UIInterfaceOrientationLandscapeRight 35 | 36 | UISupportedInterfaceOrientations~ipad 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | UIInterfaceOrientationPortraitUpsideDown 42 | 43 | UIViewControllerBasedStatusBarAppearance 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OClusterMapView+Sample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OClusterMapView+Sample' target in the 'OClusterMapView+Sample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OClusterMapView_SampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OClusterMapView_SampleAppDelegate.h 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Botond Kis on 25.09.11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OClusterMapView_SampleAppDelegate : NSObject 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OClusterMapView_SampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // OClusterMapView_SampleAppDelegate.m 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Botond Kis on 25.09.11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "OClusterMapView_SampleAppDelegate.h" 10 | 11 | #import "OClusterMapView_SampleViewController.h" 12 | #import "OCDistanceCalculationPerformance.h" 13 | 14 | @implementation OClusterMapView_SampleAppDelegate 15 | 16 | @synthesize window = _window; 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 19 | { 20 | NSString *nibName = @"OClusterMapView_SampleViewController-iPhone"; 21 | if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { 22 | nibName = @"OClusterMapView_SampleViewController-iPad"; 23 | } 24 | 25 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 26 | self.window.rootViewController = [[OClusterMapView_SampleViewController alloc] 27 | initWithNibName:nibName bundle:nil]; 28 | [self.window makeKeyAndVisible]; 29 | 30 | // [OCDistanceCalculationPerformance testDistanceCalculationPerformance]; 31 | 32 | return YES; 33 | } 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/OClusterMapView_SampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OClusterMapView_SampleViewController.h 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Botond Kis on 25.09.11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "OCMapView.h" 12 | 13 | @interface OClusterMapView_SampleViewController : UIViewController 14 | 15 | @property (nonatomic, strong) IBOutlet UILabel *labelNumberOfAnnotations; 16 | @property (nonatomic, strong) IBOutlet OCMapView *mapView; 17 | 18 | - (IBAction)removeButtonTouchUpInside:(id)sender; 19 | - (IBAction)addButtonTouchUpInside:(id)sender; 20 | - (IBAction)clusteringButtonTouchUpInside:(UIButton *)sender; 21 | - (IBAction)addOneButtonTouchupInside:(id)sender; 22 | - (IBAction)changeClusterMethodButtonTouchUpInside:(UIButton *)sender; 23 | - (IBAction)buttonGroupByTagTouchUpInside:(UIButton *)sender; 24 | 25 | - (NSArray *)randomCoordinatesGenerator:(int)numberOfCoordinates; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /OClusterMapView+Sample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OClusterMapView+Sample 4 | // 5 | // Created by Botond Kis on 25.09.11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | @autoreleasepool { 14 | int retVal = UIApplicationMain(argc, argv, nil, @"OClusterMapView_SampleAppDelegate"); 15 | return retVal; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## What is OCMapView? 2 | 3 | **OpenClusterMapView** is a simple and easy to use extension of `MKMapView` for iOS. If you are displaying a lot of annotations on the map, this class is made for you. 4 | 5 | OCMapView automatically creates clusters by combining annotations super fast. 6 | It works with any iOS application. No code changes needed. 7 | 8 | ## Screenshots: 9 | ![Screenshots](screenshots.jpg "Screenshots") 10 | 11 | ## Features 12 | 13 | - Fast and easy! Handle **over 9000** annotations on the map at once. 14 | - Very simple usage! No code changes needed, just replace the MapView class 15 | - Easy to integrate! Keep all `MKMapView` delegate methods as they are 16 | - Customize the `MKAnnotationViews` of generated clusters like any other annotation 17 | - Customize behavior like the cluster size 18 | - Two different clustering algorithms 19 | - Provide an ignore list of annotations, that wont be clustered 20 | - Create independent clusters by using groups 21 | 22 | ## Setup 23 | 24 | ### Cocoapods 25 | 26 | - Just install the pod using `pod 'OCMapView'` 27 | 28 | ### Manually 29 | 30 | - Add the `OCMapView` folder to your project. 31 | - Link with the `MapKit` and `CoreLocation` frameworks 32 | 33 | ## Background: 34 | 35 | You may already have encountered the problem: When adding a several hundred annotations to the `MKMapView`, it will get laggy and everything but user friendly. 36 | 37 | Many developers believe that iOS can't handle a huge amount of annotations on a `MKMapView` due to the low memory capacities of iDevices. So they start to handle the annotation management themselves with pretty dumb filter methods which won't display all annotations and confuse users even more. 38 | 39 | The actual problem is not memory related. It rather occurs because *annotationViews* are `UIViews` and these are extremely slow. So if you scroll/zoom a `MKMapView` with many annotations, iOS has to redraw them all at once and that will take time. 40 | 41 | **OCMapView** combines multiple annotations in a specified range and displays them just as ***a single*** `annotationView` for the whole cluster. So you'll never have too many views which make your app slow and laggy. In addition to that forget to handle the annotations yourself! Just add them **all** to your **OCMapView** and it will do everything for you. Even the iPhone 3G with iOS 3.1.x can handle a couple thousand annotations without lagging! 42 | 43 | ## Usage 44 | 45 | Just replace your `MKMapView` references with `OCMapView`. It automatically handles annotations and combines them to **clusters** for you without any other change of your code. 46 | 47 | Add the annotations you want to display as usual and implement the same `MKMapViewDelegate` methods like before. The handling stays completely the same so you can easily use custom views for your annotations and clusters. The `viewForAnnotation` delegate method will return `OCAnnotation` objects for generated clusters. This is how to provide custom views: 48 | 49 | 50 | - (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id )annotation{ 51 | // if it's a cluster 52 | if ([annotation isKindOfClass:[OCAnnotation class]]) { 53 | // create your custom cluster annotationView here! 54 | } 55 | // If it's a single annotation 56 | else if([annotation isKindOfClass:[Your_Annotation class]]){ 57 | // create your custom annotationView as regular here! 58 | } 59 | return Your_annotationView; 60 | } 61 | 62 | For more informations, have a look at the example project. 63 | 64 | ## Grouping 65 | 66 | You can cluster different groups of annotations, as seen on the screenshots above, like this: 67 | 68 | Implement the `OCGrouping` protocol on your annotation class, set its grouping-tag and set the `clusterByGroupTag` property of your `OCMapView` to `true`. Take a look at the sample project to see how it works. 69 | 70 | ## Contribute 71 | Apps that use OCMapView: 72 | - official Car2Go App 73 | - cost control for Car2Go aka. aCar2Go 74 | - AbHof 75 | - and a lot of more who do not tell me ;) 76 | 77 | If you are using OCMapView and want to contribute, please contact me to add your app to the list of supporting apps! 78 | 79 | ![OpenClusterMapView Logo](OClusterMapView+Sample/Images/Logo/ocmapview_logo@2x.png "OpenClusterMapView Logo") -------------------------------------------------------------------------------- /screenshots.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BotiKis/OCMapView/46261ecd9c081bec6dd14799029b1b363a6c55b1/screenshots.jpg --------------------------------------------------------------------------------