Skip to content

[google_maps_flutter_web] Markers anchor and rotation have no effect #80578

Open

Description

@Konstantins-andronovs

Building Marker with custom anchor offset does not change default, bottom based anchor.
Rotation have no effect on built Marker.

Activity

  1. darshankawar commented on Apr 16, 2021

    @darshankawar
    Member

    @Konstantins-andronovs
    Can you provide flutter doctor -v and a complete minimal reproducible code sample that we can use to replicate locally ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 16, 2021
  3. Konstantins-andronovs commented on Apr 16, 2021

    @Konstantins-andronovs
    Author

    main.dart

    import 'dart:async';
    
    import 'package:flutter/material.dart';
    import 'package:google_maps_flutter/google_maps_flutter.dart';
    
    void main() {
      runApp(MyApp());
    }
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(
      
            primarySwatch: Colors.blue,
          ),
          home: MyHomePage(title: 'Flutter Demo Home Page'),
        );
      }
    }
    
    class MyHomePage extends StatefulWidget {
      MyHomePage({Key key, this.title}) : super(key: key);
      final String title;
      @override
      _MyHomePageState createState() => _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      final CameraPosition _initialPosition = CameraPosition(
        target: LatLng(56.946285, 24.105078),
        zoom: 15,
      );
    
      final List<Marker> _markers = [];
      Completer<GoogleMapController> _mapController = Completer();
    
      MapType _currentMapType = MapType.normal;
    
      void _onMapCreated(GoogleMapController controller) {
        _loadAllMarkers();
        _mapController.complete(controller);
      }
    
      void _loadAllMarkers() {
        setState(() {
          _markers.add(Marker(
            markerId: MarkerId('marker1'),
            position: LatLng(56.94814589702577, 24.153787161095153),
            icon: BitmapDescriptor.defaultMarker,
            anchor: const Offset(1.0, 1.0),
          ));
        });
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            title: Text(widget.title),
          ),
          body: GoogleMap(
            mapType: _currentMapType,
            initialCameraPosition: _initialPosition,
            onMapCreated: _onMapCreated,
            markers: _markers.toSet(),
            minMaxZoomPreference: MinMaxZoomPreference(10, 20),
          ),
        );
      }
    }
    

    pubspec.yaml

    dependencies:
      flutter:
        sdk: flutter
      google_maps_flutter: 2.0.3
      google_maps_flutter_web: 0.3.0
      google_maps_webservice: 0.0.20-nullsafety.3
    
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^1.0.2
    

    flutter doctor -v

    [✓] Flutter (Channel stable, 2.0.4, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
        • Flutter version 2.0.4 at /Users/user1/Documents/flutter
        • Framework revision b1395592de (2 weeks ago), 2021-04-01 14:25:01 -0700
        • Engine revision 2dce47073a
        • Dart version 2.12.2
    
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/user1/Library/Android/sdk
        • Platform android-30, build-tools 30.0.3
        • ANDROID_HOME = /Users/user1/Library/Android/sdk
        • Java binary at: /Users/user1/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
        ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
    
    [!] Xcode - develop for iOS and macOS
        ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
          Download at: https://developer.apple.com/xcode/download/
          Or install Xcode via the App Store.
          Once installed, run:
            sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
            sudo xcodebuild -runFirstLaunch
        • 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/user1/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/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)
    
    [✓] Connected device (2 available)
        • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
        • Chrome (web)                • chrome        • web-javascript • Google Chrome 89.0.4389.128
    
    ! Doctor found issues in 2 categories.
    

    index.html

    <!DOCTYPE html>
    <html>
    <head>
      <base href="/">
      <meta charset="UTF-8">
      <meta content="IE=Edge" http-equiv="X-UA-Compatible">
      <meta name="description" content="A new Flutter project.">
      <meta name="apple-mobile-web-app-capable" content="yes">
      <meta name="apple-mobile-web-app-status-bar-style" content="black">
      <meta name="apple-mobile-web-app-title" content="mapsample">
      <link rel="apple-touch-icon" href="icons/Icon-192.png">
      <link rel="icon" type="image/png" href="favicon.png"/>
      <title>mapsample</title>
      <link rel="manifest" href="manifest.json">
    </head>
    <body>
    
      <script>
        if ('serviceWorker' in navigator) {
          window.addEventListener('flutter-first-frame', function () {
            navigator.serviceWorker.register('flutter_service_worker.js');
          });
        }
      </script>
        <script src="main.dart.js" type="application/javascript"></script>
        <script src="https://maps.googleapis.com/maps/api/js?key=secret"></script>
    </body>
    </html>
    
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 16, 2021
  5. darshankawar commented on Apr 19, 2021

    @darshankawar
    Member

    @Konstantins-andronovs
    Thanks for the code sample. What are the steps to replicate the issue ?

  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 19, 2021
  7. Konstantins-andronovs commented on Apr 19, 2021

    @Konstantins-andronovs
    Author

    Changing anchor property anchor: const Offset(1.0, 1.0), has no effect.

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 19, 2021
  9. darshankawar commented on Apr 19, 2021

    @darshankawar
    Member

    I see the same behavior.

    flutter doctor -v
    [✓] Flutter (Channel stable, 2.0.5, on Mac OS X 10.15.4 19E2269 darwin-x64,
        locale en-GB)
        • Flutter version 2.0.5 at /Users/dhs/documents/fluttersdk/flutter
        • Framework revision adc687823a (3 days ago), 2021-04-16 09:40:20 -0700
        • Engine revision b09f014e96
        • Dart version 2.12.3
    
    [!] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.3, Build version 12C33
        ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin
            code that responds to your plugin usage on the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To upgrade see
          https://guides.cocoapods.org/using/getting-started.html#installation for
          instructions.
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
        
    [✓] Android Studio (version 4.1)
        • 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
          1.8.0_242-release-1644-b3-6915495)    
    
    [✓] VS Code (version 1.55.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.20.0
    
    [✓] Connected device (3 available)
    	  • SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 10 (API 29)
        • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
          • iOS 14.4.1
        • macOS (desktop)           • macos                                    •
          darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
        • Chrome (web)              • chrome                                   •
          web-javascript • Google Chrome 89.0.4389.114
    
    ! Doctor found issues in 1 category.
    
    
  10. 47 remaining items

  11. raphael-bmec-co commented on Mar 14, 2026

    @raphael-bmec-co
  12. raphael-bmec-co commented on Mar 16, 2026

    @raphael-bmec-co

    @stuartmorgan-g (I hope you are the correct person to ask?), I see the post from myself and @robcleghorn have been hidden as off-topic. I appreciate a degree of sarcasm in mine (apologies). That said, this is a critical discussion point. This has been open for 5 years.

    This core functionality - at the end of the day we just need to know if we should stick around or port over to another map supplier? 5 Years of forks and manual fixes is really pushing the limit.

    Maybe just some clarification is needed as I see there is a merged pull targeting this?

  13. Henk-Keijzer commented on Mar 16, 2026

    @Henk-Keijzer
  14. derekchandler6521-stack commented on Mar 16, 2026

    @derekchandler6521-stack
  15. stuartmorgan-g commented on Mar 16, 2026

    @stuartmorgan-g
    Contributor

    I see the post from myself and @robcleghorn have been hidden as off-topic.

    See https://github.com/flutter/flutter/blob/master/docs/contributing/issue_hygiene/README.md#comments for our policies. Comments that are not actively helpful are routinely marked as off-topic.

    That said, this is a critical discussion point.

    https://flutter.dev/community#community-grid has some options if you are looking for a discussion forum.

  16. raphael-bmec-co commented on Mar 16, 2026

    @raphael-bmec-co
  17. stuartmorgan-g commented on Mar 16, 2026

    @stuartmorgan-g
  18. raphael-bmec-co commented on Mar 16, 2026

    @raphael-bmec-co
  19. stuartmorgan-g commented on Mar 16, 2026

    @stuartmorgan-g
    Contributor

    Frustrating for us to manage our clients on that basis

    Anyone who wants to be able to provide clients a concrete timeline for this feature is certainly welcome to contribute an implementation.

  20. raphael-bmec-co commented on Mar 16, 2026

    @raphael-bmec-co
  21. stuartmorgan-g commented on Mar 17, 2026

    @stuartmorgan-g
  22. robcleghorn commented on Mar 23, 2026

    @robcleghorn

    Hi,

    I moved away from the flutter Google maps package. Using the
    flutter_maps package with very good results! See for example
    tt.zeilvaartwarmond.nl
    …

    Awesome call, very happy here now too, thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: mapsGoogle Maps pluginpackageflutter/packages repository. See also p: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions