Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[google_maps_flutter_web] Fix InfoWindows and getLatLng. #3163

Merged
merged 5 commits into from
Oct 22, 2020

Conversation

ditman
Copy link
Member

@ditman ditman commented Oct 16, 2020

Description

This PR addresses:

  • InfoWindows don't render their 'snippet' when loaded as Initial Geometry (passed to the GoogleMap Widget directly)
  • InfoWindows don't propagate click events (turns out, the JS SDK doesn't offer that event, so we need to fake it)
  • GoogleMapController.getLatLng() returns a bogus LatLng (turns out, we weren't using the right formula in that method!).

In order to synthesize the click event on the InfoWindow contents, this PR migrates the InfoWindow contents from being an HTML string to being something generated with dart:html. I had to update a previous test slightly to account for this difference.

Related Issues

Fixes flutter/flutter#67854
Fixes flutter/flutter#67289
Fixes flutter/flutter#67606

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@ditman ditman requested a review from cyanglaz as a code owner October 16, 2020 18:17
@google-cla google-cla bot added the cla: yes label Oct 16, 2020
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % nits

@ditman ditman merged commit b96da45 into flutter:master Oct 22, 2020
@ditman ditman deleted the maps-snippets-and-colors branch October 22, 2020 23:03
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
* Update package:google_maps to ^3.4.5.
* Fix GoogleMapController.getLatLng(): flutter/flutter#67606
* Make InfoWindow contents clickable so onTap works as advertised: flutter/flutter#67289
* Fix InfoWindow snippets when converting initial markers: flutter/flutter#67854
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants