flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
164.86k stars 27.16k forks source link

[Google Maps - Web] Maps does not act as being in mode: gestureHandling: "cooperative" #95774

Open sperochon opened 2 years ago

sperochon commented 2 years ago

Steps to Reproduce

  1. Execute flutter run -d chrome on the code sample (here)
  2. Scroll down/up with the wheel of the mouse to go hover the Google Maps Widget
  3. The Google Maps Widget uses the scroll events to zoom in/out (= like it is in mode: gestureHandling: "greedy" (greedy doc)
  4. Resize the browser window
  5. Scroll down/up with the wheel of the mouse to go hover the Google Maps Widget
  6. The Google Maps Widget now acts as being in mode: gestureHandling: "cooperative" (cooperative doc)

Expected results: The Google Maps Widget should directly act as being in mode: gestureHandling: "cooperative"

Actual results: The Google Maps Widget acts as being in mode: gestureHandling: "greedy"

https://user-images.githubusercontent.com/1877340/147347930-ad2cb421-b8e1-4f2d-a343-df570ae8753b.mov

Logs ``` flutter run --verbose -d chrome [ +145 ms] executing: sysctl hw.optional.arm64 [ +35 ms] Exit code 0 from: sysctl hw.optional.arm64 [ +3 ms] hw.optional.arm64: 1 [ +10 ms] executing: [/Users/seb/dev/sdk/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ +30 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] cf4400006550b70f28e4b4af815151d1e74846c6 [ +1 ms] executing: [/Users/seb/dev/sdk/flutter/] git tag --points-at cf4400006550b70f28e4b4af815151d1e74846c6 [ +48 ms] Exit code 0 from: git tag --points-at cf4400006550b70f28e4b4af815151d1e74846c6 [ ] 2.8.0 [ +13 ms] executing: [/Users/seb/dev/sdk/flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ +20 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] origin/stable [ ] executing: [/Users/seb/dev/sdk/flutter/] git ls-remote --get-url origin [ +19 ms] Exit code 0 from: git ls-remote --get-url origin [ ] https://github.com/flutter/flutter.git [ +140 ms] executing: [/Users/seb/dev/sdk/flutter/] git rev-parse --abbrev-ref HEAD [ +25 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] stable [ +9 ms] executing: sw_vers -productName [ +19 ms] Exit code 0 from: sw_vers -productName [ ] macOS [ ] executing: sw_vers -productVersion [ +22 ms] Exit code 0 from: sw_vers -productVersion [ ] 12.0.1 [ ] executing: sw_vers -buildVersion [ +18 ms] Exit code 0 from: sw_vers -buildVersion [ ] 21A559 [ +65 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +62 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +38 ms] executing: sysctl hw.optional.arm64 [ +11 ms] Exit code 0 from: sysctl hw.optional.arm64 [ ] hw.optional.arm64: 1 [ ] executing: /usr/bin/arch -arm64e xcrun xcodebuild -version [ +97 ms] Exit code 0 from: /usr/bin/arch -arm64e xcrun xcodebuild -version [ ] Xcode 13.1 Build version 13A1030d [ +96 ms] Skipping pub get: version match. [ +32 ms] Found plugin flutter_plugin_android_lifecycle at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.5/ [ +9 ms] Found plugin google_maps_flutter at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.1.1/ [ +5 ms] Found plugin google_maps_flutter_web at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter_web-0.3.2/ [ +108 ms] Found plugin flutter_plugin_android_lifecycle at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.5/ [ +2 ms] Found plugin google_maps_flutter at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.1.1/ [ +1 ms] Found plugin google_maps_flutter_web at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter_web-0.3.2/ [ +18 ms] Generating /Users/seb/dev/bug/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java [ +249 ms] Launching lib/main.dart on Chrome in debug mode... [ +187 ms] Updating assets [ +92 ms] Waiting for connection from debug service on Chrome... [ +9 ms] Found plugin flutter_plugin_android_lifecycle at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.5/ [ +2 ms] Found plugin google_maps_flutter at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.1.1/ [ +1 ms] Found plugin google_maps_flutter_web at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter_web-0.3.2/ [ +10 ms] Found plugin flutter_plugin_android_lifecycle at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.5/ [ +1 ms] Found plugin google_maps_flutter at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.1.1/ [ +1 ms] Found plugin google_maps_flutter_web at /Users/seb/dev/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter_web-0.3.2/ [ +45 ms] <- reset [ +8 ms] /Users/seb/dev/sdk/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /Users/seb/dev/sdk/flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot --sdk-root /Users/seb/dev/sdk/flutter/bin/cache/flutter_web_sdk/ --incremental --target=dartdevc --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill /var/folders/5d/w8_lchx95zv51vmj40cwqp_40000gn/T/flutter_tools.PLxVQv/flutter_tool.uKVjGn/app.dill --libraries-spec file:///Users/seb/dev/sdk/flutter/bin/cache/flutter_web_sdk/libraries.json --packages /Users/seb/dev/bug/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-root /var/folders/5d/w8_lchx95zv51vmj40cwqp_40000gn/T/flutter_tools.PLxVQv/flutter_tools.qZewil --filesystem-scheme org-dartlang-app --initialize-from-dill build/b1b715402d823b7fd5c2b68d2edcb2ce.cache.dill.track.dill --platform file:///Users/seb/dev/sdk/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill --sound-null-safety [ +25 ms] <- compile org-dartlang-app:/web_entrypoint.dart [+14117 ms] Waiting for connection from debug service on Chrome... (completed in 14,2s) [ +5 ms] Synced 30.9MB. [ ] <- accept [ ] Caching compiled dill [ +71 ms] Using Google Chrome 96.0.4664.110 [ +76 ms] executing: sysctl hw.optional.arm64 [ +14 ms] Exit code 0 from: sysctl hw.optional.arm64 [ ] hw.optional.arm64: 1 [ +18 ms] Found ARM Chrome installation at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome, forcing native launch. [ +257 ms] [CHROME]: [ +1 ms] [CHROME]:DevTools listening on ws://127.0.0.1:62712/devtools/browser/37944184-e7f0-470f-ac78-072c76d9f45e [ +576 ms] DwdsInjector: Received request for entrypoint at http://localhost:62631/main_module.bootstrap.js [ +7 ms] MetadataProvider: Loading debug metadata... [ +15 ms] MetadataProvider: Loaded debug metadata (sound null safety) [ +9 ms] DwdsInjector: Injected debugging metadata for entrypoint at http://localhost:62631/main_module.bootstrap.js [+1518 ms] ChromeProxyService: Initializing expression compiler for main_module.bootstrap.js with sound null safety: true [ +94 ms] DevHandler: Debug service listening on ws://127.0.0.1:62749/x-HEok_3fOg=/ws [ +28 ms] This app is linked to the debug service: ws://127.0.0.1:62749/x-HEok_3fOg=/ws [ +10 ms] Debug service listening on ws://127.0.0.1:62749/x-HEok_3fOg=/ws [ ] 💪 Running with sound null safety 💪 [ +7 ms] 🔥 To hot restart changes while running, press "r" or "R". [ ] For a more detailed help message, press "h". To quit, press "q". [ +1 ms] An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:62749/x-HEok_3fOg= [+1052 ms] The Flutter DevTools debugger and profiler on Chrome is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:62749/x-HEok_3fOg= ``` ``` flutter analyze Analyzing bug... No issues found! (ran in 2.1s) ``` ``` flutter doctor -v [✓] Flutter (Channel stable, 2.8.0, on macOS 12.0.1 21A559 darwin-arm, locale fr-FR) • Flutter version 2.8.0 at /Users/seb/dev/sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision cf44000065 (2 weeks ago), 2021-12-08 14:06:50 -0800 • Engine revision 40a99c5951 • Dart version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/seb/dev/sdk/android • Platform android-31, build-tools 31.0.0 • ANDROID_SDK_ROOT = /Users/seb/dev/sdk/android/ • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2020.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189) [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (2 available) • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64 • Android 11 (API 30) (emulator) • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110 • No issues found! ```
darshankawar commented 2 years ago

@sperochon I think the the gesture handling modes may not be yet supported by the plugin on web, see this open issue to request enabling gesture handling for same, https://github.com/flutter/flutter/issues/80322. I see that you've already commented in it too, so it'll be good to follow-up in it for further updates and reference. Closing this as duplicate. If you disagree, write in comments and I'll reopen it.

sperochon commented 2 years ago

@darshankawar Thanks for your reply but I disagree ;-) I made a wrong statement in the other issue (and just reply in it). So please reopen this one. As you can see in my video, without changing anything except resizing the browser window, the behavior of Google Maps is changing.

darshankawar commented 2 years ago

@sperochon Thanks for the update. Is there a way to know the gesture handling mode, ie when is it greedy and cooperative ?

sperochon commented 2 years ago

@darshankawar It is greedy when you can zoom in/out with scroll mouse and cooperative when you can't and a message is displayed "Use ⌘+scroll to zoom the map"

In fact, at this stage, this issue should just be renamed to "Behavior of Google Maps is changing after resizing the browser window" and all reference to greedy/cooperative mode should be removed. It is part of issue debugging.

darshankawar commented 2 years ago

Thanks for the update. I do see the message displaying Use ⌘+scroll to zoom the map" when trying to zoom in/out with scroll mouse. Keeping it open for further input from the team.

stable, master flutter doctor -v ``` [[✓] Flutter (Channel stable, 2.8.1, on Mac OS X 10.15.4 19E2269 darwin-x64, locale en-GB) • Flutter version 2.8.1 at /Users/dhs/documents/fluttersdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 77d935af4d (13 hours ago), 2021-12-16 08:37:33 -0800 • Engine revision 890a5fca2e • Dart version 2.15.1 [✓] Android toolchain - develop for Android devices (Android SDK version 30) • Android SDK at /Users/dhs/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /Users/dhs/Library/Android/sdk • Java binary at: /Users/dhs/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Users/dhs/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.57.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (4 available) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82 • No issues found! [✓] Flutter (Channel master, 2.9.0-1.0.pre.209, on Mac OS X 10.15.4 19E2269 darwin-x64, locale en-GB) • Flutter version 2.9.0-1.0.pre.209 at /Users/dhs/documents/fluttersdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 6054eda86b (2 hours ago), 2021-12-28 18:19:16 -0800 • Engine revision 01d19ceef4 • Dart version 2.16.0 (build 2.16.0-134.0.dev) • DevTools version 2.9.2 [✓] Android toolchain - develop for Android devices (Android SDK version 30) • Android SDK at /Users/dhs/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /Users/dhs/Library/Android/sdk • Java binary at: /Users/dhs/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.5.1, Build version 12E507 • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Users/dhs/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.57.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [[✓] Connected device (4 available) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82 • No issues found! ```
gopibathini commented 1 year ago

@darshankawar how to respond to google map on hovering mouse events to get latitude and longitude placing every part of map