committed by
Minh Nguyễn
parent
d668c0fa84
commit
b7223f249d
@@ -98,4 +98,28 @@
|
||||
NSStringFromClass([self class]), self, _centerCoordinate.latitude, _centerCoordinate.longitude, _altitude, _heading, _pitch];
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)other
|
||||
{
|
||||
if ( ! [other isKindOfClass:[self class]])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
if (other == self)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
MGLMapCamera *otherCamera = other;
|
||||
return (_centerCoordinate.latitude == otherCamera.centerCoordinate.latitude
|
||||
&& _centerCoordinate.longitude == otherCamera.centerCoordinate.longitude
|
||||
&& _altitude == otherCamera.altitude
|
||||
&& _pitch == otherCamera.pitch && _heading == otherCamera.heading);
|
||||
}
|
||||
|
||||
- (NSUInteger)hash
|
||||
{
|
||||
return (@(_centerCoordinate.latitude).hash + @(_centerCoordinate.longitude).hash
|
||||
+ @(_altitude).hash + @(_pitch).hash + @(_heading).hash);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1750,6 +1750,11 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration)
|
||||
|
||||
- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion
|
||||
{
|
||||
if ([self.camera isEqual:camera])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_mbglMap->cancelTransitions();
|
||||
mbgl::CameraOptions options = [self cameraOptionsObjectForAnimatingToCamera:camera];
|
||||
if (duration > 0)
|
||||
@@ -1778,6 +1783,11 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration)
|
||||
|
||||
- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion
|
||||
{
|
||||
if ([self.camera isEqual:camera])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_mbglMap->cancelTransitions();
|
||||
mbgl::CameraOptions options = [self cameraOptionsObjectForAnimatingToCamera:camera];
|
||||
if (duration >= 0)
|
||||
|
||||
@@ -946,6 +946,9 @@ public:
|
||||
|
||||
- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion {
|
||||
_mbglMap->cancelTransitions();
|
||||
if ([self.camera isEqual:camera]) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::CameraOptions options = [self cameraOptionsObjectForAnimatingToCamera:camera];
|
||||
if (duration > 0) {
|
||||
@@ -974,6 +977,9 @@ public:
|
||||
|
||||
- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion {
|
||||
_mbglMap->cancelTransitions();
|
||||
if ([self.camera isEqual:camera]) {
|
||||
return;
|
||||
}
|
||||
|
||||
mbgl::CameraOptions options = [self cameraOptionsObjectForAnimatingToCamera:camera];
|
||||
if (duration >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user