This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +22
-13
lines changed
packages/google_maps_flutter/google_maps_flutter_web Expand file tree Collapse file tree 5 files changed +22
-13
lines changed Original file line number Diff line number Diff line change 1- ## NEXT
1+ ## 0.4.0+4
22
3+ * Allows marker position updates. Issue [ #83467 ] ( https://github.com/flutter/flutter/issues/83467 ) .
34* Updates code for ` no_leading_underscores_for_local_identifiers ` lint.
45
56## 0.4.0+3
Original file line number Diff line number Diff line change @@ -100,13 +100,16 @@ void main() {
100100 testWidgets ('update' , (WidgetTester tester) async {
101101 final MarkerController controller = MarkerController (marker: marker);
102102 final gmaps.MarkerOptions options = gmaps.MarkerOptions ()
103- ..draggable = true ;
103+ ..draggable = true
104+ ..position = gmaps.LatLng (42 , 54 );
104105
105106 expect (marker.draggable, isNull);
106107
107108 controller.update (options);
108109
109110 expect (marker.draggable, isTrue);
111+ expect (marker.position? .lat, equals (42 ));
112+ expect (marker.position? .lng, equals (54 ));
110113 });
111114
112115 testWidgets ('infoWindow null, showInfoWindow.' ,
Original file line number Diff line number Diff line change @@ -55,15 +55,22 @@ void main() {
5555 expect (
5656 controller.markers[const MarkerId ('1' )]? .marker? .draggable, isFalse);
5757
58- // Update the marker with radius 10
58+ // Update the marker with draggability and position
5959 final Set <Marker > updatedMarkers = < Marker > {
60- const Marker (markerId: MarkerId ('1' ), draggable: true ),
60+ const Marker (
61+ markerId: MarkerId ('1' ),
62+ draggable: true ,
63+ position: LatLng (42 , 54 ),
64+ ),
6165 };
6266 controller.changeMarkers (updatedMarkers);
6367
6468 expect (controller.markers.length, 1 );
65- expect (
66- controller.markers[const MarkerId ('1' )]? .marker? .draggable, isTrue);
69+ final gmaps.Marker ? marker =
70+ controller.markers[const MarkerId ('1' )]? .marker;
71+ expect (marker? .draggable, isTrue);
72+ expect (marker? .position? .lat, equals (42 ));
73+ expect (marker? .position? .lng, equals (54 ));
6774 });
6875
6976 testWidgets ('removeMarkers' , (WidgetTester tester) async {
Original file line number Diff line number Diff line change @@ -284,17 +284,15 @@ gmaps.Icon? _gmIconFromBitmapDescriptor(BitmapDescriptor bitmapDescriptor) {
284284
285285// Computes the options for a new [gmaps.Marker] from an incoming set of options
286286// [marker], and the existing marker registered with the map: [currentMarker].
287- // Preserves the position from the [currentMarker], if set.
288287gmaps.MarkerOptions _markerOptionsFromMarker (
289288 Marker marker,
290289 gmaps.Marker ? currentMarker,
291290) {
292291 return gmaps.MarkerOptions ()
293- ..position = currentMarker? .position ??
294- gmaps.LatLng (
295- marker.position.latitude,
296- marker.position.longitude,
297- )
292+ ..position = gmaps.LatLng (
293+ marker.position.latitude,
294+ marker.position.longitude,
295+ )
298296 ..title = sanitizeHtml (marker.infoWindow.title ?? '' )
299297 ..zIndex = marker.zIndex
300298 ..visible = marker.visible
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: google_maps_flutter_web
22description : Web platform implementation of google_maps_flutter
33repository : https://github.com/flutter/plugins/tree/main/packages/google_maps_flutter/google_maps_flutter_web
44issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
5- version : 0.4.0+3
5+ version : 0.4.0+4
66
77environment :
88 sdk : " >=2.12.0 <3.0.0"
You can’t perform that action at this time.
0 commit comments