Skip to content

[Feature request]: setMapColorScheme and isBuildingsEnabled missing #535

@lazar89nis

Description

@lazar89nis

Is there an existing issue for this?

  • I have searched the existing issues

Use case

We should have the ability to set is buildings enabled and the map color scheme. Without a set map color scheme map does not look good in light and dark modes when using custom styles.
Also, i would be nice if we could enable or disable if buildings are enabled.
I made a fork to do this, but it would be great if it could be added to the main repo.

Just one method to do "map.setMapColorScheme(colorScheme)" and one for "getMap().isBuildingsEnabled = enabled".

Proposal

Something like this on kotlin side:

fun isBuildingsEnabled(): Boolean {
return getMap().isBuildingsEnabled
}

fun setBuildingsEnabled(enabled: Boolean) {
getMap().isBuildingsEnabled = enabled
}

fun getOverrideUserInterfaceStyle(): UserInterfaceStyleDto? {
val map = getMap()
return when (map.mapColorScheme) {
MapColorScheme.LIGHT -> UserInterfaceStyleDto.LIGHT
MapColorScheme.DARK -> UserInterfaceStyleDto.DARK
MapColorScheme.FOLLOW_SYSTEM -> UserInterfaceStyleDto.UNSPECIFIED
else -> UserInterfaceStyleDto.UNSPECIFIED
}
}

fun setOverrideUserInterfaceStyle(style: UserInterfaceStyleDto?) {
val map = getMap()
val colorScheme = when (style) {
UserInterfaceStyleDto.LIGHT -> MapColorScheme.LIGHT
UserInterfaceStyleDto.DARK -> MapColorScheme.DARK
UserInterfaceStyleDto.UNSPECIFIED, null -> MapColorScheme.FOLLOW_SYSTEM
}
map.setMapColorScheme(colorScheme)
}

And something like this on iOS side:
func isBuildingsEnabled() -> Bool {
_mapView.isBuildingsEnabled
}

func setBuildingsEnabled(_ enabled: Bool) {
_mapView.isBuildingsEnabled = enabled
}

func getOverrideUserInterfaceStyle() -> UserInterfaceStyleDto? {
if #available(iOS 13.0, *) {
switch _mapView.overrideUserInterfaceStyle {
case .unspecified:
return .unspecified
case .light:
return .light
case .dark:
return .dark
@unknown default:
return .unspecified
}
}
return .unspecified
}

func setOverrideUserInterfaceStyle(_ style: UserInterfaceStyleDto?) {
if #available(iOS 13.0, *) {
guard let style = style else {
_mapView.overrideUserInterfaceStyle = .unspecified
return
}
switch style {
case .unspecified:
_mapView.overrideUserInterfaceStyle = .unspecified
case .light:
_mapView.overrideUserInterfaceStyle = .light
case .dark:
_mapView.overrideUserInterfaceStyle = .dark
}
}

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions