summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapView+Impl.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/MGLMapView+Impl.mm')
-rw-r--r--platform/ios/src/MGLMapView+Impl.mm114
1 files changed, 0 insertions, 114 deletions
diff --git a/platform/ios/src/MGLMapView+Impl.mm b/platform/ios/src/MGLMapView+Impl.mm
deleted file mode 100644
index 0b9ab75699..0000000000
--- a/platform/ios/src/MGLMapView+Impl.mm
+++ /dev/null
@@ -1,114 +0,0 @@
-#import "MGLMapView+Impl.h"
-#import "MGLMapView+OpenGL.h"
-#import "MGLStyle_Private.h"
-#import "NSBundle+MGLAdditions.h"
-
-#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
-#import "MMEEventsManager.h"
-#endif
-
-std::unique_ptr<MGLMapViewImpl> MGLMapViewImpl::Create(MGLMapView* nativeView) {
- return std::make_unique<MGLMapViewOpenGLImpl>(nativeView);
-}
-
-MGLMapViewImpl::MGLMapViewImpl(MGLMapView* nativeView_) : mapView(nativeView_) {
-}
-
-void MGLMapViewImpl::render() {
- [mapView renderSync];
-}
-
-void MGLMapViewImpl::onCameraWillChange(mbgl::MapObserver::CameraChangeMode mode) {
- bool animated = mode == mbgl::MapObserver::CameraChangeMode::Animated;
- [mapView cameraWillChangeAnimated:animated];
-}
-
-void MGLMapViewImpl::onCameraIsChanging() {
- [mapView cameraIsChanging];
-}
-
-void MGLMapViewImpl::onCameraDidChange(mbgl::MapObserver::CameraChangeMode mode) {
- bool animated = mode == mbgl::MapObserver::CameraChangeMode::Animated;
- [mapView cameraDidChangeAnimated:animated];
-}
-
-void MGLMapViewImpl::onWillStartLoadingMap() {
- [mapView mapViewWillStartLoadingMap];
-}
-
-void MGLMapViewImpl::onDidFinishLoadingMap() {
- [mapView mapViewDidFinishLoadingMap];
-}
-
-void MGLMapViewImpl::onDidFailLoadingMap(mbgl::MapLoadError mapError, const std::string& what) {
- NSString *description;
- MGLErrorCode code;
- switch (mapError) {
- case mbgl::MapLoadError::StyleParseError:
- code = MGLErrorCodeParseStyleFailed;
- description = NSLocalizedStringWithDefaultValue(@"PARSE_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style is corrupted.", @"User-friendly error description");
- break;
- case mbgl::MapLoadError::StyleLoadError:
- code = MGLErrorCodeLoadStyleFailed;
- description = NSLocalizedStringWithDefaultValue(@"LOAD_STYLE_FAILED_DESC", nil, nil, @"The map failed to load because the style can't be loaded.", @"User-friendly error description");
- break;
- case mbgl::MapLoadError::NotFoundError:
- code = MGLErrorCodeNotFound;
- description = NSLocalizedStringWithDefaultValue(@"STYLE_NOT_FOUND_DESC", nil, nil, @"The map failed to load because the style can’t be found or is incompatible.", @"User-friendly error description");
- break;
- default:
- code = MGLErrorCodeUnknown;
- description = NSLocalizedStringWithDefaultValue(@"LOAD_MAP_FAILED_DESC", nil, nil, @"The map failed to load because an unknown error occurred.", @"User-friendly error description");
- }
- NSDictionary *userInfo = @{
- NSLocalizedDescriptionKey: description,
- NSLocalizedFailureReasonErrorKey: @(what.c_str()),
- };
- NSError *error = [NSError errorWithDomain:MGLErrorDomain code:code userInfo:userInfo];
-#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
- [[MMEEventsManager sharedManager] reportError:error];
-#endif
- [mapView mapViewDidFailLoadingMapWithError:error];
-}
-
-void MGLMapViewImpl::onWillStartRenderingFrame() {
- [mapView mapViewWillStartRenderingFrame];
-}
-
-void MGLMapViewImpl::onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus status) {
- bool fullyRendered = status.mode == mbgl::MapObserver::RenderMode::Full;
- [mapView mapViewDidFinishRenderingFrameFullyRendered:fullyRendered];
-}
-
-void MGLMapViewImpl::onWillStartRenderingMap() {
- [mapView mapViewWillStartRenderingMap];
-}
-
-void MGLMapViewImpl::onDidFinishRenderingMap(mbgl::MapObserver::RenderMode mode) {
- bool fullyRendered = mode == mbgl::MapObserver::RenderMode::Full;
- [mapView mapViewDidFinishRenderingMapFullyRendered:fullyRendered];
-}
-
-void MGLMapViewImpl::onDidFinishLoadingStyle() {
- [mapView mapViewDidFinishLoadingStyle];
-}
-
-void MGLMapViewImpl::onSourceChanged(mbgl::style::Source& source) {
- NSString *identifier = @(source.getID().c_str());
- MGLSource * nativeSource = [mapView.style sourceWithIdentifier:identifier];
- [mapView sourceDidChange:nativeSource];
-}
-
-void MGLMapViewImpl::onDidBecomeIdle() {
- [mapView mapViewDidBecomeIdle];
-}
-
-void MGLMapViewImpl::onStyleImageMissing(const std::string& imageIdentifier) {
- NSString *imageName = [NSString stringWithUTF8String:imageIdentifier.c_str()];
- [mapView didFailToLoadImage:imageName];
-}
-
-bool MGLMapViewImpl::onCanRemoveUnusedStyleImage(const std::string &imageIdentifier) {
- NSString *imageName = [NSString stringWithUTF8String:imageIdentifier.c_str()];
- return [mapView shouldRemoveStyleImage:imageName];
-}