Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions maplibre_gl/lib/src/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ Future<List<OfflineRegion>> mergeOfflineRegions(String path) async {
'path': path,
},
);
final Iterable regions = json.decode(regionsJson);
return regions.map((region) => OfflineRegion.fromMap(region)).toList();
final regions = List<Map<String, dynamic>>.from(json.decode(regionsJson));
return regions.map(OfflineRegion.fromMap).toList();
}

Future<List<OfflineRegion>> getListOfRegions() async {
final String regionsJson = await _globalChannel.invokeMethod(
'getListOfRegions',
<String, dynamic>{},
);
final Iterable regions = json.decode(regionsJson);
return regions.map((region) => OfflineRegion.fromMap(region)).toList();
final regions = List<Map<String, dynamic>>.from(json.decode(regionsJson));
return regions.map(OfflineRegion.fromMap).toList();
}

Future<OfflineRegion> updateOfflineRegionMetadata(
Expand Down
6 changes: 5 additions & 1 deletion maplibre_gl/lib/src/maplibre_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ typedef MaplibreStyles = MapLibreStyles;
abstract class MapLibreStyles {
/// A very simple MapLibre demo style that shows only countries with their
/// boundaries.
static const String demo = "https://demotiles.maplibre.org/style.json";
static const String demo = 'https://demotiles.maplibre.org/style.json';

/// The OpenFreeMap liberty style
static const String openfreemapLiberty =
'https://tiles.openfreemap.org/styles/liberty';
}
8 changes: 4 additions & 4 deletions maplibre_gl_example/lib/offline_regions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final LatLngBounds hawaiiBounds = LatLngBounds(

final LatLngBounds santiagoBounds = LatLngBounds(
southwest: const LatLng(-33.5597, -70.49102),
northeast: const LatLng(-33.33282, -153.74267),
northeast: const LatLng(-33.33282, -70.40102),
);

final LatLngBounds aucklandBounds = LatLngBounds(
Expand All @@ -25,19 +25,19 @@ final List<OfflineRegionDefinition> regionDefinitions = [
bounds: hawaiiBounds,
minZoom: 3.0,
maxZoom: 8.0,
mapStyleUrl: MapLibreStyles.demo,
mapStyleUrl: MapLibreStyles.openfreemapLiberty,
),
OfflineRegionDefinition(
bounds: santiagoBounds,
minZoom: 10.0,
maxZoom: 16.0,
mapStyleUrl: MapLibreStyles.demo,
mapStyleUrl: MapLibreStyles.openfreemapLiberty,
),
OfflineRegionDefinition(
bounds: aucklandBounds,
minZoom: 13.0,
maxZoom: 16.0,
mapStyleUrl: MapLibreStyles.demo,
mapStyleUrl: MapLibreStyles.openfreemapLiberty,
),
];

Expand Down