diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.java
new file mode 100644
index 00000000000..ee6fc5d7b75
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.java
@@ -0,0 +1,93 @@
+package com.mapbox.mapboxsdk.style.sources;
+
+import android.support.annotation.Nullable;
+import android.support.annotation.UiThread;
+
+import java.net.URL;
+
+/**
+ * A raster DEM source. Currently only supports Mapbox Terrain RGB (mapbox://mapbox.terrain-rgb)
+ *
+ * @see The style specification
+ */
+@UiThread
+public class RasterDemSource extends Source {
+ public static final int DEFAULT_TILE_SIZE = 512;
+
+ /**
+ * Internal use
+ *
+ * @param nativePtr - pointer to native peer
+ */
+ private RasterDemSource(long nativePtr) {
+ super(nativePtr);
+ }
+
+ /**
+ * Create the raster dem source from an URL
+ *
+ * @param id the source id
+ * @param url the source url
+ */
+ public RasterDemSource(String id, URL url) {
+ this(id, url.toExternalForm());
+ }
+
+ /**
+ * Create the raster dem source from an URL
+ *
+ * @param id the source id
+ * @param url the source url
+ */
+ public RasterDemSource(String id, String url) {
+ initialize(id, url, DEFAULT_TILE_SIZE);
+ }
+
+ /**
+ * Create the raster source from an URL with a specific tile size
+ *
+ * @param id the source id
+ * @param url the source url
+ * @param tileSize the tile size
+ */
+ public RasterDemSource(String id, String url, int tileSize) {
+ initialize(id, url, tileSize);
+ }
+
+ /**
+ * Create the raster dem source from a {@link TileSet}
+ *
+ * @param id the source id
+ * @param tileSet the {@link TileSet}
+ */
+ public RasterDemSource(String id, TileSet tileSet) {
+ initialize(id, tileSet.toValueObject(), DEFAULT_TILE_SIZE);
+ }
+
+ /**
+ * Create the raster source from a {@link TileSet} with a specific tile size
+ *
+ * @param id the source id
+ * @param tileSet the {@link TileSet}
+ * @param tileSize tje tile size
+ */
+ public RasterDemSource(String id, TileSet tileSet, int tileSize) {
+ initialize(id, tileSet.toValueObject(), tileSize);
+ }
+
+ /**
+ * @return The url or null
+ */
+ @Nullable
+ public String getUrl() {
+ return nativeGetUrl();
+ }
+
+ protected native void initialize(String layerId, Object payload, int tileSize);
+
+ @Override
+ protected native void finalize() throws Throwable;
+
+ protected native String nativeGetUrl();
+
+}
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
index 003fc1df6c6..89f922fb9e7 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
@@ -778,6 +778,17 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.FeatureOverviewActivity"/>
+
+
+
+
{
+ mapboxMap = map;
+
+ RasterDemSource rasterDemSource = new RasterDemSource(SOURCE_ID, SOURCE_URL);
+ mapboxMap.addSource(rasterDemSource);
+
+ HillshadeLayer hillshadeLayer = new HillshadeLayer(LAYER_ID, SOURCE_ID);
+ mapboxMap.addLayerBelow(hillshadeLayer, LAYER_BELOW_ID);
+ });
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ mapView.onStart();
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mapView.onResume();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ mapView.onPause();
+ }
+
+ @Override
+ protected void onStop() {
+ super.onStop();
+ mapView.onStop();
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ mapView.onSaveInstanceState(outState);
+ }
+
+ @Override
+ public void onLowMemory() {
+ super.onLowMemory();
+ mapView.onLowMemory();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ mapView.onDestroy();
+ }
+}
\ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_fill_extrusion_layer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_fill_extrusion_layer.xml
index 304841dc698..5672687ef8d 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_fill_extrusion_layer.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_fill_extrusion_layer.xml
@@ -9,9 +9,11 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
- app:mapbox_cameraTargetLat="52.090710"
- app:mapbox_cameraTargetLng="5.121125"
- app:mapbox_cameraZoom="10"
+ app:mapbox_cameraTargetLat="46.343350"
+ app:mapbox_cameraTargetLng="7.497989"
+ app:mapbox_cameraZoom="9"
+ app:mapbox_cameraBearing="140"
+ app:mapbox_cameraTilt="60"
app:mapbox_styleUrl="@string/mapbox_style_mapbox_streets"/>
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_hillshade_layer.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_hillshade_layer.xml
new file mode 100644
index 00000000000..a2410c547cc
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_hillshade_layer.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
index e70c3410a87..e867046c80e 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml
@@ -69,4 +69,5 @@
Animate a map rendered on a TextureView
Example Custom Geometry Source
Suzhou using Droid Sans for Chinese glyphs
+ Example raster-dem source and hillshade layer
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
index c4d13e10687..47fee31c0ae 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml
@@ -69,4 +69,5 @@
TextureView animation
Grid Source
Local CJK glyph generation
+ Hillshade
\ No newline at end of file
diff --git a/platform/android/config.cmake b/platform/android/config.cmake
index 54c6bbee401..4832f8b2515 100644
--- a/platform/android/config.cmake
+++ b/platform/android/config.cmake
@@ -186,6 +186,8 @@ add_library(mbgl-android STATIC
platform/android/src/style/sources/vector_source.hpp
platform/android/src/style/sources/image_source.hpp
platform/android/src/style/sources/image_source.cpp
+ platform/android/src/style/sources/raster_dem_source.cpp
+ platform/android/src/style/sources/raster_dem_source.hpp
platform/android/src/style/functions/stop.cpp
platform/android/src/style/functions/stop.hpp
platform/android/src/style/functions/categorical_stops.cpp
diff --git a/platform/android/src/style/sources/raster_dem_source.cpp b/platform/android/src/style/sources/raster_dem_source.cpp
new file mode 100644
index 00000000000..75e0159d7c0
--- /dev/null
+++ b/platform/android/src/style/sources/raster_dem_source.cpp
@@ -0,0 +1,63 @@
+#include "raster_dem_source.hpp"
+
+#include "../android_conversion.hpp"
+#include "../value.hpp"
+#include "../conversion/url_or_tileset.hpp"
+#include "source.hpp"
+
+#include
+
+#include
+
+namespace mbgl {
+namespace android {
+
+ RasterDEMSource::RasterDEMSource(jni::JNIEnv& env, jni::String sourceId, jni::Object<> urlOrTileSet, jni::jint tileSize)
+ : Source(
+ env,
+ std::make_unique(
+ jni::Make(env, sourceId),
+ convertURLOrTileset(Value(env, urlOrTileSet)),
+ tileSize
+ )
+ ) {
+ }
+
+ RasterDEMSource::RasterDEMSource(jni::JNIEnv& env,
+ mbgl::style::Source& coreSource,
+ AndroidRendererFrontend& frontend)
+ : Source(env, coreSource, createJavaPeer(env), frontend) {
+ }
+
+ RasterDEMSource::~RasterDEMSource() = default;
+
+ jni::String RasterDEMSource::getURL(jni::JNIEnv& env) {
+ optional url = source.as()->RasterDEMSource::getURL();
+ return url ? jni::Make(env, *url) : jni::String();
+ }
+
+ jni::Class RasterDEMSource::javaClass;
+
+ jni::Object