Skip to content

Commit aba6de7

Browse files
gabbopalmajosxha
andauthored
feat!: Remove android and maplibre native specific options for the user interface. (#141)
- [X] Remove android and maplibre native specific options Closes a task of #113 --------- Co-authored-by: Joscha <[email protected]>
1 parent d2deb99 commit aba6de7

File tree

16 files changed

+15
-244
lines changed

16 files changed

+15
-244
lines changed

android/src/main/kotlin/com/github/josxha/maplibre/MapLibreMapController.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ class MapLibreMapController(
8282
val options =
8383
MapLibreMapOptions
8484
.createFromAttributes(context)
85-
.attributionEnabled(mapOptions.attribution)
86-
.logoEnabled(mapOptions.logo)
85+
.attributionEnabled(false)
86+
.logoEnabled(false)
8787
// TODO: textureMode comes at a significant performance penalty, https://maplibre.org/maplibre-native/android/api/-map-libre%20-native%20-android/org.maplibre.android.maps/-map-libre-map-options/texture-mode.html
8888
.textureMode(mapOptions.androidTextureMode)
89-
.compassEnabled(mapOptions.compass)
89+
.compassEnabled(false)
9090
.minZoomPreference(mapOptions.minZoom)
9191
.maxZoomPreference(mapOptions.maxZoom)
9292
.minPitchPreference(mapOptions.minPitch)

android/src/main/kotlin/com/github/josxha/maplibre/Pigeon.g.kt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ data class MapOptions (
123123
val maxPitch: Double,
124124
/** The map gestures. */
125125
val gestures: MapGestures,
126-
/** Toggle the MapLibre Native compass. */
127-
val compass: Boolean,
128-
/** Toggle the MapLibre Native logo. */
129-
val logo: Boolean,
130-
/** Toggle the MapLibre Native attribution. */
131-
val attribution: Boolean,
132126
/** Toggle the texture mode on android. */
133127
val androidTextureMode: Boolean
134128
)
@@ -146,11 +140,8 @@ data class MapOptions (
146140
val minPitch = pigeonVar_list[8] as Double
147141
val maxPitch = pigeonVar_list[9] as Double
148142
val gestures = pigeonVar_list[10] as MapGestures
149-
val compass = pigeonVar_list[11] as Boolean
150-
val logo = pigeonVar_list[12] as Boolean
151-
val attribution = pigeonVar_list[13] as Boolean
152-
val androidTextureMode = pigeonVar_list[14] as Boolean
153-
return MapOptions(style, zoom, pitch, bearing, center, maxBounds, minZoom, maxZoom, minPitch, maxPitch, gestures, compass, logo, attribution, androidTextureMode)
143+
val androidTextureMode = pigeonVar_list[11] as Boolean
144+
return MapOptions(style, zoom, pitch, bearing, center, maxBounds, minZoom, maxZoom, minPitch, maxPitch, gestures, androidTextureMode)
154145
}
155146
}
156147
fun toList(): List<Any?> {
@@ -166,9 +157,6 @@ data class MapOptions (
166157
minPitch,
167158
maxPitch,
168159
gestures,
169-
compass,
170-
logo,
171-
attribution,
172160
androidTextureMode,
173161
)
174162
}

example/lib/styled_map_page.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class _StyledMapPageState extends State<StyledMapPage> {
3333
initStyle: Theme.of(context).brightness == Brightness.light
3434
? StyledMapPage.styleUrl
3535
: StyledMapPage.styleUrlDark,
36-
attribution: false,
3736
),
3837
children: const [SourceAttribution()],
3938
),

example/lib/user_interface_page.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ class _UserInterfacePageState extends State<UserInterfacePage> {
2424
initStyle: Theme.of(context).brightness == Brightness.light
2525
? StyledMapPage.styleUrl
2626
: StyledMapPage.styleUrlDark,
27-
attribution: false,
28-
nativeCompass: false,
29-
nativeLogo: false,
3027
),
3128
children: const [
3229
MapScalebar(),

example/lib/widget_layer_page.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class _WidgetLayerPageState extends State<WidgetLayerPage> {
2020
options: MapOptions(
2121
initZoom: 3,
2222
initCenter: Position(0, 0),
23-
attribution: false,
24-
nativeCompass: false,
25-
nativeLogo: false,
2623
),
2724
children: [
2825
WidgetLayer(

ios/Classes/Pigeon.g.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ struct MapOptions {
123123
var maxPitch: Double
124124
/// The map gestures.
125125
var gestures: MapGestures
126-
/// Toggle the MapLibre Native compass.
127-
var compass: Bool
128-
/// Toggle the MapLibre Native logo.
129-
var logo: Bool
130-
/// Toggle the MapLibre Native attribution.
131-
var attribution: Bool
132126
/// Toggle the texture mode on android.
133127
var androidTextureMode: Bool
134128

@@ -147,10 +141,7 @@ struct MapOptions {
147141
let minPitch = pigeonVar_list[8] as! Double
148142
let maxPitch = pigeonVar_list[9] as! Double
149143
let gestures = pigeonVar_list[10] as! MapGestures
150-
let compass = pigeonVar_list[11] as! Bool
151-
let logo = pigeonVar_list[12] as! Bool
152-
let attribution = pigeonVar_list[13] as! Bool
153-
let androidTextureMode = pigeonVar_list[14] as! Bool
144+
let androidTextureMode = pigeonVar_list[11] as! Bool
154145

155146
return MapOptions(
156147
style: style,
@@ -164,9 +155,6 @@ struct MapOptions {
164155
minPitch: minPitch,
165156
maxPitch: maxPitch,
166157
gestures: gestures,
167-
compass: compass,
168-
logo: logo,
169-
attribution: attribution,
170158
androidTextureMode: androidTextureMode
171159
)
172160
}
@@ -183,9 +171,6 @@ struct MapOptions {
183171
minPitch,
184172
maxPitch,
185173
gestures,
186-
compass,
187-
logo,
188-
attribution,
189174
androidTextureMode,
190175
]
191176
}

lib/src/map_options.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class MapOptions {
2020
this.maxPitch = 60,
2121
this.maxBounds,
2222
this.gestures = const MapGestures.all(),
23-
this.nativeCompass = true,
24-
this.nativeLogo = true,
25-
this.attribution = true,
2623
this.androidTextureMode = true,
2724
this.androidMode = AndroidPlatformViewMode.tlhc_vd,
2825
}) : initPitch = pitch ?? initPitch;
@@ -79,15 +76,6 @@ class MapOptions {
7976
/// Enable and disable some or all map gestures.
8077
final MapGestures gestures;
8178

82-
/// Toggle the MapLibre Native compass.
83-
final bool nativeCompass;
84-
85-
/// Toggle the MapLibre Native logo.
86-
final bool nativeLogo;
87-
88-
/// Toggle the MapLibre Native logo.
89-
final bool attribution;
90-
9179
/// The platform view type used on android.
9280
///
9381
/// https://docs.flutter.dev/platform-integration/android/platform-views

lib/src/platform/android/widget_state.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,6 @@ final class MapLibreMapStateAndroid extends MapLibreMapState
218218
zoom: _options.gestures.zoom,
219219
tilt: _options.gestures.pitch,
220220
),
221-
compass: _options.nativeCompass,
222-
logo: _options.nativeLogo,
223-
attribution: _options.attribution,
224221
androidTextureMode: _options.androidTextureMode,
225222
);
226223

lib/src/platform/pigeon.g.dart

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ class MapOptions {
7474
required this.minPitch,
7575
required this.maxPitch,
7676
required this.gestures,
77-
required this.compass,
78-
required this.logo,
79-
required this.attribution,
8077
required this.androidTextureMode,
8178
});
8279

@@ -113,15 +110,6 @@ class MapOptions {
113110
/// The map gestures.
114111
MapGestures gestures;
115112

116-
/// Toggle the MapLibre Native compass.
117-
bool compass;
118-
119-
/// Toggle the MapLibre Native logo.
120-
bool logo;
121-
122-
/// Toggle the MapLibre Native attribution.
123-
bool attribution;
124-
125113
/// Toggle the texture mode on android.
126114
bool androidTextureMode;
127115

@@ -138,9 +126,6 @@ class MapOptions {
138126
minPitch,
139127
maxPitch,
140128
gestures,
141-
compass,
142-
logo,
143-
attribution,
144129
androidTextureMode,
145130
];
146131
}
@@ -159,10 +144,7 @@ class MapOptions {
159144
minPitch: result[8]! as double,
160145
maxPitch: result[9]! as double,
161146
gestures: result[10]! as MapGestures,
162-
compass: result[11]! as bool,
163-
logo: result[12]! as bool,
164-
attribution: result[13]! as bool,
165-
androidTextureMode: result[14]! as bool,
147+
androidTextureMode: result[11]! as bool,
166148
);
167149
}
168150
}

lib/src/platform/web/widget_state.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ final class MapLibreMapStateWeb extends MapLibreMapState {
4444
center: options.initCenter?.toLngLat(),
4545
bearing: options.initBearing,
4646
pitch: options.initPitch,
47-
attributionControl: options.attribution,
47+
attributionControl: false,
4848
),
4949
);
5050

0 commit comments

Comments
 (0)