Toggle navigation
Toggle navigation
This project
Loading...
Sign in
尹诚
/
Mapbox-iOS-SDK
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Thomas Rasch
13 years ago
Commit
8cfebf9662110ff1404d589f617703ae0caf33bb
1 parent
9ac509c2
o Prevent some race conditions in cluster markers
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
MapView/Map/RMQuadTree.m
MapView/Map/RMQuadTree.m
View file @
8cfebf9
...
...
@@ -66,8 +66,12 @@
-
(
void
)
dealloc
{
mapView
=
nil
;
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
@synchronized
(
cachedClusterAnnotation
)
{
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
}
@synchronized
(
annotations
)
{
...
...
@@ -273,7 +277,14 @@
-
(
NSArray
*
)
clusteredAnnotations
{
return
cachedClusterEnclosedAnnotations
;
NSArray
*
clusteredAnnotations
=
nil
;
@synchronized
(
cachedClusterAnnotation
)
{
clusteredAnnotations
=
[
NSArray
arrayWithArray
:
cachedClusterEnclosedAnnotations
];
}
return
clusteredAnnotations
;
}
-
(
void
)
addAnnotationsInBoundingBox
:
(
RMProjectedRect
)
aBoundingBox
toMutableArray
:
(
NSMutableArray
*
)
someArray
createClusterAnnotations
:
(
BOOL
)
createClusterAnnotations
withClusterSize
:
(
RMProjectedSize
)
clusterSize
findGravityCenter
:
(
BOOL
)
findGravityCenter
...
...
@@ -318,8 +329,11 @@
if
(
forceClustering
)
{
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
@synchronized
(
cachedClusterAnnotation
)
{
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
}
enclosedAnnotations
=
[
NSArray
arrayWithArray
:
annotationsToCheck
];
}
...
...
@@ -330,10 +344,13 @@
if
(
!
enclosedAnnotations
)
enclosedAnnotations
=
self
.
enclosedAnnotations
;
if
(
cachedClusterAnnotation
&&
[
enclosedAnnotations
count
]
!=
[
cachedClusterEnclosedAnnotations
count
]
)
@synchronized
(
cachedClusterAnnotation
)
{
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
if
(
cachedClusterAnnotation
&&
[
enclosedAnnotations
count
]
!=
[
cachedClusterEnclosedAnnotations
count
])
{
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
}
}
if
(
!
cachedClusterAnnotation
)
...
...
@@ -444,8 +461,11 @@
if
(
parentNode
)
[
parentNode
removeUpwardsAllCachedClusterAnnotations
];
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
@synchronized
(
cachedClusterAnnotation
)
{
[
cachedClusterAnnotation
release
];
cachedClusterAnnotation
=
nil
;
[
cachedClusterEnclosedAnnotations
release
];
cachedClusterEnclosedAnnotations
=
nil
;
}
}
@end
...
...
Please
register
or
login
to post a comment