summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLHillshadeStyleLayer.h
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/MGLHillshadeStyleLayer.h
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/MGLHillshadeStyleLayer.h')
-rw-r--r--platform/darwin/src/MGLHillshadeStyleLayer.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/platform/darwin/src/MGLHillshadeStyleLayer.h b/platform/darwin/src/MGLHillshadeStyleLayer.h
index 199bf214c2..b2eeb59aba 100644
--- a/platform/darwin/src/MGLHillshadeStyleLayer.h
+++ b/platform/darwin/src/MGLHillshadeStyleLayer.h
@@ -2,7 +2,7 @@
// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLFoundation.h"
-#import "MGLVectorStyleLayer.h"
+#import "MGLForegroundStyleLayer.h"
NS_ASSUME_NONNULL_BEGIN
@@ -24,8 +24,20 @@ typedef NS_ENUM(NSUInteger, MGLHillshadeIlluminationAnchor) {
};
/**
- Client-side hillshading visualization based on DEM data. Currently, the
- implementation only supports Mapbox Terrain RGB tiles
+ An `MGLHillshadeStyleLayer` is a style layer that renders raster <a
+ href="https://en.wikipedia.org/wiki/Digital_elevation_model">digital elevation
+ model</a> (DEM) tiles on the map.
+
+ Use a hillshade style layer to configure the color parameters of raster tiles
+ loaded by an `MGLRasterDEMSource` object. For example, you could use a
+ hillshade style layer to render <a
+ href="https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb">Mapbox
+ Terrain-RGB</a> data.
+
+ To display posterized hillshading based on vector shapes, as with the <a
+ href="https://www.mapbox.com/vector-tiles/mapbox-terrain/">Mapbox Terrain</a>
+ source, use an `MGLVectorSource` object in conjunction with several
+ `MGLFillStyleLayer` objects.
You can access an existing hillshade style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
@@ -36,10 +48,15 @@ typedef NS_ENUM(NSUInteger, MGLHillshadeIlluminationAnchor) {
### Example
```swift
+ let layer = MGLHillshadeStyleLayer(identifier: "hills", source: source)
+ layer.hillshadeExaggeration = NSExpression(forConstantValue: 0.6)
+ if let canalShadowLayer = mapView.style?.layer(withIdentifier: "waterway-river-canal-shadow") {
+ mapView.style?.insertLayer(layer, below: canalShadowLayer)
+ }
```
*/
MGL_EXPORT
-@interface MGLHillshadeStyleLayer : MGLVectorStyleLayer
+@interface MGLHillshadeStyleLayer : MGLForegroundStyleLayer
/**
Returns a hillshade style layer initialized with an identifier and source.