Skip to content

Commit

Permalink
fix: test example app (#95)
Browse files Browse the repository at this point in the history
- late AnnotationManager on web
- update circles example image
- add Wrap spacing
  • Loading branch information
josxha authored Oct 16, 2024
1 parent 66987fd commit 5d68c91
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ functionality.
<tr>
<td style="text-align: center;">
<strong>Add circles</strong>
<img src="https://raw.githubusercontent.com/josxha/flutter-maplibre/427311f8f4577c215bf73caf46e3769629e74e3b/docs/static/img/layers/circle_layer.jpg" alt="Circle Layer" />
<img src="https://raw.githubusercontent.com/josxha/flutter-maplibre/fe660b8d1c055d32e74cbc2ee0809281331a130b/docs/static/img/layers/circle_layer.jpg" alt="Circle Layer" />
</td>
<td style="text-align: center;">
<strong>Add 3D building outlines</strong>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
.buttons {
display: flex;
align-items: center;
justify-content: center;
justify-content: space-evenly;
}
5 changes: 5 additions & 0 deletions docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function HomepageHeader() {
to="/docs/getting-started/add-dependency">
Getting Started
</Link>
<Link
className="button button--secondary button--lg"
to="/demo">
Example App
</Link>
</div>
</div>
</header>
Expand Down
Binary file modified docs/static/img/layers/circle_layer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions example/lib/annotations_mixed_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class _AnnotationsMixedPageState extends State<AnnotationsMixedPage> {
padding: const EdgeInsets.all(8),
child: Wrap(
spacing: 8,
runSpacing: 2,
alignment: WrapAlignment.center,
children: [
OutlinedButton(
Expand Down
1 change: 1 addition & 0 deletions example/lib/controller_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class _ControllerPageState extends State<ControllerPage> {
padding: const EdgeInsets.all(8),
child: Wrap(
spacing: 8,
runSpacing: 2,
alignment: WrapAlignment.center,
children: [
OutlinedButton(
Expand Down
1 change: 1 addition & 0 deletions example/lib/gestures_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _GesturesPageState extends State<GesturesPage> {
padding: const EdgeInsets.all(8),
child: Wrap(
spacing: 8,
runSpacing: 2,
children: Gestures.values
.map(
(e) => ChoiceChip(
Expand Down
10 changes: 0 additions & 10 deletions example/lib/layers_circle_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ const _circleLayer = CircleLayer(
1,
1,
6,
4
],
16,
[
'interpolate',
['linear'],
['get', 'mag'],
1,
5,
6,
50
]
],
Expand Down
1 change: 1 addition & 0 deletions example/lib/two_maps_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class _ButtonsWidget extends StatelessWidget {
padding: const EdgeInsets.all(8),
child: Wrap(
spacing: 8,
runSpacing: 2,
children: [
OutlinedButton(
onPressed: () {
Expand Down
1 change: 1 addition & 0 deletions example/lib/user_location_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _UserLocationPageState extends State<UserLocationPage> {
padding: const EdgeInsets.all(8),
child: Wrap(
spacing: 8,
runSpacing: 2,
alignment: WrapAlignment.center,
children: [
OutlinedButton(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/web/widget_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class MapLibreMapStateWeb extends State<MapLibreMap>
late interop.JsMap _map;
Completer<interop.MapLibreEvent>? _movementCompleter;
bool _nextGestureCausedByController = false;
late AnnotationManager _annotationManager;
AnnotationManager? _annotationManager;

MapOptions get _options => widget.options;

Expand Down Expand Up @@ -229,7 +229,7 @@ final class MapLibreMapStateWeb extends State<MapLibreMap>
if (_options.gestures != oldWidget.options.gestures) {
_updateGestures(_options.gestures);
}
_annotationManager.updateLayers(widget.layers);
_annotationManager?.updateLayers(widget.layers);
super.didUpdateWidget(oldWidget);
}

Expand Down

0 comments on commit 5d68c91

Please sign in to comment.