Skip to content

Commit 5fd5ded

Browse files
pjleonard37Release SDK bot for Maps SDK teamclaudenatiginfo
authored andcommitted
Add LandmarkIcons featureset, Add templates to generate Standard Style and v4 updates (#6177)
Closes https://mapbox.atlassian.net/browse/MAPSAND-2269 & https://mapbox.atlassian.net/browse/MAPSAND-2241 Key Changes: -Adds LandmarkIcons Featureset: Query and interact with landmark building icons, accessing properties like landmark name, type, and localized names through StandardLandmarkIconsFeature - Added interactions with this featureset to an example - Enhanced Configuration: in Compose both MapboxStandardStyle() and MapboxStandardSatelliteStyle() now support all schema configuration options through unified configurationsState pattern: - Color customization (roads, motorways, water, greenspaces, boundaries) - Landmark icon visibility controls (showLandmarkIcons, showLandmarkIconLabels) - POI styling (backgrounds, colors, density) - Road appearance (brightness, pedestrian roads, transit networks) - Administrative boundaries and 3D objects - Added code generators for both MapboxStandardStyle() and MapboxStandardSatelliteStyle() - Note: to maintain backwards compatibility I generated the existing Composable functions as-is (hard coding them into the top of the templates). As new configuration options are added they will only be amended to the non-deprecated Composable functions. - All configuration options tested and verified through StandardStyleConfigurationTest cc @mapbox/maps-android cc @mapbox/maps-ios cc @mapbox/sdk-ci --------- Co-authored-by: Release SDK bot for Maps SDK team <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: natiginfo <[email protected]> GitOrigin-RevId: 5514af9dd7b795b90f0d9a487b3e1598c20aa042
1 parent cf4dcbb commit 5fd5ded

File tree

20 files changed

+1908
-155
lines changed

20 files changed

+1908
-155
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ Mapbox welcomes participation and contributions from everyone.
55
> **16 KB Page Size Support:** Starting with version 11.7.0 and 10.19.0, **NDK 27 is supported** with dedicated artifacts that include [support for 16 KB page sizes](https://developer.android.com/guide/practices/page-sizes). If your app does not require 16 KB page size support, you can keep using our default artifacts without `-ndk27` suffix. For more information about our NDK support, see https://docs.mapbox.com/android/maps/guides/#ndk-support
66
77
# main
8+
## Features ✨ and improvements 🏁
9+
* Added support for `LandmarkIcons` featureset in Mapbox Standard Style. Query and interact with landmark building icons that appear on the map, accessing properties including landmark ID, name, type, and localized names through the `StandardLandmarkIconsFeature` class.
10+
* Enhanced `MapboxStandardStyle()` and `MapboxStandardSatelliteStyle()` Compose functions with comprehensive configuration options:
11+
- **Color customization**: Set custom colors for roads, motorways, water, greenspaces, administrative boundaries, and more
12+
- **Landmark icons**: Control visibility of landmark building icons and labels (`showLandmarkIcons`, `showLandmarkIconLabels`)
13+
- **Point-of-interest styling**: Configure POI label backgrounds, colors, and density
14+
- **Road appearance**: Adjust road brightness, show/hide pedestrian roads and transit networks
15+
- **Administrative boundaries**: Toggle boundary visibility and customize colors
16+
- **3D objects**: Control visibility of buildings, landmarks, and trees with `show3dObjects`
817

918
## Bug fixes 🐞
1019
* MapboxTracing was deprecated and moved to package com.mapbox.common.

compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/style/StandardStyleActivity.kt

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import com.mapbox.maps.extension.compose.style.standard.LightPresetValue
3434
import com.mapbox.maps.extension.compose.style.standard.MapboxStandardSatelliteStyle
3535
import com.mapbox.maps.extension.compose.style.standard.MapboxStandardStyle
3636
import com.mapbox.maps.extension.compose.style.standard.ThemeValue
37+
import com.mapbox.maps.extension.compose.style.standard.rememberStandardSatelliteStyleState
3738
import com.mapbox.maps.extension.compose.style.standard.rememberStandardStyleState
3839
import com.mapbox.maps.extension.style.utils.transition
3940

@@ -48,7 +49,7 @@ public class StandardStyleActivity : ComponentActivity() {
4849
mutableStateOf(false)
4950
}
5051
var enableLandmarkIcons by remember {
51-
mutableStateOf(false)
52+
mutableStateOf(true)
5253
}
5354
var enablePlaceLabels by remember {
5455
mutableStateOf(true)
@@ -80,6 +81,9 @@ public class StandardStyleActivity : ComponentActivity() {
8081
var enablePedestrianRoads by remember {
8182
mutableStateOf(true)
8283
}
84+
var enableAdminBoundaries by remember {
85+
mutableStateOf(true)
86+
}
8387

8488
MapboxMapComposeTheme {
8589
ExampleScaffold(
@@ -294,7 +298,7 @@ public class StandardStyleActivity : ComponentActivity() {
294298
modifier = Modifier.padding(6.dp),
295299
text = "selectedStyle:${
296300
if (isStandardSatellite) {
297-
"STND_SATELLITE"
301+
"SATELLITE"
298302
} else {
299303
"STANDARD"
300304
}
@@ -305,43 +309,20 @@ public class StandardStyleActivity : ComponentActivity() {
305309
Row(
306310
modifier = Modifier.fillMaxWidth()
307311
) {
308-
FloatingActionButton(
309-
modifier = Modifier
310-
.defaultMinSize(
311-
minWidth = ButtonDefaults.MinWidth,
312-
minHeight = ButtonDefaults.MinHeight
313-
)
314-
.padding(end = 4.dp),
315-
onClick = {
316-
if (isStandardSatellite) {
317-
enableRoadsAndTransit = !enableRoadsAndTransit
318-
}
319-
},
320-
shape = RoundedCornerShape(16.dp),
321-
backgroundColor = if (!isStandardSatellite) Color.Gray else MaterialTheme.colors.secondary,
322-
) {
323-
Text(
324-
modifier = Modifier.padding(6.dp),
325-
text = "roadsAndTransit: $enableRoadsAndTransit"
326-
)
327-
}
328312
FloatingActionButton(
329313
modifier = Modifier
330314
.defaultMinSize(
331315
minWidth = ButtonDefaults.MinWidth,
332316
minHeight = ButtonDefaults.MinHeight
333317
),
334318
onClick = {
335-
if (isStandardSatellite) {
336-
enablePedestrianRoads = !enablePedestrianRoads
337-
}
319+
enableAdminBoundaries = !enableAdminBoundaries
338320
},
339321
shape = RoundedCornerShape(16.dp),
340-
backgroundColor = if (!isStandardSatellite) Color.Gray else MaterialTheme.colors.secondary,
341322
) {
342323
Text(
343324
modifier = Modifier.padding(6.dp),
344-
text = "pedestrianRoads: $enablePedestrianRoads"
325+
text = "enableAdminBoundaries: $enableAdminBoundaries"
345326
)
346327
}
347328
}
@@ -361,22 +342,22 @@ public class StandardStyleActivity : ComponentActivity() {
361342
{
362343
if (isStandardSatellite) {
363344
MapboxStandardSatelliteStyle(
364-
styleTransition = remember {
365-
transition {
345+
standardSatelliteStyleState = rememberStandardSatelliteStyleState {
346+
styleTransition = transition {
366347
duration(1_000)
367348
enablePlacementTransitions(true)
368349
}
350+
configurationsState.apply {
351+
showPlaceLabels = BooleanValue(enablePlaceLabels)
352+
showRoadLabels = BooleanValue(enableRoadLabels)
353+
showPointOfInterestLabels = BooleanValue(enablePointOfInterestLabels)
354+
showTransitLabels = BooleanValue(enableTransitLabels)
355+
lightPreset = selectedLightPreset
356+
font = StringValue(selectedFont)
357+
showAdminBoundaries = BooleanValue(enableAdminBoundaries)
358+
}
369359
}
370-
) {
371-
showPlaceLabels = BooleanValue(enablePlaceLabels)
372-
showRoadLabels = BooleanValue(enableRoadLabels)
373-
showPointOfInterestLabels = BooleanValue(enablePointOfInterestLabels)
374-
showTransitLabels = BooleanValue(enableTransitLabels)
375-
lightPreset = selectedLightPreset
376-
font = StringValue(selectedFont)
377-
showRoadsAndTransit = BooleanValue(enableRoadsAndTransit)
378-
showPedestrianRoads = BooleanValue(enablePedestrianRoads)
379-
}
360+
)
380361
} else {
381362
MapboxStandardStyle(
382363
standardStyleState = rememberStandardStyleState {
@@ -386,6 +367,10 @@ public class StandardStyleActivity : ComponentActivity() {
386367
}
387368
return@onBuildingsClicked true
388369
}
370+
interactionsState.onLandmarkIconsClicked { clickedLandmarkIcon, _ ->
371+
println("Feature name: ${clickedLandmarkIcon.name}")
372+
return@onLandmarkIconsClicked true
373+
}
389374
styleTransition = transition {
390375
duration(1_000)
391376
enablePlacementTransitions(true)
@@ -400,6 +385,7 @@ public class StandardStyleActivity : ComponentActivity() {
400385
font = StringValue(selectedFont)
401386
theme = selectedTheme
402387
show3dObjects = BooleanValue(enable3dObjects)
388+
showAdminBoundaries = BooleanValue(enableAdminBoundaries)
403389
}
404390
}
405391
)

0 commit comments

Comments
 (0)