2023-09-12 10:16:34 +02:00
|
|
|
part of flutter_google_track_and_trace;
|
2021-09-30 12:34:43 +02:00
|
|
|
|
|
|
|
/// Styling object for the Google maps Style
|
2023-01-24 10:15:13 +01:00
|
|
|
///
|
2021-09-30 12:34:43 +02:00
|
|
|
/// Contains a List of features with stylers applied to them
|
|
|
|
/// Full documentation on all the possible style:
|
|
|
|
/// https://developers.google.com/maps/documentation/javascript/style-reference
|
|
|
|
/// ```dart
|
|
|
|
/// GoogleTrackTraceMapTheme(
|
|
|
|
/// themes: [
|
|
|
|
/// GoogleMapThemeFeature(
|
|
|
|
/// featureType: 'poi',
|
|
|
|
/// stylers: [
|
|
|
|
/// {'visibility': 'off'},
|
|
|
|
/// ],
|
|
|
|
/// ),
|
|
|
|
/// ],
|
|
|
|
/// ),
|
|
|
|
/// ```
|
|
|
|
class GoogleTrackTraceMapTheme {
|
|
|
|
GoogleTrackTraceMapTheme({
|
|
|
|
required this.themes,
|
|
|
|
});
|
|
|
|
final List<GoogleMapThemeFeature> themes;
|
2023-01-24 10:15:13 +01:00
|
|
|
|
2021-09-30 12:34:43 +02:00
|
|
|
String getJson() {
|
2023-04-11 15:01:43 +02:00
|
|
|
return jsonEncode(themes.map((e) => e.toJson()).toList());
|
2021-09-30 12:34:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class GoogleMapThemeFeature {
|
|
|
|
GoogleMapThemeFeature({
|
|
|
|
required this.stylers,
|
|
|
|
this.featureType,
|
|
|
|
this.elementType,
|
|
|
|
});
|
|
|
|
final String? featureType;
|
|
|
|
final String? elementType;
|
|
|
|
final List<Map<String, String>> stylers;
|
|
|
|
|
|
|
|
Map toJson() {
|
|
|
|
return {
|
2023-01-24 10:15:13 +01:00
|
|
|
if (featureType != null) 'featureType': featureType,
|
|
|
|
if (elementType != null) 'elementType': elementType,
|
2021-09-30 12:34:43 +02:00
|
|
|
'stylers': stylers,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2021-10-05 21:09:19 +02:00
|
|
|
|
|
|
|
enum GoogleMapThemeFeatureType {
|
2023-01-24 10:15:13 +01:00
|
|
|
featureAll,
|
2021-10-05 21:09:19 +02:00
|
|
|
}
|