diff --git a/ApiDemos/java/app/src/gms/res/layout/styled_map_demo.xml b/ApiDemos/java/app/src/gms/res/layout/styled_map_demo.xml index 200f8d02b..b580736da 100644 --- a/ApiDemos/java/app/src/gms/res/layout/styled_map_demo.xml +++ b/ApiDemos/java/app/src/gms/res/layout/styled_map_demo.xml @@ -1,18 +1,20 @@ - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + diff --git a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/DemoDetailsList.kt b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/DemoDetailsList.kt index 776f45997..faaedcb5b 100644 --- a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/DemoDetailsList.kt +++ b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/DemoDetailsList.kt @@ -22,117 +22,120 @@ import com.example.kotlindemos.polyline.PolylineDemoActivity * A list of all the demos we have available. */ class DemoDetailsList { - companion object { - val DEMOS = listOf( - DemoDetails(R.string.basic_demo_label, - R.string.basic_demo_details, - BasicMapDemoActivity::class.java), - DemoDetails(R.string.background_color_customization_demo_label, - R.string.background_color_customization_demo_description, - BackgroundColorCustomizationDemoActivity::class.java), - DemoDetails(R.string.background_color_customization_programmatic_demo_label, - R.string.background_color_customization_programmatic_demo_description, - BackgroundColorCustomizationProgrammaticDemoActivity::class.java), - DemoDetails(R.string.camera_demo_label, - R.string.camera_demo_description, - CameraDemoActivity::class.java), - DemoDetails(R.string.camera_clamping_demo_label, - R.string.camera_clamping_demo_description, - CameraClampingDemoActivity::class.java), - DemoDetails(R.string.circle_demo_label, R.string.circle_demo_details, - CircleDemoActivity::class.java), - DemoDetails(R.string.cloud_styling_label, R.string.cloud_styling_description, - CloudBasedMapStylingDemoActivity::class.java), - DemoDetails(R.string.close_info_window_demo_label, - R.string.close_info_window_demo_details, - MarkerCloseInfoWindowOnRetapDemoActivity::class.java), - DemoDetails(R.string.events_demo_label, - R.string.events_demo_details, - EventsDemoActivity::class.java), - DemoDetails(R.string.ground_overlay_demo_label, - R.string.ground_overlay_demo_details, - GroundOverlayDemoActivity::class.java), - DemoDetails(R.string.indoor_demo_label, - R.string.indoor_demo_details, - IndoorDemoActivity::class.java), - DemoDetails(R.string.layers_demo_label, - R.string.layers_demo_description, - LayersDemoActivity::class.java), - DemoDetails(R.string.lite_demo_label, - R.string.lite_demo_details, - LiteDemoActivity::class.java), - DemoDetails(R.string.location_source_demo_label, - R.string.location_source_demo_description, - LocationSourceDemoActivity::class.java), - DemoDetails(R.string.lite_list_demo_label, - R.string.lite_list_demo_details, - LiteListDemoActivity::class.java), - DemoDetails(R.string.map_in_pager_demo_label, - R.string.map_in_pager_demo_description, - MapInPagerDemoActivity::class.java), - DemoDetails(R.string.markers_demo_label, - R.string.markers_demo_description, - MarkerDemoActivity::class.java), - DemoDetails(R.string.multi_map_demo_label, - R.string.multi_map_demo_description, - MultiMapDemoActivity::class.java), - DemoDetails(R.string.my_location_demo_label, - R.string.my_location_demo_details, - MyLocationDemoActivity::class.java), - DemoDetails(R.string.options_demo_label, - R.string.options_demo_description, - OptionsDemoActivity::class.java), - DemoDetails(R.string.polygon_demo_label, - R.string.polygon_demo_details, - PolygonDemoActivity::class.java), - DemoDetails(R.string.polyline_demo_label, - R.string.polyline_demo_description, - PolylineDemoActivity::class.java), - DemoDetails(R.string.programmatic_demo_label, - R.string.programmatic_demo_description, - ProgrammaticDemoActivity::class.java), - DemoDetails(R.string.raw_map_view_demo_label, - R.string.raw_map_view_demo_description, - RawMapViewDemoActivity::class.java), - DemoDetails(R.string.save_state_demo_label, - R.string.save_state_demo_description, - SaveStateDemoActivity::class.java), - DemoDetails(R.string.snapshot_demo_label, - R.string.snapshot_demo_description, - SnapshotDemoActivity::class.java), - DemoDetails(R.string.street_view_panorama_basic_demo_label, - R.string.street_view_panorama_basic_demo_details, - StreetViewPanoramaBasicDemoActivity::class.java), - DemoDetails(R.string.street_view_panorama_navigation_demo_label, - R.string.street_view_panorama_navigation_demo_details, - StreetViewPanoramaNavigationDemoActivity::class.java), - DemoDetails(R.string.split_street_view_panorama_and_map_demo_label, - R.string.split_street_view_panorama_and_map_demo_details, - SplitStreetViewPanoramaAndMapDemoActivity::class.java), - DemoDetails(R.string.street_view_panorama_options_demo_label, - R.string.street_view_panorama_options_demo_details, - StreetViewPanoramaOptionsDemoActivity::class.java), - DemoDetails(R.string.street_view_panorama_events_demo_label, - R.string.street_view_panorama_events_demo_details, - StreetViewPanoramaEventsDemoActivity::class.java), - DemoDetails(R.string.street_view_panorama_view_demo_label, - R.string.street_view_panorama_view_demo_details, - StreetViewPanoramaViewDemoActivity::class.java), - DemoDetails(R.string.tags_demo_label, - R.string.tags_demo_details, - TagsDemoActivity::class.java), - DemoDetails(R.string.tile_coordinate_demo_label, - R.string.tile_coordinate_demo_description, - TileCoordinateDemoActivity::class.java), - DemoDetails(R.string.tile_overlay_demo_label, - R.string.tile_overlay_demo_description, - TileOverlayDemoActivity::class.java), - DemoDetails(R.string.ui_settings_demo_label, - R.string.ui_settings_demo_details, - UiSettingsDemoActivity::class.java), - DemoDetails(R.string.region_demo_label, - R.string.region_demo_details, - VisibleRegionDemoActivity::class.java) - ) - } + companion object { + val DEMOS = listOf( + DemoDetails(R.string.basic_demo_label, + R.string.basic_demo_details, + BasicMapDemoActivity::class.java), + DemoDetails(R.string.background_color_customization_demo_label, + R.string.background_color_customization_demo_description, + BackgroundColorCustomizationDemoActivity::class.java), + DemoDetails(R.string.background_color_customization_programmatic_demo_label, + R.string.background_color_customization_programmatic_demo_description, + BackgroundColorCustomizationProgrammaticDemoActivity::class.java), + DemoDetails(R.string.camera_demo_label, + R.string.camera_demo_description, + CameraDemoActivity::class.java), + DemoDetails(R.string.camera_clamping_demo_label, + R.string.camera_clamping_demo_description, + CameraClampingDemoActivity::class.java), + DemoDetails(R.string.circle_demo_label, R.string.circle_demo_details, + CircleDemoActivity::class.java), + DemoDetails(R.string.cloud_styling_label, R.string.cloud_styling_description, + CloudBasedMapStylingDemoActivity::class.java), + DemoDetails(R.string.close_info_window_demo_label, + R.string.close_info_window_demo_details, + MarkerCloseInfoWindowOnRetapDemoActivity::class.java), + DemoDetails(R.string.events_demo_label, + R.string.events_demo_details, + EventsDemoActivity::class.java), + DemoDetails(R.string.ground_overlay_demo_label, + R.string.ground_overlay_demo_details, + GroundOverlayDemoActivity::class.java), + DemoDetails(R.string.indoor_demo_label, + R.string.indoor_demo_details, + IndoorDemoActivity::class.java), + DemoDetails(R.string.layers_demo_label, + R.string.layers_demo_description, + LayersDemoActivity::class.java), + DemoDetails(R.string.lite_demo_label, + R.string.lite_demo_details, + LiteDemoActivity::class.java), + DemoDetails(R.string.location_source_demo_label, + R.string.location_source_demo_description, + LocationSourceDemoActivity::class.java), + DemoDetails(R.string.lite_list_demo_label, + R.string.lite_list_demo_details, + LiteListDemoActivity::class.java), + DemoDetails(R.string.map_in_pager_demo_label, + R.string.map_in_pager_demo_description, + MapInPagerDemoActivity::class.java), + DemoDetails(R.string.markers_demo_label, + R.string.markers_demo_description, + MarkerDemoActivity::class.java), + DemoDetails(R.string.multi_map_demo_label, + R.string.multi_map_demo_description, + MultiMapDemoActivity::class.java), + DemoDetails(R.string.my_location_demo_label, + R.string.my_location_demo_details, + MyLocationDemoActivity::class.java), + DemoDetails(R.string.options_demo_label, + R.string.options_demo_description, + OptionsDemoActivity::class.java), + DemoDetails(R.string.polygon_demo_label, + R.string.polygon_demo_details, + PolygonDemoActivity::class.java), + DemoDetails(R.string.polyline_demo_label, + R.string.polyline_demo_description, + PolylineDemoActivity::class.java), + DemoDetails(R.string.programmatic_demo_label, + R.string.programmatic_demo_description, + ProgrammaticDemoActivity::class.java), + DemoDetails(R.string.raw_map_view_demo_label, + R.string.raw_map_view_demo_description, + RawMapViewDemoActivity::class.java), + DemoDetails(R.string.save_state_demo_label, + R.string.save_state_demo_description, + SaveStateDemoActivity::class.java), + DemoDetails(R.string.snapshot_demo_label, + R.string.snapshot_demo_description, + SnapshotDemoActivity::class.java), + DemoDetails(R.string.street_view_panorama_basic_demo_label, + R.string.street_view_panorama_basic_demo_details, + StreetViewPanoramaBasicDemoActivity::class.java), + DemoDetails(R.string.street_view_panorama_navigation_demo_label, + R.string.street_view_panorama_navigation_demo_details, + StreetViewPanoramaNavigationDemoActivity::class.java), + DemoDetails(R.string.split_street_view_panorama_and_map_demo_label, + R.string.split_street_view_panorama_and_map_demo_details, + SplitStreetViewPanoramaAndMapDemoActivity::class.java), + DemoDetails(R.string.street_view_panorama_options_demo_label, + R.string.street_view_panorama_options_demo_details, + StreetViewPanoramaOptionsDemoActivity::class.java), + DemoDetails(R.string.street_view_panorama_events_demo_label, + R.string.street_view_panorama_events_demo_details, + StreetViewPanoramaEventsDemoActivity::class.java), + DemoDetails(R.string.street_view_panorama_view_demo_label, + R.string.street_view_panorama_view_demo_details, + StreetViewPanoramaViewDemoActivity::class.java), + DemoDetails(R.string.styled_map_demo_label, + R.string.styled_map_demo_description, + StyledMapDemoActivity::class.java), + DemoDetails(R.string.tags_demo_label, + R.string.tags_demo_details, + TagsDemoActivity::class.java), + DemoDetails(R.string.tile_coordinate_demo_label, + R.string.tile_coordinate_demo_description, + TileCoordinateDemoActivity::class.java), + DemoDetails(R.string.tile_overlay_demo_label, + R.string.tile_overlay_demo_description, + TileOverlayDemoActivity::class.java), + DemoDetails(R.string.ui_settings_demo_label, + R.string.ui_settings_demo_details, + UiSettingsDemoActivity::class.java), + DemoDetails(R.string.region_demo_label, + R.string.region_demo_details, + VisibleRegionDemoActivity::class.java) + ) + } } \ No newline at end of file diff --git a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/StyledMapDemoActivity.kt b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/StyledMapDemoActivity.kt new file mode 100644 index 000000000..b808d3ac5 --- /dev/null +++ b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/StyledMapDemoActivity.kt @@ -0,0 +1,146 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.kotlindemos + +import android.content.DialogInterface +import android.os.Bundle +import android.util.Log +import android.view.Menu +import android.view.MenuItem +import android.widget.Toast +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity +import com.google.android.gms.maps.CameraUpdateFactory +import com.google.android.gms.maps.GoogleMap +import com.google.android.gms.maps.OnMapReadyCallback +import com.google.android.gms.maps.SupportMapFragment +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.MapStyleOptions +import java.util.ArrayList + +class StyledMapDemoActivity : AppCompatActivity(), OnMapReadyCallback { + + private var mMap: GoogleMap? = null + private var mSelectedStyleId = R.string.style_label_default + + companion object { + private const val TAG = "StyledMapDemoActivity" + private const val SELECTED_STYLE = "selected_style" + private val SYDNEY = LatLng(-33.8688, 151.2093) + } + + private val mStyleIds = intArrayOf( + R.string.style_label_retro, + R.string.style_label_night, + R.string.style_label_grayscale, + R.string.style_label_no_pois_no_transit, + R.string.style_label_default + ) + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + if (savedInstanceState != null) { + mSelectedStyleId = savedInstanceState.getInt(SELECTED_STYLE) + } + setContentView(R.layout.styled_map_demo) + + val mapFragment = + supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment + mapFragment.getMapAsync(this) + } + + override fun onSaveInstanceState(outState: Bundle) { + outState.putInt(SELECTED_STYLE, mSelectedStyleId) + super.onSaveInstanceState(outState) + } + + override fun onMapReady(map: GoogleMap) { + mMap = map + mMap?.moveCamera(CameraUpdateFactory.newLatLngZoom(SYDNEY, 14f)) + setSelectedStyle() + } + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.styled_map, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + if (item.itemId == R.id.menu_style_choose) { + showStylesDialog() + } + return true + } + + private fun showStylesDialog() { + val styleNames = ArrayList() + for (style in mStyleIds) { + styleNames.add(getString(style)) + } + + val builder = AlertDialog.Builder(this) + builder.setTitle(getString(R.string.style_choose)) + builder.setItems(styleNames.toTypedArray(), + DialogInterface.OnClickListener { _, which -> + mSelectedStyleId = mStyleIds[which] + val msg = getString(R.string.style_set_to, getString(mSelectedStyleId)) + Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show() + Log.d(TAG, msg) + setSelectedStyle() + }) + builder.show() + } + + private fun setSelectedStyle() { + val style: MapStyleOptions? + val id = mSelectedStyleId + style = when (id) { + R.string.style_label_retro -> + MapStyleOptions.loadRawResourceStyle(this, R.raw.mapstyle_retro) + R.string.style_label_night -> + MapStyleOptions.loadRawResourceStyle(this, R.raw.mapstyle_night) + R.string.style_label_grayscale -> + MapStyleOptions.loadRawResourceStyle(this, R.raw.mapstyle_grayscale) + R.string.style_label_no_pois_no_transit -> + MapStyleOptions( + "[" + + " {" + + " \"featureType\":\"poi.business\"," + + " \"elementType\":\"all\"," + + " \"stylers\":[" + + " {" + + " \"visibility\":\"off\"" + + " }" + + " ]" + + " }," + + " {" + + " \"featureType\":\"transit\"," + + " \"elementType\":\"all\"," + + " \"stylers\":[" + + " {" + + " \"visibility\":\"off\"" + + " }" + + " ]" + + " }" + + "]" + ) + R.string.style_label_default -> null + else -> return + } + mMap?.setMapStyle(style) + } +} diff --git a/ApiDemos/kotlin/app/src/main/res/layout/styled_map_demo.xml b/ApiDemos/kotlin/app/src/main/res/layout/styled_map_demo.xml new file mode 100644 index 000000000..19962c44b --- /dev/null +++ b/ApiDemos/kotlin/app/src/main/res/layout/styled_map_demo.xml @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/ApiDemos/kotlin/app/src/main/res/menu/styled_map.xml b/ApiDemos/kotlin/app/src/main/res/menu/styled_map.xml new file mode 100644 index 000000000..04a161b60 --- /dev/null +++ b/ApiDemos/kotlin/app/src/main/res/menu/styled_map.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_grayscale.json b/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_grayscale.json new file mode 100644 index 000000000..1cdce0c9f --- /dev/null +++ b/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_grayscale.json @@ -0,0 +1,101 @@ +[ + { + "featureType": "all", + "elementType": "geometry", + "stylers": [ + { + "color": "#f5f5f5" + } + ] + }, + { + "featureType": "all", + "elementType": "labels.icon", + "stylers": [ + { + "saturation": -100 + } + ] + }, + { + "featureType": "all", + "elementType": "labels.text", + "stylers": [ + { + "saturation": -100 + } + ] + }, + { + "featureType": "poi", + "elementType": "geometry", + "stylers": [ + { + "color": "#eeeeee" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "geometry", + "stylers": [ + { + "color": "#e5e5e5" + } + ] + }, + { + "featureType": "road", + "elementType": "geometry", + "stylers": [ + { + "color": "#ffffff" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry", + "stylers": [ + { + "color": "#dadada" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "labels.icon", + "stylers": [ + { + "lightness": 30 + } + ] + }, + { + "featureType": "transit.line", + "elementType": "geometry", + "stylers": [ + { + "color": "#e5e5e5" + } + ] + }, + { + "featureType": "transit.station", + "elementType": "geometry", + "stylers": [ + { + "color": "#eeeeee" + } + ] + }, + { + "featureType": "water", + "elementType": "geometry", + "stylers": [ + { + "color": "#c9c9c9" + } + ] + } +] \ No newline at end of file diff --git a/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_night.json b/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_night.json new file mode 100644 index 000000000..0d2c32bcf --- /dev/null +++ b/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_night.json @@ -0,0 +1,191 @@ +[ + { + "featureType": "all", + "elementType": "geometry", + "stylers": [ + { + "color": "#242f3e" + } + ] + }, + { + "featureType": "all", + "elementType": "labels.text.stroke", + "stylers": [ + { + "lightness": -80 + } + ] + }, + { + "featureType": "administrative", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#746855" + } + ] + }, + { + "featureType": "administrative.locality", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#d59563" + } + ] + }, + { + "featureType": "poi", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#d59563" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "geometry", + "stylers": [ + { + "color": "#263c3f" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#6b9a76" + } + ] + }, + { + "featureType": "road", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#2b3544" + } + ] + }, + { + "featureType": "road", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#9ca5b3" + } + ] + }, + { + "featureType": "road.arterial", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#38414e" + } + ] + }, + { + "featureType": "road.arterial", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#212a37" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#746855" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#1f2835" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#f3d19c" + } + ] + }, + { + "featureType": "road.local", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#38414e" + } + ] + }, + { + "featureType": "road.local", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#212a37" + } + ] + }, + { + "featureType": "transit", + "elementType": "geometry", + "stylers": [ + { + "color": "#2f3948" + } + ] + }, + { + "featureType": "transit.station", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#d59563" + } + ] + }, + { + "featureType": "water", + "elementType": "geometry", + "stylers": [ + { + "color": "#17263c" + } + ] + }, + { + "featureType": "water", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#515c6d" + } + ] + }, + { + "featureType": "water", + "elementType": "labels.text.stroke", + "stylers": [ + { + "lightness": -20 + } + ] + } +] \ No newline at end of file diff --git a/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_retro.json b/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_retro.json new file mode 100644 index 000000000..b1342101e --- /dev/null +++ b/ApiDemos/kotlin/app/src/main/res/raw/mapstyle_retro.json @@ -0,0 +1,191 @@ +[ + { + "featureType": "all", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#755f5d" + } + ] + }, + { + "featureType": "administrative", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#d4ccb9" + } + ] + }, + { + "featureType": "administrative.country", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#baafae" + } + ] + }, + { + "featureType": "administrative.land_parcel", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#d4ccb9" + } + ] + }, + { + "featureType": "landscape.man_made", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#ebe3cd" + } + ] + }, + { + "featureType": "landscape.natural", + "elementType": "geometry", + "stylers": [ + { + "color": "#ebe3cd" + } + ] + }, + { + "featureType": "landscape.natural", + "elementType": "geometry.fill", + "stylers": [ + { + "lightness": -10 + } + ] + }, + { + "featureType": "poi", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#d4ccb9" + } + ] + }, + { + "featureType": "poi", + "elementType": "labels.icon", + "stylers": [ + { + "hue": "#ff7f00" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#9ba56f" + } + ] + }, + { + "featureType": "road", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#f5f1e6" + } + ] + }, + { + "featureType": "road", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#dfd8c3" + } + ] + }, + { + "featureType": "road.arterial", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#fdfcf8" + } + ] + }, + { + "featureType": "road.arterial", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#e4e3df" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#f2cb77" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#ecb43d" + } + ] + }, + { + "featureType": "road.highway.controlled_access", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#e98d58" + } + ] + }, + { + "featureType": "road.highway.controlled_access", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#d27f4f" + } + ] + }, + { + "featureType": "transit.line", + "elementType": "geometry", + "stylers": [ + { + "color": "#d4ccb9" + } + ] + }, + { + "featureType": "transit.station.airport", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#d4ccb9" + } + ] + }, + { + "featureType": "water", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#b9d3c2" + } + ] + } +] \ No newline at end of file diff --git a/ApiDemos/kotlin/app/src/main/res/values/strings.xml b/ApiDemos/kotlin/app/src/main/res/values/strings.xml index 12d26dd31..e0fcba6fd 100644 --- a/ApiDemos/kotlin/app/src/main/res/values/strings.xml +++ b/ApiDemos/kotlin/app/src/main/res/values/strings.xml @@ -336,4 +336,16 @@ description="Text displayed below the Background Color Customization - Programmatic demo title.">Demonstrates how to programmatically set a custom background color to a map. Show Map Tiles + + Styled Map + Demonstrates how to style a map. + Retro + Night + Grayscale + No POIs or transit + Default + Choose style + Style set to: %1$s + + \ No newline at end of file diff --git a/ApiDemos/kotlin/local.defaults.properties b/ApiDemos/kotlin/local.defaults.properties index b46923660..450b82c16 100644 --- a/ApiDemos/kotlin/local.defaults.properties +++ b/ApiDemos/kotlin/local.defaults.properties @@ -1 +1 @@ -MAPS_API_KEY=STUB_API_KEY +MAPS_API_KEY=STUB_API_KEY \ No newline at end of file