summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyle.mm
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-01-25 10:46:27 -0800
committerGitHub <noreply@github.com>2018-01-25 10:46:27 -0800
commitb6747a84f4ba6bd48ab2d461e04cffa7fc8d5348 (patch)
treee01efa0e57e6dc5a0a55db2f68bc964cb6fb1606 /platform/darwin/src/MGLStyle.mm
parenta4546a84de28cfddfcb1e5a4ba8b0516a4b4dfa4 (diff)
downloadqtlocation-mapboxgl-b6747a84f4ba6bd48ab2d461e04cffa7fc8d5348.tar.gz
[ios, macos] Hook up hillshade style layers, raster DEM sources to iOS/macOS (#11036)
* [ios, macos] Finished implementing MGLHillshadeStyleLayer * [macos] Added icon for hillshade layer Also set the background layer icon to mirror in right-to-left locales. * [ios, macos] Implemented raster DEM source * [macos] Added Enhance Terrain debugging command * [ios, macos] Simplified raster DEM source example
Diffstat (limited to 'platform/darwin/src/MGLStyle.mm')
-rw-r--r--platform/darwin/src/MGLStyle.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index fefd8fcf37..5128944312 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -8,6 +8,7 @@
#import "MGLLineStyleLayer.h"
#import "MGLCircleStyleLayer.h"
#import "MGLSymbolStyleLayer.h"
+#import "MGLHillshadeStyleLayer.h"
#import "MGLRasterStyleLayer.h"
#import "MGLBackgroundStyleLayer.h"
#import "MGLOpenGLStyleLayer.h"
@@ -19,6 +20,7 @@
#import "MGLVectorSource.h"
#import "MGLVectorSource_Private.h"
#import "MGLRasterSource.h"
+#import "MGLRasterDEMSource.h"
#import "MGLShapeSource.h"
#import "MGLImageSource.h"
@@ -34,12 +36,14 @@
#include <mbgl/style/layers/line_layer.hpp>
#include <mbgl/style/layers/symbol_layer.hpp>
#include <mbgl/style/layers/raster_layer.hpp>
+#include <mbgl/style/layers/hillshade_layer.hpp>
#include <mbgl/style/layers/circle_layer.hpp>
#include <mbgl/style/layers/background_layer.hpp>
#include <mbgl/style/layers/custom_layer.hpp>
#include <mbgl/style/sources/geojson_source.hpp>
#include <mbgl/style/sources/vector_source.hpp>
#include <mbgl/style/sources/raster_source.hpp>
+#include <mbgl/style/sources/raster_dem_source.hpp>
#include <mbgl/style/sources/image_source.hpp>
#import "NSDate+MGLAdditions.h"
@@ -231,6 +235,8 @@ static NSURL *MGLStyleURL_trafficNight;
return [[MGLShapeSource alloc] initWithRawSource:geoJSONSource mapView:self.mapView];
} else if (auto rasterSource = rawSource->as<mbgl::style::RasterSource>()) {
return [[MGLRasterSource alloc] initWithRawSource:rasterSource mapView:self.mapView];
+ } else if (auto rasterDEMSource = rawSource->as<mbgl::style::RasterDEMSource>()) {
+ return [[MGLRasterDEMSource alloc] initWithRawSource:rasterDEMSource mapView:self.mapView];
} else if (auto imageSource = rawSource->as<mbgl::style::ImageSource>()) {
return [[MGLImageSource alloc] initWithRawSource:imageSource mapView:self.mapView];
} else {
@@ -395,6 +401,8 @@ static NSURL *MGLStyleURL_trafficNight;
return [[MGLSymbolStyleLayer alloc] initWithRawLayer:symbolLayer];
} else if (auto rasterLayer = rawLayer->as<mbgl::style::RasterLayer>()) {
return [[MGLRasterStyleLayer alloc] initWithRawLayer:rasterLayer];
+ } else if (auto hillshadeLayer = rawLayer->as<mbgl::style::HillshadeLayer>()) {
+ return [[MGLHillshadeStyleLayer alloc] initWithRawLayer:hillshadeLayer];
} else if (auto circleLayer = rawLayer->as<mbgl::style::CircleLayer>()) {
return [[MGLCircleStyleLayer alloc] initWithRawLayer:circleLayer];
} else if (auto backgroundLayer = rawLayer->as<mbgl::style::BackgroundLayer>()) {