Skip to content

dartnative_google_maps: polylines, polygons, circles and styled markers (icon, colour, title, zIndex) #119

Backlog

Description

@tayormi

Select your plan

Standard - priority support

Confirmations

  • I searched the existing feature requests and this is not a duplicate.

Framework or plugin?

Plugin

Platform

Both

Use case

dartnative_google_maps 1.0.0 (bundled with 1.10.0) can't draw a route or style a pin:

  • The native side accepts seven mutations: map type, camera, add/remove/clear marker and the two gesture flags (_MapsEventTag in lib/src/dartnative_google_maps.dart).
  • Marker has only id, latitude and longitude: no icon, colour, title/snippet, anchor or zIndex.
  • GoogleMaps has no polylines, polygons or circles parameters.

So a transit or delivery app can't show the route line, tell stop pins from vehicle pins, or label a pin. Markers also aren't in the accessibility tree, so VoiceOver users can't find them. We needed all of these, so we wrote our own MapKit plugin instead (about 3–4 days, iOS only).

Proposal

Follow google_maps_flutter's shapes, which the package already mirrors:

GoogleMaps(
  initialCameraPosition: const CameraPosition(latitude: 40.0, longitude: -100.0, zoom: 13),
  markers: [
    Marker(id: 's1', latitude: 40.0, longitude: -100.0,
        title: 'Main St', color: Color(0xFF8B7CFF), icon: MarkerIcon.asset('assets/stop.png'),
        zIndex: 1, semanticsLabel: 'Stop, Main St'),
  ],
  polylines: [
    Polyline(id: 'route', encodedPath: '_p~iF~ps|U_ulLnnqC_mqNvxq`@', // or points: [...]
        color: Color(0xFF36E7A6), width: 5),
  ],
  polygons: [...],
  circles: [...],
);

An encoded-path string keeps a long line to one FFI argument, and GMSPath(fromEncodedPath:) / PolyUtil.decode build it natively. Marker title could feed the accessibility label by default.

Activity

  1. tayormi commented on Nov 28, 2026

    @tayormi
    Author

    Related: the crash with no API key is reported separately as #116.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions