From 32654cbe15e7d11cd674d3b95f0e7c0bf0c9d819 Mon Sep 17 00:00:00 2001 From: langsmith Date: Fri, 7 Jun 2019 12:32:02 -0700 Subject: [PATCH] initial changes --- .../mapboxandroiddemo/MainActivity.java | 10 +++++----- .../src/main/AndroidManifest.xml | 4 ++-- .../examples/dds/DrawPolygonActivity.java | 4 ++-- .../dds/ExpressionIntegrationActivity.java | 2 +- .../examples/dds/PolygonHolesActivity.java | 20 +++++++++---------- .../javaservices/MapMatchingActivity.java | 2 +- .../query/BuildingOutlineActivity.java | 2 +- ...va => SatelliteOpacityOnZoomActivity.java} | 5 ++--- ...y_dds_multiple_expression_integration.xml} | 0 .../main/res/layout/activity_isochrone.xml | 2 +- .../activity_lab_recycler_view_on_map.xml | 2 +- ...=> activity_satellite_opacity_on_zoom.xml} | 0 .../src/main/res/values/activity_strings.xml | 1 + .../main/res/values/descriptions_strings.xml | 4 ++-- .../src/main/res/values/titles_strings.xml | 4 ++-- .../src/main/res/values/urls_strings.xml | 4 ++-- 16 files changed, 32 insertions(+), 34 deletions(-) rename MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/{StyleFadeSwitchActivity.java => SatelliteOpacityOnZoomActivity.java} (96%) rename MapboxAndroidDemo/src/main/res/layout/{activity_dds_temperature_change.xml => activity_dds_multiple_expression_integration.xml} (100%) rename MapboxAndroidDemo/src/main/res/layout/{activity_style_fade_switch.xml => activity_satellite_opacity_on_zoom.xml} (100%) diff --git a/MapboxAndroidDemo/src/global/java/com/mapbox/mapboxandroiddemo/MainActivity.java b/MapboxAndroidDemo/src/global/java/com/mapbox/mapboxandroiddemo/MainActivity.java index 13dca0d8b..4407231a4 100644 --- a/MapboxAndroidDemo/src/global/java/com/mapbox/mapboxandroiddemo/MainActivity.java +++ b/MapboxAndroidDemo/src/global/java/com/mapbox/mapboxandroiddemo/MainActivity.java @@ -136,7 +136,7 @@ import com.mapbox.mapboxandroiddemo.examples.styles.MissingIconActivity; import com.mapbox.mapboxandroiddemo.examples.styles.RotatingTextAnchorPositionActivity; import com.mapbox.mapboxandroiddemo.examples.styles.ShowHideLayersActivity; -import com.mapbox.mapboxandroiddemo.examples.styles.StyleFadeSwitchActivity; +import com.mapbox.mapboxandroiddemo.examples.styles.SatelliteOpacityOnZoomActivity; import com.mapbox.mapboxandroiddemo.examples.styles.TextFieldFormattingActivity; import com.mapbox.mapboxandroiddemo.examples.styles.TextFieldMultipleFormatsActivity; import com.mapbox.mapboxandroiddemo.examples.styles.TransparentBackgroundActivity; @@ -638,11 +638,11 @@ private void initializeModels() { exampleItemModels.add(new ExampleItemModel( R.id.nav_styles, - R.string.activity_styles_fade_switch_title, - R.string.activity_styles_fade_switch_description, - new Intent(MainActivity.this, StyleFadeSwitchActivity.class), + R.string.activity_styles_satellite_opacity_on_zoom_title, + R.string.activity_style_satellite_opacity_on_zoom_description, + new Intent(MainActivity.this, SatelliteOpacityOnZoomActivity.class), null, - R.string.activity_styles_fade_switch_url, false, BuildConfig.MIN_SDK_VERSION)); + R.string.activity_style_satellite_opacity_on_zoom_url, false, BuildConfig.MIN_SDK_VERSION)); exampleItemModels.add(new ExampleItemModel( R.id.nav_styles, diff --git a/MapboxAndroidDemo/src/main/AndroidManifest.xml b/MapboxAndroidDemo/src/main/AndroidManifest.xml index 0026dd5a6..e633a6415 100644 --- a/MapboxAndroidDemo/src/main/AndroidManifest.xml +++ b/MapboxAndroidDemo/src/main/AndroidManifest.xml @@ -398,8 +398,8 @@ android:value="com.mapbox.mapboxandroiddemo.MainActivity" /> + android:name=".examples.styles.SatelliteOpacityOnZoomActivity" + android:label="@string/activity_styles_satellite_opacity_on_zoom_title"> diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/DrawPolygonActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/DrawPolygonActivity.java index ed248f95f..cbc2e90cd 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/DrawPolygonActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/DrawPolygonActivity.java @@ -68,8 +68,8 @@ public void onMapReady(@NonNull final MapboxMap mapboxMap) { @Override public void onStyleLoaded(@NonNull Style style) { style.addSource(new GeoJsonSource("source-id", Polygon.fromLngLats(POINTS))); - style.addLayer(new FillLayer("layer-id", "source-id").withProperties( - fillColor(Color.parseColor("#3bb2d0"))) + style.addLayerBelow(new FillLayer("layer-id", "source-id").withProperties( + fillColor(Color.parseColor("#3bb2d0"))), "settlement-label" ); } }); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/ExpressionIntegrationActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/ExpressionIntegrationActivity.java index cadffa7ac..50d898bf5 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/ExpressionIntegrationActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/ExpressionIntegrationActivity.java @@ -113,7 +113,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { Mapbox.getInstance(this, getString(R.string.access_token)); // This contains the MapView in XML and needs to be called after the access token is configured. - setContentView(R.layout.activity_dds_temperature_change); + setContentView(R.layout.activity_dds_multiple_expression_integration); unitsFab = findViewById(R.id.change_units_fab); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/PolygonHolesActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/PolygonHolesActivity.java index 1bbbc2842..8745edded 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/PolygonHolesActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/PolygonHolesActivity.java @@ -46,16 +46,14 @@ protected void onCreate(Bundle savedInstanceState) { Mapbox.getInstance(this, getString(R.string.access_token)); // Configure initial map state - MapboxMapOptions options = new MapboxMapOptions() + MapboxMapOptions mapboxMapOptions = MapboxMapOptions.createFromAttributes(this, null); + mapboxMapOptions + .camera(new CameraPosition.Builder().zoom(13).target(new LatLng(25.255377, 55.3089185)) + .build()) .attributionTintColor(RED_COLOR) - .compassFadesWhenFacingNorth(false) - .camera(new CameraPosition.Builder() - .target(new LatLng(25.255377, 55.3089185)) - .zoom(11.86) - .tilt(10) - .build()); - - mapView = new MapView(this, options); + .compassFadesWhenFacingNorth(true); + + mapView = new MapView(this, mapboxMapOptions); mapView.setId(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); @@ -80,9 +78,9 @@ public void onStyleLoaded(@NonNull Style style) { style.addSource(new GeoJsonSource("source-id", Feature.fromGeometry(Polygon.fromOuterInner(outerLineString, innerList)))); - style.addLayer(new FillLayer("layer-id", "source-id").withProperties( + style.addLayerBelow(new FillLayer("layer-id", "source-id").withProperties( PropertyFactory.fillColor(BLUE_COLOR) - )); + ), "road-number-shield"); } }); } diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/javaservices/MapMatchingActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/javaservices/MapMatchingActivity.java index 27e5eeaf2..9c3a5dd47 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/javaservices/MapMatchingActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/javaservices/MapMatchingActivity.java @@ -171,7 +171,7 @@ private void drawBeforeMapMatching(Feature feature) { map.getStyle(style -> { style.addSource(new GeoJsonSource("pre-matched-source-id", feature)); style.addLayer(new LineLayer("pre-matched-layer-id", "pre-matched-source-id").withProperties( - lineColor(ColorUtils.colorToRgbaString(Color.parseColor("#3bb2d0"))), + lineColor(ColorUtils.colorToRgbaString(Color.parseColor("#c14a00"))), lineWidth(6f), lineOpacity(1f) )); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/BuildingOutlineActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/BuildingOutlineActivity.java index fc52489a6..e4e3143cf 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/BuildingOutlineActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/BuildingOutlineActivity.java @@ -70,7 +70,7 @@ public void onStyleLoaded(@NonNull Style style) { setUpLineLayer(style); mapboxMap.addOnCameraIdleListener(BuildingOutlineActivity.this); showCrosshair(); - Toast.makeText(BuildingOutlineActivity.this, R.string.move_map_around_instruction, + Toast.makeText(BuildingOutlineActivity.this, R.string.move_map_around_building_out_instruction, Toast.LENGTH_SHORT).show(); updateOutline(style); } diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/StyleFadeSwitchActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/SatelliteOpacityOnZoomActivity.java similarity index 96% rename from MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/StyleFadeSwitchActivity.java rename to MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/SatelliteOpacityOnZoomActivity.java index f16ae23f7..c7856e942 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/StyleFadeSwitchActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/SatelliteOpacityOnZoomActivity.java @@ -26,7 +26,7 @@ * Go from the Mapbox Streets style to a satellite photo raster layer as the map camera zooms in. * This is similar to how Snap uses Mapbox for Snap Maps. */ -public class StyleFadeSwitchActivity extends AppCompatActivity implements +public class SatelliteOpacityOnZoomActivity extends AppCompatActivity implements OnMapReadyCallback { private MapView mapView; @@ -40,7 +40,7 @@ protected void onCreate(Bundle savedInstanceState) { Mapbox.getInstance(this, getString(R.string.access_token)); // This contains the MapView in XML and needs to be called after the access token is configured. - setContentView(R.layout.activity_style_fade_switch); + setContentView(R.layout.activity_satellite_opacity_on_zoom); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); @@ -71,7 +71,6 @@ public void onStyleLoaded(@NonNull Style style) { CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder() .zoom(19) .build()), 9000); - } }); } diff --git a/MapboxAndroidDemo/src/main/res/layout/activity_dds_temperature_change.xml b/MapboxAndroidDemo/src/main/res/layout/activity_dds_multiple_expression_integration.xml similarity index 100% rename from MapboxAndroidDemo/src/main/res/layout/activity_dds_temperature_change.xml rename to MapboxAndroidDemo/src/main/res/layout/activity_dds_multiple_expression_integration.xml diff --git a/MapboxAndroidDemo/src/main/res/layout/activity_isochrone.xml b/MapboxAndroidDemo/src/main/res/layout/activity_isochrone.xml index e1c9750bb..19d5a7950 100644 --- a/MapboxAndroidDemo/src/main/res/layout/activity_isochrone.xml +++ b/MapboxAndroidDemo/src/main/res/layout/activity_isochrone.xml @@ -13,7 +13,7 @@ android:layout_height="match_parent" mapbox:mapbox_cameraTargetLat="41.89306" mapbox:mapbox_cameraTargetLng="12.48278" - mapbox:mapbox_cameraZoom="11" /> + mapbox:mapbox_cameraZoom="8" /> + android:layout_marginBottom="32dp" /> \ No newline at end of file diff --git a/MapboxAndroidDemo/src/main/res/layout/activity_style_fade_switch.xml b/MapboxAndroidDemo/src/main/res/layout/activity_satellite_opacity_on_zoom.xml similarity index 100% rename from MapboxAndroidDemo/src/main/res/layout/activity_style_fade_switch.xml rename to MapboxAndroidDemo/src/main/res/layout/activity_satellite_opacity_on_zoom.xml diff --git a/MapboxAndroidDemo/src/main/res/values/activity_strings.xml b/MapboxAndroidDemo/src/main/res/values/activity_strings.xml index 6cc663838..b5b52796a 100644 --- a/MapboxAndroidDemo/src/main/res/values/activity_strings.xml +++ b/MapboxAndroidDemo/src/main/res/values/activity_strings.xml @@ -268,6 +268,7 @@ This map style doesn\'t have a building layer + Move map to place red dot on a building Move map around diff --git a/MapboxAndroidDemo/src/main/res/values/descriptions_strings.xml b/MapboxAndroidDemo/src/main/res/values/descriptions_strings.xml index 0e71365f5..1215ac0f5 100644 --- a/MapboxAndroidDemo/src/main/res/values/descriptions_strings.xml +++ b/MapboxAndroidDemo/src/main/res/values/descriptions_strings.xml @@ -30,7 +30,7 @@ Use an image source and a runnable to show data changes over time. Use an image source to easily display images on the map. Use elevation data to show and customize hills and mountains. - Fade map styles in and out based on zoom level. + Adjust the opacity of a satellite raster layer based on zoom level. Use a format expression to style labels with multiple languages, fonts, sizes, and colors. Create a transparent background and fill it with something such as moving water. Select a photo on the device and add it on the map tap location. @@ -53,7 +53,7 @@ Filter and draw multiple geometries from a single GeoJSON file. Use data-driven styling to show bathymetry (water depth) data Use SymbolLayer and icons to show data in a BubbleLayout "info window". - Use multiple expressions to visualize unit change in data. + Use multiple expressions to convert and visualize data. View satellite photos and click to outline an area of land. Change SymbolLayer icons based on the camera\'s zoom level. Create a default marker with an InfoWindow. diff --git a/MapboxAndroidDemo/src/main/res/values/titles_strings.xml b/MapboxAndroidDemo/src/main/res/values/titles_strings.xml index f05d22232..17ef16437 100644 --- a/MapboxAndroidDemo/src/main/res/values/titles_strings.xml +++ b/MapboxAndroidDemo/src/main/res/values/titles_strings.xml @@ -27,7 +27,7 @@ Show time lapse Use an image source Hillshading - Switch map styles with fade + Opacity fade Multiple text formats Transparent render surface Click to add photo @@ -52,7 +52,7 @@ Display water depth Symbol layer info window SymbolLayer clustering - Temperature change + Multiple expressions Satellite land select Line gradient Zoom-based icon switch diff --git a/MapboxAndroidDemo/src/main/res/values/urls_strings.xml b/MapboxAndroidDemo/src/main/res/values/urls_strings.xml index 9791ef290..636870912 100644 --- a/MapboxAndroidDemo/src/main/res/values/urls_strings.xml +++ b/MapboxAndroidDemo/src/main/res/values/urls_strings.xml @@ -29,7 +29,7 @@ http://i.imgur.com/ijoGPrF.png https://i.imgur.com/I6B6cCE.png https://i.imgur.com/U2OKixV.png - https://i.imgur.com/1sPnDx5.png + https://i.imgur.com/1sPnDx5.png https://i.imgur.com/dpiGiTg.png https://i.imgur.com/5bYnlp5.png https://i.imgur.com/uPIH5Ck.png @@ -98,7 +98,7 @@ https://i.imgur.com/1jG8WQG.png https://i.imgur.com/4HiEJC1.png http://i.imgur.com/uATgul1.png - http://i.imgur.com/bWvVbwC.png + https://i.imgur.com/ig8gGnY.png https://i.imgur.com/OiveDFG.png https://i.imgur.com/KgfsY3s.png http://i.imgur.com/XegvIKr.png