diff --git a/CHANGELOG.md b/CHANGELOG.md
index d1567ccfb9..c2d04ffddf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@ Mapbox welcomes participation and contributions from everyone.
# 11.6.0-rc.1
## Features ✨ and improvements 🏁
* Support negative values for `CircleLayer.circleBlur` to render inner glow effect.
+* Add new `Style.STANDARD_SATELLITE` style that combines updated satellite imagery and vector layers.
+* Introduce new import configuration properties for `Style.STANDARD`: `theme`, `show3dObjects` which could be set with `Style.setStyleImportConfigProperty`.
+* [compose] Extend `StandardStyleConfigurationState` with `theme: ThemeValue` and `show3dObjects: BooleanValue` properties.
+* [compose] Introduce composable function `MapboxStandardSatelliteStyle` with dedicated `StandardSatelliteStyleConfigurationState`.
## Bug fixes 🐞
* Fix elevated line occlusion issue in 2D mode.
@@ -13,6 +17,7 @@ Mapbox welcomes participation and contributions from everyone.
## Dependencies
* Update gl-native to v11.6.0-rc.1 and common to v24.6.0-rc.1.
+
## Known issues
* `ClipLayer` property `clipLayerTypes` is not updated in runtime. The fix is expected to land in stable 11.6.0.
diff --git a/app/src/main/assets/fragment-realestate-NY.json b/app/src/main/assets/fragment-realestate-NY.json
index e9c61a8208..d0241658c0 100644
--- a/app/src/main/assets/fragment-realestate-NY.json
+++ b/app/src/main/assets/fragment-realestate-NY.json
@@ -9,7 +9,9 @@
"showPointOfInterestLabels": true,
"showTransitLabels": false,
"showPlaceLabels": true,
- "showRoadLabels": false
+ "showRoadLabels": false,
+ "theme": "monochrome",
+ "show3dObjects": true
}
}
],
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/StandardStyleActivity.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/StandardStyleActivity.kt
index 8a61235ed4..b7443b4c20 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/StandardStyleActivity.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/StandardStyleActivity.kt
@@ -1,6 +1,8 @@
package com.mapbox.maps.testapp.examples
import android.os.Bundle
+import android.view.View
+import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.mapbox.bindgen.Value
import com.mapbox.geojson.LineString
@@ -17,16 +19,18 @@ import com.mapbox.maps.testapp.databinding.ActivityStandardStyleBinding
* Example of working with style imports and the Standard style.
*/
class StandardStyleActivity : AppCompatActivity() {
+
private lateinit var mapboxMap: MapboxMap
private val line = LineString.fromLngLats(LINE_COORDINATES)
private var lightSetting: LightPresets = LightPresets.DUSK
+ private var themeSetting: Theme = Theme.DEFAULT
private var labelsSetting = true
+ private var show3dObjectsSetting = true
private lateinit var binding: ActivityStandardStyleBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityStandardStyleBinding.inflate(layoutInflater)
- setContentView(binding.root)
mapboxMap = binding.mapView.mapboxMap
setContentView(binding.root)
@@ -60,6 +64,22 @@ class StandardStyleActivity : AppCompatActivity() {
}
private fun addOnClickListeners() {
+ binding.fabThemeSetting.setOnClickListener {
+ mapboxMap.getStyle { style ->
+ themeSetting = when (themeSetting) {
+ Theme.DEFAULT -> Theme.FADED
+ Theme.FADED -> Theme.MONOCHROME
+ Theme.MONOCHROME -> Theme.DEFAULT
+ }
+ style.setStyleImportConfigProperty(
+ IMPORT_ID_FOR_STANDARD_STYLE,
+ "theme",
+ themeSetting.value
+ )
+ showAction(it, themeSetting.value.toString())
+ }
+ }
+
// When a user clicks the light setting button change the `lightPreset` config property on the Standard style import
binding.fabLightSetting.setOnClickListener {
mapboxMap.getStyle { style ->
@@ -74,6 +94,7 @@ class StandardStyleActivity : AppCompatActivity() {
"lightPreset",
lightSetting.value
)
+ showAction(it, lightSetting.value.toString())
}
}
@@ -82,14 +103,50 @@ class StandardStyleActivity : AppCompatActivity() {
binding.fabLabelsSetting.setOnClickListener {
mapboxMap.getStyle { style ->
labelsSetting = !labelsSetting
- style.setStyleImportConfigProperty(IMPORT_ID_FOR_STANDARD_STYLE, "showPlaceLabels", Value.valueOf(labelsSetting))
- style.setStyleImportConfigProperty(IMPORT_ID_FOR_STANDARD_STYLE, "showRoadLabels", Value.valueOf(labelsSetting))
- style.setStyleImportConfigProperty(IMPORT_ID_FOR_STANDARD_STYLE, "showPointInterestLabels", Value.valueOf(labelsSetting))
- style.setStyleImportConfigProperty(IMPORT_ID_FOR_STANDARD_STYLE, "showTransitLabels", Value.valueOf(labelsSetting))
+ style.setStyleImportConfigProperty(
+ IMPORT_ID_FOR_STANDARD_STYLE,
+ "showPlaceLabels",
+ Value.valueOf(labelsSetting)
+ )
+ style.setStyleImportConfigProperty(
+ IMPORT_ID_FOR_STANDARD_STYLE,
+ "showRoadLabels",
+ Value.valueOf(labelsSetting)
+ )
+ style.setStyleImportConfigProperty(
+ IMPORT_ID_FOR_STANDARD_STYLE,
+ "showPointInterestLabels",
+ Value.valueOf(labelsSetting)
+ )
+ style.setStyleImportConfigProperty(
+ IMPORT_ID_FOR_STANDARD_STYLE,
+ "showTransitLabels",
+ Value.valueOf(labelsSetting)
+ )
+ showAction(it, labelsSetting.toString())
+ }
+ }
+ binding.fab3dObjectsSetting.setOnClickListener {
+ mapboxMap.getStyle { style ->
+ show3dObjectsSetting = !show3dObjectsSetting
+ style.setStyleImportConfigProperty(
+ IMPORT_ID_FOR_STANDARD_STYLE,
+ "show3dObjects",
+ Value.valueOf(show3dObjectsSetting)
+ )
+ showAction(it, show3dObjectsSetting.toString())
}
}
}
+ private fun showAction(it: View, value: String) {
+ Toast.makeText(
+ this@StandardStyleActivity,
+ it.contentDescription.toString() + value,
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+
private enum class LightPresets(val value: Value) {
DAY(Value.valueOf("day")),
DAWN(Value.valueOf("dawn")),
@@ -97,6 +154,12 @@ class StandardStyleActivity : AppCompatActivity() {
NIGHT(Value.valueOf("night"))
}
+ private enum class Theme(val value: Value) {
+ FADED(Value.valueOf("faded")),
+ MONOCHROME(Value.valueOf("monochrome")),
+ DEFAULT(Value.valueOf("default"))
+ }
+
companion object {
/**
* The ID used in [STYLE_URL] that references the `standard` style.
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/StyleSwitchActivity.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/StyleSwitchActivity.kt
index ccd6e82130..a018691864 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/StyleSwitchActivity.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/StyleSwitchActivity.kt
@@ -42,5 +42,11 @@ class StyleSwitchActivity : AppCompatActivity() {
binding.outdoorsButton.setOnClickListener {
mapboxMap.loadStyle(Style.OUTDOORS)
}
+ binding.standardButton.setOnClickListener {
+ mapboxMap.loadStyle(Style.STANDARD)
+ }
+ binding.standardSatelliteButton.setOnClickListener {
+ mapboxMap.loadStyle(Style.STANDARD_SATELLITE)
+ }
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/ViewPagerActivity.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/ViewPagerActivity.kt
index 409620b638..28b7b9f6d0 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/ViewPagerActivity.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/ViewPagerActivity.kt
@@ -57,7 +57,7 @@ class ViewPagerActivity : AppCompatActivity() {
}
companion object {
- private const val NUM_ITEMS = 5
+ private const val NUM_ITEMS = 6
}
}
}
@@ -75,6 +75,7 @@ fun getStyleFromIndex(index: Int): String {
2 -> Style.SATELLITE
3 -> Style.LIGHT
4 -> Style.TRAFFIC_NIGHT
+ 5 -> Style.STANDARD_SATELLITE
else -> Style.STANDARD
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/annotation/AnnotationUtils.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/annotation/AnnotationUtils.kt
index 1fba72ae39..ca2f9f2105 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/annotation/AnnotationUtils.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/annotation/AnnotationUtils.kt
@@ -19,8 +19,9 @@ import java.util.*
*/
object AnnotationUtils {
private const val TAG = "AnnotationUtils"
+
val STYLES =
- arrayOf(Style.STANDARD, Style.OUTDOORS, Style.LIGHT, Style.DARK, Style.SATELLITE_STREETS)
+ arrayOf(Style.STANDARD, Style.OUTDOORS, Style.LIGHT, Style.DARK, Style.SATELLITE_STREETS, Style.STANDARD_SATELLITE)
val SLOTS = arrayOf("top", "middle", "bottom")
/**
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/CircleAnnotationActivity.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/CircleAnnotationActivity.kt
index f6a414c0c1..b851787b43 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/CircleAnnotationActivity.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/CircleAnnotationActivity.kt
@@ -144,8 +144,8 @@ class CircleAnnotationActivity : AppCompatActivity() {
private fun switchToNextStyle() {
val style = nextStyle
binding.mapView.mapboxMap.loadStyle(style)
- // only standard supports slots
- binding.changeSlot.isEnabled = style == Style.STANDARD
+ // only standard based styles support slots
+ binding.changeSlot.isEnabled = (style == Style.STANDARD || style == Style.STANDARD_SATELLITE)
}
companion object {
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/PointAnnotationClusterActivity.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/PointAnnotationClusterActivity.kt
index 071060b979..317f0c685c 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/PointAnnotationClusterActivity.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/PointAnnotationClusterActivity.kt
@@ -41,7 +41,7 @@ class PointAnnotationClusterActivity : AppCompatActivity(), CoroutineScope {
private var slotIndex: Int = 0
// STANDARD style doesn't support ICON_FIRE_STATION image
- private val styles = AnnotationUtils.STYLES.filterNot { it == Style.STANDARD }
+ private val styles = AnnotationUtils.STYLES.filterNot { it == Style.STANDARD || it == Style.STANDARD_SATELLITE }
private val nextStyle: String
get() = styles[styleIndex++ % styles.size]
private val nextSlot: String
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationBasicAddActivity.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationBasicAddActivity.kt
index 16b2ed4ad2..b01d08b3ad 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationBasicAddActivity.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationBasicAddActivity.kt
@@ -43,7 +43,8 @@ class ViewAnnotationBasicAddActivity : AppCompatActivity(), OnMapClickListener {
binding.fabStyleToggle.setOnClickListener {
when (style?.styleURI) {
Style.STANDARD -> loadStyle(Style.SATELLITE_STREETS)
- Style.SATELLITE_STREETS -> loadStyle(Style.STANDARD)
+ Style.SATELLITE_STREETS -> loadStyle(Style.STANDARD_SATELLITE)
+ Style.STANDARD_SATELLITE -> loadStyle(Style.STANDARD)
}
}
Toast.makeText(this@ViewAnnotationBasicAddActivity, STARTUP_TEXT, Toast.LENGTH_LONG).show()
diff --git a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationShowcaseActivity.kt b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationShowcaseActivity.kt
index 0b8e13fcf0..b40e3406aa 100644
--- a/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationShowcaseActivity.kt
+++ b/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/viewannotation/ViewAnnotationShowcaseActivity.kt
@@ -81,7 +81,8 @@ class ViewAnnotationShowcaseActivity :
binding.fabStyleToggle.setOnClickListener {
when (style?.styleURI) {
Style.STANDARD -> loadStyle(prepareStyle(Style.SATELLITE_STREETS, bitmap))
- Style.SATELLITE_STREETS -> loadStyle(prepareStyle(Style.STANDARD, bitmap))
+ Style.SATELLITE_STREETS -> loadStyle(prepareStyle(Style.STANDARD_SATELLITE, bitmap))
+ Style.STANDARD_SATELLITE -> loadStyle(prepareStyle(Style.STANDARD, bitmap))
}
}
Toast.makeText(this@ViewAnnotationShowcaseActivity, STARTUP_TEXT, Toast.LENGTH_LONG).show()
diff --git a/app/src/main/res/layout/activity_standard_style.xml b/app/src/main/res/layout/activity_standard_style.xml
index 657e1149fe..abb577aa5b 100644
--- a/app/src/main/res/layout/activity_standard_style.xml
+++ b/app/src/main/res/layout/activity_standard_style.xml
@@ -9,6 +9,30 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
+
+
+
+
@@ -26,6 +51,7 @@
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
+ android:contentDescription="Label visibility: "
android:src="@android:drawable/ic_dialog_info"
app:backgroundTint="@color/primary" />
diff --git a/app/src/main/res/layout/activity_style_switch.xml b/app/src/main/res/layout/activity_style_switch.xml
index 558450f313..1300f752af 100644
--- a/app/src/main/res/layout/activity_style_switch.xml
+++ b/app/src/main/res/layout/activity_style_switch.xml
@@ -24,34 +24,36 @@
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/guideline"
app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.0"
app:mapbox_attributionEnabled="true"
app:mapbox_attributionGravity="top|right"
app:mapbox_attributionMarginBottom="32dp"
app:mapbox_attributionMarginLeft="32dp"
app:mapbox_attributionMarginRight="32dp"
app:mapbox_attributionMarginTop="32dp"
- app:mapbox_compassImage="@drawable/custom_compass"
app:mapbox_compassEnabled="true"
app:mapbox_compassFadeWhenFacingNorth="false"
app:mapbox_compassGravity="left|top"
+ app:mapbox_compassImage="@drawable/custom_compass"
app:mapbox_compassMarginBottom="32dp"
app:mapbox_compassMarginLeft="32dp"
app:mapbox_compassMarginRight="32dp"
app:mapbox_compassMarginTop="32dp"
app:mapbox_gesturesDoubleTapToZoomInEnabled="false"
+ app:mapbox_gesturesPinchToZoomEnabled="false"
+ app:mapbox_gesturesPitchEnabled="false"
+ app:mapbox_gesturesQuickZoomEnabled="false"
+ app:mapbox_gesturesRotateEnabled="true"
+ app:mapbox_gesturesScrollEnabled="false"
app:mapbox_logoEnabled="true"
app:mapbox_logoGravity="bottom|right"
app:mapbox_logoMarginBottom="32dp"
app:mapbox_logoMarginLeft="32dp"
app:mapbox_logoMarginRight="32dp"
- app:mapbox_logoMarginTop="32dp"
- app:mapbox_gesturesQuickZoomEnabled="false"
- app:mapbox_gesturesRotateEnabled="true"
- app:mapbox_gesturesScrollEnabled="false"
- app:mapbox_gesturesPitchEnabled="false"
- app:mapbox_gesturesPinchToZoomEnabled="false" />
+ app:mapbox_logoMarginTop="32dp" />
+
+
+
+
+ app:layout_constraintGuide_percent="0.67" />
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d00da93e33..39de256617 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -6,7 +6,9 @@
DarkLightOutdoors
+ StandardSatellite
+ Standard SatelliteSatellite StreetsToggle focus on a pointToggle deceleration animations
diff --git a/compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/style/StandardStyleActivity.kt b/compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/style/StandardStyleActivity.kt
index af66526147..737cb851b0 100644
--- a/compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/style/StandardStyleActivity.kt
+++ b/compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/style/StandardStyleActivity.kt
@@ -4,16 +4,24 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.IntrinsicSize
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material.ButtonDefaults
import androidx.compose.material.FloatingActionButton
+import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.mapbox.maps.compose.testapp.ExampleScaffold
import com.mapbox.maps.compose.testapp.examples.utils.CityLocations
@@ -23,7 +31,9 @@ import com.mapbox.maps.extension.compose.animation.viewport.rememberMapViewportS
import com.mapbox.maps.extension.compose.style.BooleanValue
import com.mapbox.maps.extension.compose.style.StringValue
import com.mapbox.maps.extension.compose.style.standard.LightPresetValue
+import com.mapbox.maps.extension.compose.style.standard.MapboxStandardSatelliteStyle
import com.mapbox.maps.extension.compose.style.standard.MapboxStandardStyle
+import com.mapbox.maps.extension.compose.style.standard.ThemeValue
import com.mapbox.maps.extension.style.utils.transition
/**
@@ -33,6 +43,9 @@ public class StandardStyleActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
+ var isStandardSatellite by remember {
+ mutableStateOf(false)
+ }
var enablePlaceLabels by remember {
mutableStateOf(true)
}
@@ -51,91 +64,258 @@ public class StandardStyleActivity : ComponentActivity() {
var selectedFont by remember {
mutableStateOf("DIN Pro")
}
+ var selectedTheme by remember {
+ mutableStateOf(ThemeValue.DEFAULT)
+ }
+ var enable3dObjects by remember {
+ mutableStateOf(true)
+ }
+ var enableRoadsAndTransit by remember {
+ mutableStateOf(true)
+ }
+ var enablePedestrianRoads by remember {
+ mutableStateOf(true)
+ }
MapboxMapComposeTheme {
ExampleScaffold(
floatingActionButton = {
- Column {
- FloatingActionButton(
- modifier = Modifier.padding(bottom = 10.dp),
- onClick = {
- enablePlaceLabels = !enablePlaceLabels
- },
- shape = RoundedCornerShape(16.dp),
+ Column(
+ modifier = Modifier.width(IntrinsicSize.Max)
+ ) {
+ Row(
+ modifier = Modifier.fillMaxWidth()
) {
- Text(
- modifier = Modifier.padding(10.dp),
- text = "showPlaceLabels: $enablePlaceLabels"
- )
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ )
+ .padding(end = 4.dp),
+ onClick = {
+ enablePlaceLabels = !enablePlaceLabels
+ },
+ shape = RoundedCornerShape(16.dp),
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "showPlaceLabels: $enablePlaceLabels"
+ )
+ }
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ ),
+ onClick = {
+ enableRoadLabels = !enableRoadLabels
+ },
+ shape = RoundedCornerShape(16.dp),
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "showRoadLabels: $enableRoadLabels"
+ )
+ }
}
- FloatingActionButton(
- modifier = Modifier.padding(bottom = 10.dp),
- onClick = {
- enableRoadLabels = !enableRoadLabels
- },
- shape = RoundedCornerShape(16.dp),
+ Row(
+ modifier = Modifier.fillMaxWidth()
) {
- Text(
- modifier = Modifier.padding(10.dp),
- text = "showRoadLabels: $enableRoadLabels"
- )
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ )
+ .padding(end = 4.dp),
+ onClick = {
+ enableTransitLabels = !enableTransitLabels
+ },
+ shape = RoundedCornerShape(16.dp),
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "showTransitLabels: $enableTransitLabels"
+ )
+ }
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ ),
+ onClick = {
+ selectedFont = when (selectedFont) {
+ "DIN Pro" -> "Roboto"
+ else -> "DIN Pro"
+ }
+ },
+ shape = RoundedCornerShape(16.dp),
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "font: $selectedFont"
+ )
+ }
}
FloatingActionButton(
- modifier = Modifier.padding(bottom = 10.dp),
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ ),
onClick = {
enablePointOfInterestLabels = !enablePointOfInterestLabels
},
shape = RoundedCornerShape(16.dp),
) {
Text(
- modifier = Modifier.padding(10.dp),
+ modifier = Modifier.padding(6.dp),
text = "showPointOfInterestLabels: $enablePointOfInterestLabels"
)
}
- FloatingActionButton(
- modifier = Modifier.padding(bottom = 10.dp),
- onClick = {
- enableTransitLabels = !enableTransitLabels
- },
- shape = RoundedCornerShape(16.dp),
+ Row(
+ modifier = Modifier.fillMaxWidth()
) {
- Text(
- modifier = Modifier.padding(10.dp),
- text = "showTransitLabels: $enableTransitLabels"
- )
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ )
+ .padding(end = 4.dp),
+ onClick = {
+ selectedLightPreset = when (selectedLightPreset) {
+ LightPresetValue.DAY -> LightPresetValue.DUSK
+ LightPresetValue.DUSK -> LightPresetValue.NIGHT
+ LightPresetValue.NIGHT -> LightPresetValue.DAWN
+ LightPresetValue.DAWN -> LightPresetValue.DAY
+ else -> LightPresetValue.NIGHT
+ }
+ },
+ shape = RoundedCornerShape(16.dp),
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "lightPreset: ${selectedLightPreset.presetNameOrNull}"
+ )
+ }
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ )
+ .padding(end = 4.dp),
+ onClick = {
+ if (!isStandardSatellite) {
+ selectedTheme = when (selectedTheme) {
+ ThemeValue.DEFAULT -> ThemeValue.FADED
+ ThemeValue.FADED -> ThemeValue.MONOCHROME
+ ThemeValue.MONOCHROME -> ThemeValue.DEFAULT
+ else -> ThemeValue.DEFAULT
+ }
+ }
+ },
+ shape = RoundedCornerShape(16.dp),
+ backgroundColor = if (isStandardSatellite) Color.Gray else MaterialTheme.colors.secondary,
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "selectedTheme: ${selectedTheme.presetNameOrNull}"
+ )
+ }
}
- FloatingActionButton(
- modifier = Modifier.padding(bottom = 10.dp),
- onClick = {
- selectedLightPreset = when (selectedLightPreset) {
- LightPresetValue.DAY -> LightPresetValue.DUSK
- LightPresetValue.DUSK -> LightPresetValue.NIGHT
- LightPresetValue.NIGHT -> LightPresetValue.DAWN
- LightPresetValue.DAWN -> LightPresetValue.DAY
- else -> LightPresetValue.NIGHT
- }
- },
- shape = RoundedCornerShape(16.dp),
+ Row(
+ modifier = Modifier.fillMaxWidth()
) {
- Text(
- modifier = Modifier.padding(10.dp),
- text = "lightPreset: $selectedLightPreset"
- )
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ )
+ .padding(end = 4.dp),
+ onClick = {
+ if (!isStandardSatellite) {
+ enable3dObjects = !enable3dObjects
+ }
+ },
+ shape = RoundedCornerShape(16.dp),
+ backgroundColor = if (isStandardSatellite) Color.Gray else MaterialTheme.colors.secondary,
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "show3dObjects:$enable3dObjects"
+ )
+ }
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ ),
+ onClick = {
+ isStandardSatellite = !isStandardSatellite
+ },
+ shape = RoundedCornerShape(16.dp),
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "selectedStyle:${
+ if (isStandardSatellite) {
+ "STND_SATELLITE"
+ } else {
+ "STANDARD"
+ }
+ }"
+ )
+ }
}
- FloatingActionButton(
- modifier = Modifier.padding(bottom = 10.dp),
- onClick = {
- selectedFont = when (selectedFont) {
- "DIN Pro" -> "Roboto"
- else -> "DIN Pro"
- }
- },
- shape = RoundedCornerShape(16.dp),
+ Row(
+ modifier = Modifier.fillMaxWidth()
) {
- Text(
- modifier = Modifier.padding(10.dp),
- text = "font: $selectedFont"
- )
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ )
+ .padding(end = 4.dp),
+ onClick = {
+ if (isStandardSatellite) {
+ enableRoadsAndTransit = !enableRoadsAndTransit
+ }
+ },
+ shape = RoundedCornerShape(16.dp),
+ backgroundColor = if (!isStandardSatellite) Color.Gray else MaterialTheme.colors.secondary,
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "roadsAndTransit: $enableRoadsAndTransit"
+ )
+ }
+ FloatingActionButton(
+ modifier = Modifier
+ .defaultMinSize(
+ minWidth = ButtonDefaults.MinWidth,
+ minHeight = ButtonDefaults.MinHeight
+ ),
+ onClick = {
+ if (isStandardSatellite) {
+ enablePedestrianRoads = !enablePedestrianRoads
+ }
+ },
+ shape = RoundedCornerShape(16.dp),
+ backgroundColor = if (!isStandardSatellite) Color.Gray else MaterialTheme.colors.secondary,
+ ) {
+ Text(
+ modifier = Modifier.padding(6.dp),
+ text = "pedestrianRoads: $enablePedestrianRoads"
+ )
+ }
}
}
}
@@ -146,23 +326,47 @@ public class StandardStyleActivity : ComponentActivity() {
setCameraOptions {
zoom(ZOOM)
center(CityLocations.HELSINKI)
+ pitch(40.0)
}
},
- style = {
- MapboxStandardStyle(
- styleTransition = remember {
- transition {
- duration(1_000)
- enablePlacementTransitions(true)
+ style =
+ {
+ if (isStandardSatellite) {
+ MapboxStandardSatelliteStyle(
+ styleTransition = remember {
+ transition {
+ duration(1_000)
+ enablePlacementTransitions(true)
+ }
}
+ ) {
+ showPlaceLabels = BooleanValue(enablePlaceLabels)
+ showRoadLabels = BooleanValue(enableRoadLabels)
+ showPointOfInterestLabels = BooleanValue(enablePointOfInterestLabels)
+ showTransitLabels = BooleanValue(enableTransitLabels)
+ lightPreset = selectedLightPreset
+ font = StringValue(selectedFont)
+ showRoadsAndTransit = BooleanValue(enableRoadsAndTransit)
+ showPedestrianRoads = BooleanValue(enablePedestrianRoads)
+ }
+ } else {
+ MapboxStandardStyle(
+ styleTransition = remember {
+ transition {
+ duration(1_000)
+ enablePlacementTransitions(true)
+ }
+ }
+ ) {
+ showPlaceLabels = BooleanValue(enablePlaceLabels)
+ showRoadLabels = BooleanValue(enableRoadLabels)
+ showPointOfInterestLabels = BooleanValue(enablePointOfInterestLabels)
+ showTransitLabels = BooleanValue(enableTransitLabels)
+ lightPreset = selectedLightPreset
+ font = StringValue(selectedFont)
+ theme = selectedTheme
+ show3dObjects = BooleanValue(enable3dObjects)
}
- ) {
- showPlaceLabels = BooleanValue(enablePlaceLabels)
- showRoadLabels = BooleanValue(enableRoadLabels)
- showPointOfInterestLabels = BooleanValue(enablePointOfInterestLabels)
- showTransitLabels = BooleanValue(enableTransitLabels)
- lightPreset = selectedLightPreset
- font = StringValue(selectedFont)
}
}
)
diff --git a/extension-compose/api/Release/metalava.txt b/extension-compose/api/Release/metalava.txt
index ea7a0d5c2f..a806c77a6c 100644
--- a/extension-compose/api/Release/metalava.txt
+++ b/extension-compose/api/Release/metalava.txt
@@ -3643,6 +3643,28 @@ package com.mapbox.maps.extension.compose.style.sources.generated {
package com.mapbox.maps.extension.compose.style.standard {
+ @androidx.compose.runtime.Stable public abstract class BaseStyleConfigurationState {
+ ctor protected BaseStyleConfigurationState(com.mapbox.maps.extension.compose.style.BooleanValue initialShowPlaceLabels = com.mapbox.maps.extension.compose.style.BooleanValue.INITIAL, com.mapbox.maps.extension.compose.style.BooleanValue initialShowRoadLabels = com.mapbox.maps.extension.compose.style.BooleanValue.INITIAL, com.mapbox.maps.extension.compose.style.BooleanValue initialShowPointOfInterestLabels = com.mapbox.maps.extension.compose.style.BooleanValue.INITIAL, com.mapbox.maps.extension.compose.style.BooleanValue initialShowTransitLabels = com.mapbox.maps.extension.compose.style.BooleanValue.INITIAL, com.mapbox.maps.extension.compose.style.standard.LightPresetValue initialLightPreset = com.mapbox.maps.extension.compose.style.standard.LightPresetValue.INITIAL, com.mapbox.maps.extension.compose.style.StringValue initialFont = com.mapbox.maps.extension.compose.style.StringValue.INITIAL);
+ method public final com.mapbox.maps.extension.compose.style.StringValue getFont();
+ method public final com.mapbox.maps.extension.compose.style.standard.LightPresetValue getLightPreset();
+ method public final com.mapbox.maps.extension.compose.style.BooleanValue getShowPlaceLabels();
+ method public final com.mapbox.maps.extension.compose.style.BooleanValue getShowPointOfInterestLabels();
+ method public final com.mapbox.maps.extension.compose.style.BooleanValue getShowRoadLabels();
+ method public final com.mapbox.maps.extension.compose.style.BooleanValue getShowTransitLabels();
+ method public final void setFont(com.mapbox.maps.extension.compose.style.StringValue);
+ method public final void setLightPreset(com.mapbox.maps.extension.compose.style.standard.LightPresetValue);
+ method public final void setShowPlaceLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
+ method public final void setShowPointOfInterestLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
+ method public final void setShowRoadLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
+ method public final void setShowTransitLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
+ property public final com.mapbox.maps.extension.compose.style.StringValue font;
+ property public final com.mapbox.maps.extension.compose.style.standard.LightPresetValue lightPreset;
+ property public final com.mapbox.maps.extension.compose.style.BooleanValue showPlaceLabels;
+ property public final com.mapbox.maps.extension.compose.style.BooleanValue showPointOfInterestLabels;
+ property public final com.mapbox.maps.extension.compose.style.BooleanValue showRoadLabels;
+ property public final com.mapbox.maps.extension.compose.style.BooleanValue showTransitLabels;
+ }
+
@androidx.compose.runtime.Immutable public final class LightPresetValue {
ctor public LightPresetValue(com.mapbox.bindgen.Value value);
ctor public LightPresetValue(String value);
@@ -3664,6 +3686,25 @@ package com.mapbox.maps.extension.compose.style.standard {
public static final class LightPresetValue.Companion {
}
+ public final class MapboxStandardSatelliteStyleKt {
+ method @androidx.compose.runtime.Composable @com.mapbox.maps.extension.compose.style.MapboxStyleComposable public static void MapboxStandardSatelliteStyle(kotlin.jvm.functions.Function1 super com.mapbox.maps.extension.compose.style.imports.StyleImportsScope,kotlin.Unit>? styleImportsContent = null, kotlin.jvm.functions.Function0? topSlot = null, kotlin.jvm.functions.Function0? middleSlot = null, kotlin.jvm.functions.Function0? bottomSlot = null, com.mapbox.maps.extension.compose.style.projection.generated.Projection projection = com.mapbox.maps.extension.compose.style.projection.generated.Projection.INITIAL, com.mapbox.maps.extension.compose.style.atmosphere.generated.AtmosphereState atmosphereState = remember({
+ return ()
+}), com.mapbox.maps.extension.compose.style.terrain.generated.TerrainState terrainState = com.mapbox.maps.extension.compose.style.terrain.generated.TerrainState.INITIAL, com.mapbox.maps.extension.compose.style.lights.LightsState lightsState = com.mapbox.maps.extension.compose.style.lights.LightsState.INITIAL, com.mapbox.maps.TransitionOptions styleTransition = remember({
+ return transition({
+
+ })
+}), com.mapbox.maps.extension.compose.style.standard.StandardSatelliteStyleConfigurationState standardSatelliteStyleConfigurationState = remember({
+ return ()
+}));
+ method @androidx.compose.runtime.Composable @com.mapbox.maps.extension.compose.style.MapboxStyleComposable public static void MapboxStandardSatelliteStyle(kotlin.jvm.functions.Function1 super com.mapbox.maps.extension.compose.style.imports.StyleImportsScope,kotlin.Unit>? styleImportsContent = null, kotlin.jvm.functions.Function0? topSlot = null, kotlin.jvm.functions.Function0? middleSlot = null, kotlin.jvm.functions.Function0? bottomSlot = null, com.mapbox.maps.extension.compose.style.projection.generated.Projection projection = com.mapbox.maps.extension.compose.style.projection.generated.Projection.INITIAL, com.mapbox.maps.extension.compose.style.atmosphere.generated.AtmosphereState atmosphereState = remember({
+ return ()
+}), com.mapbox.maps.extension.compose.style.terrain.generated.TerrainState terrainState = com.mapbox.maps.extension.compose.style.terrain.generated.TerrainState.INITIAL, com.mapbox.maps.extension.compose.style.lights.LightsState lightsState = com.mapbox.maps.extension.compose.style.lights.LightsState.INITIAL, com.mapbox.maps.TransitionOptions styleTransition = remember({
+ return transition({
+
+ })
+}), kotlin.jvm.functions.Function1 super com.mapbox.maps.extension.compose.style.standard.StandardSatelliteStyleConfigurationState,kotlin.Unit> init);
+ }
+
public final class MapboxStandardStyleKt {
method @androidx.compose.runtime.Composable @com.mapbox.maps.extension.compose.style.MapboxStyleComposable public static void MapboxStandardStyle(kotlin.jvm.functions.Function1 super com.mapbox.maps.extension.compose.style.imports.StyleImportsScope,kotlin.Unit>? styleImportsContent = null, kotlin.jvm.functions.Function0? topSlot = null, kotlin.jvm.functions.Function0? middleSlot = null, kotlin.jvm.functions.Function0? bottomSlot = null, com.mapbox.maps.extension.compose.style.projection.generated.Projection projection = com.mapbox.maps.extension.compose.style.projection.generated.Projection.INITIAL, com.mapbox.maps.extension.compose.style.atmosphere.generated.AtmosphereState atmosphereState = remember({
return ()
@@ -3683,26 +3724,43 @@ package com.mapbox.maps.extension.compose.style.standard {
}), kotlin.jvm.functions.Function1 super com.mapbox.maps.extension.compose.style.standard.StandardStyleConfigurationState,kotlin.Unit> init);
}
- @androidx.compose.runtime.Stable public final class StandardStyleConfigurationState {
+ @androidx.compose.runtime.Stable public final class StandardSatelliteStyleConfigurationState extends com.mapbox.maps.extension.compose.style.standard.BaseStyleConfigurationState {
+ ctor public StandardSatelliteStyleConfigurationState();
+ method public com.mapbox.maps.extension.compose.style.BooleanValue getShowPedestrianRoads();
+ method public com.mapbox.maps.extension.compose.style.BooleanValue getShowRoadsAndTransit();
+ method public void setShowPedestrianRoads(com.mapbox.maps.extension.compose.style.BooleanValue);
+ method public void setShowRoadsAndTransit(com.mapbox.maps.extension.compose.style.BooleanValue);
+ property public final com.mapbox.maps.extension.compose.style.BooleanValue showPedestrianRoads;
+ property public final com.mapbox.maps.extension.compose.style.BooleanValue showRoadsAndTransit;
+ }
+
+ @androidx.compose.runtime.Stable public final class StandardStyleConfigurationState extends com.mapbox.maps.extension.compose.style.standard.BaseStyleConfigurationState {
ctor public StandardStyleConfigurationState();
- method public com.mapbox.maps.extension.compose.style.StringValue getFont();
- method public com.mapbox.maps.extension.compose.style.standard.LightPresetValue getLightPreset();
- method public com.mapbox.maps.extension.compose.style.BooleanValue getShowPlaceLabels();
- method public com.mapbox.maps.extension.compose.style.BooleanValue getShowPointOfInterestLabels();
- method public com.mapbox.maps.extension.compose.style.BooleanValue getShowRoadLabels();
- method public com.mapbox.maps.extension.compose.style.BooleanValue getShowTransitLabels();
- method public void setFont(com.mapbox.maps.extension.compose.style.StringValue);
- method public void setLightPreset(com.mapbox.maps.extension.compose.style.standard.LightPresetValue);
- method public void setShowPlaceLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
- method public void setShowPointOfInterestLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
- method public void setShowRoadLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
- method public void setShowTransitLabels(com.mapbox.maps.extension.compose.style.BooleanValue);
- property public final com.mapbox.maps.extension.compose.style.StringValue font;
- property public final com.mapbox.maps.extension.compose.style.standard.LightPresetValue lightPreset;
- property public final com.mapbox.maps.extension.compose.style.BooleanValue showPlaceLabels;
- property public final com.mapbox.maps.extension.compose.style.BooleanValue showPointOfInterestLabels;
- property public final com.mapbox.maps.extension.compose.style.BooleanValue showRoadLabels;
- property public final com.mapbox.maps.extension.compose.style.BooleanValue showTransitLabels;
+ method public com.mapbox.maps.extension.compose.style.BooleanValue getShow3dObjects();
+ method public com.mapbox.maps.extension.compose.style.standard.ThemeValue getTheme();
+ method public void setShow3dObjects(com.mapbox.maps.extension.compose.style.BooleanValue);
+ method public void setTheme(com.mapbox.maps.extension.compose.style.standard.ThemeValue);
+ property public final com.mapbox.maps.extension.compose.style.BooleanValue show3dObjects;
+ property public final com.mapbox.maps.extension.compose.style.standard.ThemeValue theme;
+ }
+
+ @androidx.compose.runtime.Immutable public final class ThemeValue {
+ ctor public ThemeValue(com.mapbox.bindgen.Value value);
+ ctor public ThemeValue(String value);
+ ctor public ThemeValue(com.mapbox.maps.extension.style.expressions.generated.Expression expression);
+ method public com.mapbox.bindgen.Value component1();
+ method public com.mapbox.maps.extension.compose.style.standard.ThemeValue copy(com.mapbox.bindgen.Value value);
+ method public String? getPresetNameOrNull();
+ method public com.mapbox.bindgen.Value getValue();
+ property public final String? presetNameOrNull;
+ property public final com.mapbox.bindgen.Value value;
+ field public static final com.mapbox.maps.extension.compose.style.standard.ThemeValue.Companion Companion;
+ field public static final com.mapbox.maps.extension.compose.style.standard.ThemeValue DEFAULT;
+ field public static final com.mapbox.maps.extension.compose.style.standard.ThemeValue FADED;
+ field public static final com.mapbox.maps.extension.compose.style.standard.ThemeValue MONOCHROME;
+ }
+
+ public static final class ThemeValue.Companion {
}
}
diff --git a/extension-compose/api/extension-compose.api b/extension-compose/api/extension-compose.api
index fdc0608cb6..dde46a6a79 100644
--- a/extension-compose/api/extension-compose.api
+++ b/extension-compose/api/extension-compose.api
@@ -3145,6 +3145,24 @@ public final class com/mapbox/maps/extension/compose/style/sources/generated/Vec
public static final fun rememberVectorSourceState (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)Lcom/mapbox/maps/extension/compose/style/sources/generated/VectorSourceState;
}
+public abstract class com/mapbox/maps/extension/compose/style/standard/BaseStyleConfigurationState {
+ protected fun ()V
+ protected fun (Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue;Lcom/mapbox/maps/extension/compose/style/StringValue;)V
+ public synthetic fun (Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/BooleanValue;Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue;Lcom/mapbox/maps/extension/compose/style/StringValue;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
+ public final fun getFont ()Lcom/mapbox/maps/extension/compose/style/StringValue;
+ public final fun getLightPreset ()Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue;
+ public final fun getShowPlaceLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
+ public final fun getShowPointOfInterestLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
+ public final fun getShowRoadLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
+ public final fun getShowTransitLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
+ public final fun setFont (Lcom/mapbox/maps/extension/compose/style/StringValue;)V
+ public final fun setLightPreset (Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue;)V
+ public final fun setShowPlaceLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+ public final fun setShowPointOfInterestLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+ public final fun setShowRoadLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+ public final fun setShowTransitLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+}
+
public final class com/mapbox/maps/extension/compose/style/standard/LightPresetValue {
public static final field Companion Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue$Companion;
public static final field DAWN Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue;
@@ -3168,25 +3186,51 @@ public final class com/mapbox/maps/extension/compose/style/standard/LightPresetV
public final class com/mapbox/maps/extension/compose/style/standard/LightPresetValue$Companion {
}
+public final class com/mapbox/maps/extension/compose/style/standard/MapboxStandardSatelliteStyleKt {
+ public static final fun MapboxStandardSatelliteStyle (Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lcom/mapbox/maps/extension/compose/style/projection/generated/Projection;Lcom/mapbox/maps/extension/compose/style/atmosphere/generated/AtmosphereState;Lcom/mapbox/maps/extension/compose/style/terrain/generated/TerrainState;Lcom/mapbox/maps/extension/compose/style/lights/LightsState;Lcom/mapbox/maps/TransitionOptions;Lcom/mapbox/maps/extension/compose/style/standard/StandardSatelliteStyleConfigurationState;Landroidx/compose/runtime/Composer;II)V
+ public static final fun MapboxStandardSatelliteStyle (Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lcom/mapbox/maps/extension/compose/style/projection/generated/Projection;Lcom/mapbox/maps/extension/compose/style/atmosphere/generated/AtmosphereState;Lcom/mapbox/maps/extension/compose/style/terrain/generated/TerrainState;Lcom/mapbox/maps/extension/compose/style/lights/LightsState;Lcom/mapbox/maps/TransitionOptions;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
+}
+
public final class com/mapbox/maps/extension/compose/style/standard/MapboxStandardStyleKt {
public static final fun MapboxStandardStyle (Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lcom/mapbox/maps/extension/compose/style/projection/generated/Projection;Lcom/mapbox/maps/extension/compose/style/atmosphere/generated/AtmosphereState;Lcom/mapbox/maps/extension/compose/style/terrain/generated/TerrainState;Lcom/mapbox/maps/extension/compose/style/lights/LightsState;Lcom/mapbox/maps/TransitionOptions;Lcom/mapbox/maps/extension/compose/style/standard/StandardStyleConfigurationState;Landroidx/compose/runtime/Composer;II)V
public static final fun MapboxStandardStyle (Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lcom/mapbox/maps/extension/compose/style/projection/generated/Projection;Lcom/mapbox/maps/extension/compose/style/atmosphere/generated/AtmosphereState;Lcom/mapbox/maps/extension/compose/style/terrain/generated/TerrainState;Lcom/mapbox/maps/extension/compose/style/lights/LightsState;Lcom/mapbox/maps/TransitionOptions;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
}
-public final class com/mapbox/maps/extension/compose/style/standard/StandardStyleConfigurationState {
+public final class com/mapbox/maps/extension/compose/style/standard/StandardSatelliteStyleConfigurationState : com/mapbox/maps/extension/compose/style/standard/BaseStyleConfigurationState {
public fun ()V
- public final fun getFont ()Lcom/mapbox/maps/extension/compose/style/StringValue;
- public final fun getLightPreset ()Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue;
- public final fun getShowPlaceLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
- public final fun getShowPointOfInterestLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
- public final fun getShowRoadLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
- public final fun getShowTransitLabels ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
- public final fun setFont (Lcom/mapbox/maps/extension/compose/style/StringValue;)V
- public final fun setLightPreset (Lcom/mapbox/maps/extension/compose/style/standard/LightPresetValue;)V
- public final fun setShowPlaceLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
- public final fun setShowPointOfInterestLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
- public final fun setShowRoadLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
- public final fun setShowTransitLabels (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+ public final fun getShowPedestrianRoads ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
+ public final fun getShowRoadsAndTransit ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
+ public final fun setShowPedestrianRoads (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+ public final fun setShowRoadsAndTransit (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+}
+
+public final class com/mapbox/maps/extension/compose/style/standard/StandardStyleConfigurationState : com/mapbox/maps/extension/compose/style/standard/BaseStyleConfigurationState {
+ public fun ()V
+ public final fun getShow3dObjects ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
+ public final fun getTheme ()Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;
+ public final fun setShow3dObjects (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
+ public final fun setTheme (Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;)V
+}
+
+public final class com/mapbox/maps/extension/compose/style/standard/ThemeValue {
+ public static final field Companion Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue$Companion;
+ public static final field DEFAULT Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;
+ public static final field FADED Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;
+ public static final field MONOCHROME Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;
+ public fun (Lcom/mapbox/bindgen/Value;)V
+ public fun (Lcom/mapbox/maps/extension/style/expressions/generated/Expression;)V
+ public fun (Ljava/lang/String;)V
+ public final fun component1 ()Lcom/mapbox/bindgen/Value;
+ public final fun copy (Lcom/mapbox/bindgen/Value;)Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;
+ public static synthetic fun copy$default (Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;Lcom/mapbox/bindgen/Value;ILjava/lang/Object;)Lcom/mapbox/maps/extension/compose/style/standard/ThemeValue;
+ public fun equals (Ljava/lang/Object;)Z
+ public final fun getPresetNameOrNull ()Ljava/lang/String;
+ public final fun getValue ()Lcom/mapbox/bindgen/Value;
+ public fun hashCode ()I
+ public fun toString ()Ljava/lang/String;
+}
+
+public final class com/mapbox/maps/extension/compose/style/standard/ThemeValue$Companion {
}
public final class com/mapbox/maps/extension/compose/style/terrain/generated/TerrainState {
diff --git a/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/BaseStandardStyleConfigurationState.kt b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/BaseStandardStyleConfigurationState.kt
new file mode 100644
index 0000000000..ea731ac610
--- /dev/null
+++ b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/BaseStandardStyleConfigurationState.kt
@@ -0,0 +1,144 @@
+package com.mapbox.maps.extension.compose.style.standard
+
+import androidx.compose.runtime.Immutable
+import androidx.compose.runtime.Stable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import com.mapbox.bindgen.Value
+import com.mapbox.maps.extension.compose.style.BooleanValue
+import com.mapbox.maps.extension.compose.style.StringValue
+import com.mapbox.maps.extension.compose.style.standard.LightPresetValue.Companion.equals
+import com.mapbox.maps.extension.style.expressions.generated.Expression
+
+/**
+ * Define the lightPreset style import config for [MapboxStandardStyle].
+ *
+ * @param value the property wrapped in [Value] to be used with native renderer.
+ */
+@Immutable
+public data class LightPresetValue(public val value: Value) {
+ /**
+ * Construct the [LightPresetValue] with [String].
+ */
+ public constructor(value: String) : this(Value(value))
+
+ /**
+ * Construct the [LightPresetValue] with [Mapbox Expression](https://docs.mapbox.com/style-spec/reference/expressions/).
+ */
+ public constructor(expression: Expression) : this(expression as Value)
+
+ /**
+ * Get the name of the [LightPresetValue] as [String], or null if it's not a constant(e.g. an expression).
+ */
+ public val presetNameOrNull: String?
+ get() = value.contents as? String
+
+ /**
+ * True if the this value is not [INITIAL]
+ */
+ internal val notInitial: Boolean
+ get() = this !== INITIAL
+
+ /**
+ * Public companion object.
+ */
+ public companion object {
+ /**
+ * Use this constant to signal that no property should be set to the Maps engine.
+ * This is needed because sending nullValue resets the value of the property to the default one
+ * defined by the Maps engine, which results in overriding the value from the loaded style.
+ * Moreover, we set a custom String to differentiate it from [DEFAULT], otherwise things
+ * like [kotlinx.coroutines.flow.Flow] or [androidx.compose.runtime.MutableState] won't be able
+ * to differentiate them because they use [equals].
+ */
+ @JvmField
+ internal val INITIAL: LightPresetValue =
+ LightPresetValue(Value.valueOf("LightPresetValue.INITIAL"))
+
+ /**
+ * Default value for [LightPresetValue], setting default will result in restoring the property value defined in the style.
+ */
+ @JvmField
+ public val DEFAULT: LightPresetValue = LightPresetValue(Value.nullValue())
+
+ /**
+ * The light preset for "day".
+ */
+ @JvmField
+ public val DAY: LightPresetValue = LightPresetValue("day")
+
+ /**
+ * The light preset for "night".
+ */
+ @JvmField
+ public val NIGHT: LightPresetValue = LightPresetValue("night")
+
+ /**
+ * The light preset for "dusk".
+ */
+ @JvmField
+ public val DUSK: LightPresetValue = LightPresetValue("dusk")
+
+ /**
+ * The light preset for "dawn".
+ */
+ @JvmField
+ public val DAWN: LightPresetValue = LightPresetValue("dawn")
+ }
+}
+
+/**
+ * The state holder for the base [MapboxStandardStyle]'s & [MapboxStandardSatelliteStyle]'s configurations.
+ */
+@Stable
+public abstract class BaseStyleConfigurationState protected constructor(
+ initialShowPlaceLabels: BooleanValue = BooleanValue.INITIAL,
+ initialShowRoadLabels: BooleanValue = BooleanValue.INITIAL,
+ initialShowPointOfInterestLabels: BooleanValue = BooleanValue.INITIAL,
+ initialShowTransitLabels: BooleanValue = BooleanValue.INITIAL,
+ initialLightPreset: LightPresetValue = LightPresetValue.INITIAL,
+ initialFont: StringValue = StringValue.INITIAL,
+) {
+
+ /**
+ * Whether or not to show the place labels, default to true.
+ */
+ public var showPlaceLabels: BooleanValue by mutableStateOf(initialShowPlaceLabels)
+
+ /**
+ * Whether or not to show the road labels, default to true.
+ */
+ public var showRoadLabels: BooleanValue by mutableStateOf(initialShowRoadLabels)
+
+ /**
+ * Whether or not to show the point of interest labels, default to true.
+ */
+ public var showPointOfInterestLabels: BooleanValue by mutableStateOf(
+ initialShowPointOfInterestLabels
+ )
+
+ /**
+ * Whether or not to show the transit labels, default to true.
+ */
+ public var showTransitLabels: BooleanValue by mutableStateOf(initialShowTransitLabels)
+
+ /**
+ * The [LightPresetValue] settings of the Mapbox Standard Style, available lightPresets including "day", "night", "dawn", "dusk", defaults to "day".
+ */
+ public var lightPreset: LightPresetValue by mutableStateOf(initialLightPreset)
+
+ /**
+ * The font to be used with the standard style.
+ */
+ public var font: StringValue by mutableStateOf(initialFont)
+
+ internal companion object {
+ internal const val CONFIG_SHOW_PLACE_LABELS = "showPlaceLabels"
+ internal const val CONFIG_SHOW_ROAD_LABELS = "showRoadLabels"
+ internal const val CONFIG_SHOW_POINT_OF_INTEREST_LABELS = "showPointOfInterestLabels"
+ internal const val CONFIG_SHOW_TRANSIT_LABELS = "showTransitLabels"
+ internal const val CONFIG_LIGHT_PRESET = "lightPreset"
+ internal const val CONFIG_FONT = "font"
+ }
+}
\ No newline at end of file
diff --git a/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/MapboxStandardSatelliteStyle.kt b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/MapboxStandardSatelliteStyle.kt
new file mode 100644
index 0000000000..175ac02a43
--- /dev/null
+++ b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/MapboxStandardSatelliteStyle.kt
@@ -0,0 +1,152 @@
+package com.mapbox.maps.extension.compose.style.standard
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.remember
+import com.mapbox.maps.Style
+import com.mapbox.maps.TransitionOptions
+import com.mapbox.maps.extension.compose.MapboxMapComposable
+import com.mapbox.maps.extension.compose.style.GenericStyle
+import com.mapbox.maps.extension.compose.style.MapboxStyleComposable
+import com.mapbox.maps.extension.compose.style.atmosphere.generated.AtmosphereState
+import com.mapbox.maps.extension.compose.style.imports.MapboxStyleImportComposable
+import com.mapbox.maps.extension.compose.style.imports.StyleImportsScope
+import com.mapbox.maps.extension.compose.style.lights.LightsState
+import com.mapbox.maps.extension.compose.style.projection.generated.Projection
+import com.mapbox.maps.extension.compose.style.slotsContent
+import com.mapbox.maps.extension.compose.style.styleImportsConfig
+import com.mapbox.maps.extension.compose.style.terrain.generated.TerrainState
+import com.mapbox.maps.extension.style.utils.transition
+
+/**
+ * The convenient composable function to set a Mapbox Standard Satellite style to the map, with available slots
+ * and config options.
+ *
+ * @param styleImportsContent The style imports to be added to the current style, note layers and annotations shouldn't be added to this block.
+ * @param topSlot The content to be set to the top slot of the Mapbox Standard Satellite style.
+ * @param middleSlot The content to be set to the middle slot of the Mapbox Standard Satellite style.
+ * @param bottomSlot The content to be set to the bottom slot of the Mapbox Standard Satellite style.
+ * @param projection The projection to be set to the map. Defaults to [Projection.DEFAULT] meaning that projection value is taken from the Standard style definition.
+ * @param atmosphereState The atmosphere to be set to the map By default, no changes to the current atmosphere.
+ * @param terrainState The terrain to be set to the map. Defaults to initial state meaning no custom terrain is added, default value is taken from Standard style definition.
+ * @param lightsState The lights to be set to the map. By default, no changes to the current lights defined in style.
+ * @param styleTransition Transition options applied when loading the style.
+ * @param standardSatelliteStyleConfigurationState The configurations for [MapboxStandardSatelliteStyle].
+ */
+@Composable
+@MapboxStyleComposable
+public fun MapboxStandardSatelliteStyle(
+ styleImportsContent: (@Composable @MapboxStyleImportComposable StyleImportsScope.() -> Unit)? = null,
+ topSlot: (@Composable @MapboxMapComposable () -> Unit)? = null,
+ middleSlot: (@Composable @MapboxMapComposable () -> Unit)? = null,
+ bottomSlot: (@Composable @MapboxMapComposable () -> Unit)? = null,
+ projection: Projection = Projection.INITIAL,
+ atmosphereState: AtmosphereState = remember { AtmosphereState() },
+ terrainState: TerrainState = TerrainState.INITIAL,
+ lightsState: LightsState = LightsState.INITIAL,
+ styleTransition: TransitionOptions = remember { transition { } },
+ standardSatelliteStyleConfigurationState: StandardSatelliteStyleConfigurationState = remember {
+ StandardSatelliteStyleConfigurationState()
+ }
+) {
+ GenericStyle(
+ style = Style.STANDARD_SATELLITE,
+ styleImportsContent = styleImportsContent,
+ slotsContent = slotsContent {
+ topSlot?.let { slot("top", it) }
+ middleSlot?.let { slot("middle", it) }
+ bottomSlot?.let { slot("bottom", it) }
+ },
+ styleImportsConfig = styleImportsConfig {
+ importConfig(importId = "basemap") {
+ with(standardSatelliteStyleConfigurationState) {
+ if (showPlaceLabels.notInitial) {
+ config(BaseStyleConfigurationState.CONFIG_SHOW_PLACE_LABELS, showPlaceLabels.value)
+ }
+ if (showRoadLabels.notInitial) {
+ config(BaseStyleConfigurationState.CONFIG_SHOW_ROAD_LABELS, showRoadLabels.value)
+ }
+ if (showPointOfInterestLabels.notInitial) {
+ config(
+ BaseStyleConfigurationState.CONFIG_SHOW_POINT_OF_INTEREST_LABELS,
+ showPointOfInterestLabels.value
+ )
+ }
+ if (showTransitLabels.notInitial) {
+ config(
+ BaseStyleConfigurationState.CONFIG_SHOW_TRANSIT_LABELS,
+ showTransitLabels.value
+ )
+ }
+ if (lightPreset.notInitial) {
+ config(BaseStyleConfigurationState.CONFIG_LIGHT_PRESET, lightPreset.value)
+ }
+ if (font.notInitial) {
+ config(BaseStyleConfigurationState.CONFIG_FONT, font.value)
+ }
+ if (showRoadsAndTransit.notInitial) {
+ config(
+ StandardSatelliteStyleConfigurationState.CONFIG_SHOW_ROADS_AND_TRANSIT,
+ showRoadsAndTransit.value
+ )
+ }
+ if (showPedestrianRoads.notInitial) {
+ config(
+ StandardSatelliteStyleConfigurationState.CONFIG_SHOW_PEDESTRIAN_ROADS,
+ showPedestrianRoads.value
+ )
+ }
+ }
+ }
+ },
+ projection = projection,
+ atmosphereState = atmosphereState,
+ terrainState = terrainState,
+ lightsState = lightsState,
+ styleTransition = styleTransition,
+ )
+}
+
+/**
+ * The convenient composable function to set a Mapbox Standard Satellite style to the map, with available slots
+ * and config options.
+ *
+ * @param styleImportsContent The style imports to be added to the current style, note layers and annotations shouldn't be added to this block.
+ * @param topSlot The content to be set to the top slot of the Mapbox Standard Satellite style.
+ * @param middleSlot The content to be set to the middle slot of the Mapbox Standard Satellite style.
+ * @param bottomSlot The content to be set to the bottom slot of the Mapbox Standard Satellite style.
+ * @param projection The projection to be set to the map. Defaults to [Projection.DEFAULT] meaning that projection value is taken from the Standard style definition.
+ * @param atmosphereState The atmosphere to be set to the map By default, no changes to the current atmosphere.
+ * @param terrainState The terrain to be set to the map. Defaults to initial state meaning no custom terrain is added, default value is taken from Standard style definition.
+ * @param lightsState The lights to be set to the map. By default, no changes to the current lights defined in style.
+ * @param styleTransition Transition options applied when loading the style.
+ * @param init The lambda that will be applied to the remembered [StandardSatelliteStyleConfigurationState].
+ */
+@Composable
+@MapboxStyleComposable
+public fun MapboxStandardSatelliteStyle(
+ styleImportsContent: (@Composable @MapboxStyleImportComposable StyleImportsScope.() -> Unit)? = null,
+ topSlot: (@Composable @MapboxMapComposable () -> Unit)? = null,
+ middleSlot: (@Composable @MapboxMapComposable () -> Unit)? = null,
+ bottomSlot: (@Composable @MapboxMapComposable () -> Unit)? = null,
+ projection: Projection = Projection.INITIAL,
+ atmosphereState: AtmosphereState = remember { AtmosphereState() },
+ terrainState: TerrainState = TerrainState.INITIAL,
+ lightsState: LightsState = LightsState.INITIAL,
+ styleTransition: TransitionOptions = remember { transition { } },
+ init: StandardSatelliteStyleConfigurationState.() -> Unit
+) {
+ MapboxStandardSatelliteStyle(
+ styleImportsContent = styleImportsContent,
+ topSlot = topSlot,
+ middleSlot = middleSlot,
+ bottomSlot = bottomSlot,
+ projection = projection,
+ atmosphereState = atmosphereState,
+ terrainState = terrainState,
+ lightsState = lightsState,
+ styleTransition = styleTransition,
+ standardSatelliteStyleConfigurationState = remember {
+ StandardSatelliteStyleConfigurationState()
+ }.apply(init)
+ )
+}
\ No newline at end of file
diff --git a/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/MapboxStandardStyle.kt b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/MapboxStandardStyle.kt
index cc89fb96fe..b3140332c0 100644
--- a/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/MapboxStandardStyle.kt
+++ b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/MapboxStandardStyle.kt
@@ -60,28 +60,34 @@ public fun MapboxStandardStyle(
importConfig(importId = "basemap") {
with(standardStyleConfigurationState) {
if (showPlaceLabels.notInitial) {
- config(StandardStyleConfigurationState.CONFIG_SHOW_PLACE_LABELS, showPlaceLabels.value)
+ config(BaseStyleConfigurationState.CONFIG_SHOW_PLACE_LABELS, showPlaceLabels.value)
}
if (showRoadLabels.notInitial) {
- config(StandardStyleConfigurationState.CONFIG_SHOW_ROAD_LABELS, showRoadLabels.value)
+ config(BaseStyleConfigurationState.CONFIG_SHOW_ROAD_LABELS, showRoadLabels.value)
}
if (showPointOfInterestLabels.notInitial) {
config(
- StandardStyleConfigurationState.CONFIG_SHOW_POINT_OF_INTEREST_LABELS,
+ BaseStyleConfigurationState.CONFIG_SHOW_POINT_OF_INTEREST_LABELS,
showPointOfInterestLabels.value
)
}
if (showTransitLabels.notInitial) {
config(
- StandardStyleConfigurationState.CONFIG_SHOW_TRANSIT_LABELS,
+ BaseStyleConfigurationState.CONFIG_SHOW_TRANSIT_LABELS,
showTransitLabels.value
)
}
if (lightPreset.notInitial) {
- config(StandardStyleConfigurationState.CONFIG_LIGHT_PRESET, lightPreset.value)
+ config(BaseStyleConfigurationState.CONFIG_LIGHT_PRESET, lightPreset.value)
}
if (font.notInitial) {
- config(StandardStyleConfigurationState.CONFIG_FONT, font.value)
+ config(BaseStyleConfigurationState.CONFIG_FONT, font.value)
+ }
+ if (show3dObjects.notInitial) {
+ config(StandardStyleConfigurationState.CONFIG_SHOW_3D_OBJECTS, show3dObjects.value)
+ }
+ if (theme.notInitial) {
+ config(StandardStyleConfigurationState.CONFIG_THEME, theme.value)
}
}
}
diff --git a/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/StandardSatelliteStyleConfigurationState.kt b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/StandardSatelliteStyleConfigurationState.kt
new file mode 100644
index 0000000000..ac6bd9f8db
--- /dev/null
+++ b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/StandardSatelliteStyleConfigurationState.kt
@@ -0,0 +1,39 @@
+package com.mapbox.maps.extension.compose.style.standard
+
+import androidx.compose.runtime.Stable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import com.mapbox.maps.extension.compose.style.BooleanValue
+
+/**
+ * The state holder for the [MapboxStandardSatelliteStyle]'s configurations.
+ */
+@Stable
+public class StandardSatelliteStyleConfigurationState private constructor(
+ initialShowRoadsAndTransit: BooleanValue,
+ initialShowPedestrianRoads: BooleanValue,
+) : BaseStyleConfigurationState() {
+ /**
+ * Public constructor for [StandardSatelliteStyleConfigurationState].
+ */
+ public constructor() : this(
+ initialShowRoadsAndTransit = BooleanValue.INITIAL,
+ initialShowPedestrianRoads = BooleanValue.INITIAL,
+ )
+
+ /**
+ * Whether or not to show all roads and transit networks, default to true.
+ */
+ public var showRoadsAndTransit: BooleanValue by mutableStateOf(initialShowRoadsAndTransit)
+
+ /**
+ * Whether or not to show all pedestrian roads, paths, trails, default to true.
+ */
+ public var showPedestrianRoads: BooleanValue by mutableStateOf(initialShowPedestrianRoads)
+
+ internal companion object {
+ internal const val CONFIG_SHOW_ROADS_AND_TRANSIT = "showRoadsAndTransit"
+ internal const val CONFIG_SHOW_PEDESTRIAN_ROADS = "showPedestrianRoads"
+ }
+}
\ No newline at end of file
diff --git a/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/StandardStyleConfigurationState.kt b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/StandardStyleConfigurationState.kt
index 5c3d638901..aa61b0f1c1 100644
--- a/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/StandardStyleConfigurationState.kt
+++ b/extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/standard/StandardStyleConfigurationState.kt
@@ -7,29 +7,28 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.mapbox.bindgen.Value
import com.mapbox.maps.extension.compose.style.BooleanValue
-import com.mapbox.maps.extension.compose.style.StringValue
import com.mapbox.maps.extension.compose.style.standard.LightPresetValue.Companion.equals
import com.mapbox.maps.extension.style.expressions.generated.Expression
/**
- * Define the lightPreset style import config for [MapboxStandardStyle].
+ * Define the Theme style import config for [MapboxStandardStyle].
*
* @param value the property wrapped in [Value] to be used with native renderer.
*/
@Immutable
-public data class LightPresetValue(public val value: Value) {
+public data class ThemeValue(public val value: Value) {
/**
- * Construct the [LightPresetValue] with [String].
+ * Construct the [ThemeValue] with [String].
*/
public constructor(value: String) : this(Value(value))
/**
- * Construct the [LightPresetValue] with [Mapbox Expression](https://docs.mapbox.com/style-spec/reference/expressions/).
+ * Construct the [ThemeValue] with [Mapbox Expression](https://docs.mapbox.com/style-spec/reference/expressions/).
*/
public constructor(expression: Expression) : this(expression as Value)
/**
- * Get the name of the [LightPresetValue] as [String], or null if it's not a constant(e.g. an expression).
+ * Get the name of the [ThemeValue] as [String], or null if it's not a constant(e.g. an expression).
*/
public val presetNameOrNull: String?
get() = value.contents as? String
@@ -53,101 +52,58 @@ public data class LightPresetValue(public val value: Value) {
* to differentiate them because they use [equals].
*/
@JvmField
- internal val INITIAL: LightPresetValue =
- LightPresetValue(Value.valueOf("LightPresetValue.INITIAL"))
+ internal val INITIAL: ThemeValue =
+ ThemeValue(Value.valueOf("ThemeValue.INITIAL"))
/**
- * Default value for [LightPresetValue], setting default will result in restoring the property value defined in the style.
+ * The theme for "default".
*/
@JvmField
- public val DEFAULT: LightPresetValue = LightPresetValue(Value.nullValue())
+ public val DEFAULT: ThemeValue = ThemeValue("default")
/**
- * The light preset for "day".
+ * The theme for "faded".
*/
@JvmField
- public val DAY: LightPresetValue = LightPresetValue("day")
+ public val FADED: ThemeValue = ThemeValue("faded")
/**
- * The light preset for "night".
+ * The theme for "monochrome".
*/
@JvmField
- public val NIGHT: LightPresetValue = LightPresetValue("night")
-
- /**
- * The light preset for "dusk".
- */
- @JvmField
- public val DUSK: LightPresetValue = LightPresetValue("dusk")
-
- /**
- * The light preset for "dawn".
- */
- @JvmField
- public val DAWN: LightPresetValue = LightPresetValue("dawn")
+ public val MONOCHROME: ThemeValue = ThemeValue("monochrome")
}
}
/**
- * The state holder for [MapboxStandardStyle]'s configurations.
+ * The state holder for the [MapboxStandardStyle]'s configurations.
*/
@Stable
public class StandardStyleConfigurationState private constructor(
- initialShowPlaceLabels: BooleanValue,
- initialShowRoadLabels: BooleanValue,
- initialShowPointOfInterestLabels: BooleanValue,
- initialShowTransitLabels: BooleanValue,
- initialLightPreset: LightPresetValue,
- initialFont: StringValue,
-) {
+ initialTheme: ThemeValue,
+ initialShow3dObjects: BooleanValue
+) : BaseStyleConfigurationState() {
+
/**
* Public constructor for [StandardStyleConfigurationState].
*/
public constructor() : this(
- initialShowPlaceLabels = BooleanValue.INITIAL,
- initialShowRoadLabels = BooleanValue.INITIAL,
- initialShowPointOfInterestLabels = BooleanValue.INITIAL,
- initialShowTransitLabels = BooleanValue.INITIAL,
- initialLightPreset = LightPresetValue.INITIAL,
- initialFont = StringValue.INITIAL,
+ initialTheme = ThemeValue.INITIAL,
+ initialShow3dObjects = BooleanValue.INITIAL,
)
/**
- * Whether or not to show the place labels, default to true.
- */
- public var showPlaceLabels: BooleanValue by mutableStateOf(initialShowPlaceLabels)
-
- /**
- * Whether or not to show the road labels, default to true.
- */
- public var showRoadLabels: BooleanValue by mutableStateOf(initialShowRoadLabels)
-
- /**
- * Whether or not to show the point of interest labels, default to true.
- */
- public var showPointOfInterestLabels: BooleanValue by mutableStateOf(initialShowPointOfInterestLabels)
-
- /**
- * Whether or not to show the transit labels, default to true.
- */
- public var showTransitLabels: BooleanValue by mutableStateOf(initialShowTransitLabels)
-
- /**
- * The [LightPresetValue] settings of the Mapbox Standard Style, available lightPresets including "day", "night", "dawn", "dusk", defaults to "day".
+ * The [ThemeValue] settings of the Mapbox Standard Style, available themes "default", "faded" and "monochrome".
*/
- public var lightPreset: LightPresetValue by mutableStateOf(initialLightPreset)
+ public var theme: ThemeValue by mutableStateOf(initialTheme)
/**
- * The font to be used with the standard style.
+ * Whether or not to show all 3d layers (3D buildings, landmarks, trees, etc.) including shadows, ambient occlusion, and flood lights.
*/
- public var font: StringValue by mutableStateOf(initialFont)
+ public var show3dObjects: BooleanValue by mutableStateOf(initialShow3dObjects)
internal companion object {
- internal const val CONFIG_SHOW_PLACE_LABELS = "showPlaceLabels"
- internal const val CONFIG_SHOW_ROAD_LABELS = "showRoadLabels"
- internal const val CONFIG_SHOW_POINT_OF_INTEREST_LABELS = "showPointOfInterestLabels"
- internal const val CONFIG_SHOW_TRANSIT_LABELS = "showTransitLabels"
- internal const val CONFIG_LIGHT_PRESET = "lightPreset"
- internal const val CONFIG_FONT = "font"
+ internal const val CONFIG_THEME = "theme"
+ internal const val CONFIG_SHOW_3D_OBJECTS = "show3dObjects"
}
}
\ No newline at end of file
diff --git a/sdk/api/Release/metalava.txt b/sdk/api/Release/metalava.txt
index ba7fb10462..452f81d1f6 100644
--- a/sdk/api/Release/metalava.txt
+++ b/sdk/api/Release/metalava.txt
@@ -440,6 +440,7 @@ package com.mapbox.maps {
field public static final String SATELLITE = "mapbox://styles/mapbox/satellite-v9";
field public static final String SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-streets-v12";
field public static final String STANDARD = "mapbox://styles/mapbox/standard";
+ field public static final String STANDARD_SATELLITE = "mapbox://styles/mapbox/standard-satellite";
field public static final String TRAFFIC_DAY = "mapbox://styles/mapbox/traffic-day-v2";
field public static final String TRAFFIC_NIGHT = "mapbox://styles/mapbox/traffic-night-v2";
}
diff --git a/sdk/api/sdk.api b/sdk/api/sdk.api
index 871d424958..d80f3967ab 100644
--- a/sdk/api/sdk.api
+++ b/sdk/api/sdk.api
@@ -445,6 +445,7 @@ public final class com/mapbox/maps/Style : com/mapbox/maps/MapboxStyleManager {
public static final field SATELLITE Ljava/lang/String;
public static final field SATELLITE_STREETS Ljava/lang/String;
public static final field STANDARD Ljava/lang/String;
+ public static final field STANDARD_SATELLITE Ljava/lang/String;
public static final field TRAFFIC_DAY Ljava/lang/String;
public static final field TRAFFIC_NIGHT Ljava/lang/String;
public fun addGeoJSONSourceFeatures (Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)Lcom/mapbox/bindgen/Expected;
diff --git a/sdk/src/main/java/com/mapbox/maps/Style.kt b/sdk/src/main/java/com/mapbox/maps/Style.kt
index f6a37bf7b6..b662f990bd 100644
--- a/sdk/src/main/java/com/mapbox/maps/Style.kt
+++ b/sdk/src/main/java/com/mapbox/maps/Style.kt
@@ -1300,6 +1300,11 @@ class Style internal constructor(
*/
const val STANDARD = "mapbox://styles/mapbox/standard"
+ /**
+ * Mapbox Standard Satellite: Combines updated satellite imagery and vector layers to offer users improved clarity and detail.
+ */
+ const val STANDARD_SATELLITE = "mapbox://styles/mapbox/standard-satellite"
+
/**
* Mapbox Streets: A complete base map, perfect for incorporating your own data. Using this
* constant means your map style will always use the latest version and may change as we