From 1a9bccbb850c637583c18e7409e3b87a0dd9ff79 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 30 Mar 2017 17:01:52 -0700 Subject: [core] Add DDS support for icon-image --- .../mapboxsdk/testapp/style/SymbolLayerTest.java | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java') diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java index 4c63509798..e8af375d66 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java @@ -494,6 +494,51 @@ public class SymbolLayerTest extends BaseStyleTest { } + @Test + public void testIconImageAsIdentitySourceFunction() { + checkViewIsDisplayed(R.id.mapView); + Timber.i("icon-image"); + assertNotNull(layer); + + // Set + layer.setProperties( + iconImage(property("FeaturePropertyA", Stops.identity())) + ); + + // Verify + assertNotNull(layer.getIconImage()); + assertNotNull(layer.getIconImage().getFunction()); + assertEquals(SourceFunction.class, layer.getIconImage().getFunction().getClass()); + assertEquals("FeaturePropertyA", ((SourceFunction) layer.getIconImage().getFunction()).getProperty()); + assertEquals(IdentityStops.class, layer.getIconImage().getFunction().getStops().getClass()); + } + + @Test + public void testIconImageAsIntervalSourceFunction() { + checkViewIsDisplayed(R.id.mapView); + Timber.i("icon-image"); + assertNotNull(layer); + + // Set + layer.setProperties( + iconImage( + property( + "FeaturePropertyA", + interval( + stop(1, iconImage("undefined")) + ) + ) + ) + ); + + // Verify + assertNotNull(layer.getIconImage()); + assertNotNull(layer.getIconImage().getFunction()); + assertEquals(SourceFunction.class, layer.getIconImage().getFunction().getClass()); + assertEquals("FeaturePropertyA", ((SourceFunction) layer.getIconImage().getFunction()).getProperty()); + assertEquals(IntervalStops.class, layer.getIconImage().getFunction().getStops().getClass()); + } + @Test public void testIconRotateAsConstant() { checkViewIsDisplayed(R.id.mapView); -- cgit v1.2.1