googlemaps / googlemaps/flutter-navigation-sdk
[Feature]: Allow the location indicator (chevron) to be replaced with a custom image
- Dominant language
- Dart
- Stars
- 75
- Forks
- 54
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 5
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Use case
Delivery and rideshare apps carry their own visual identity onto the map. The
destination markers can already be branded — `MarkerOptions.icon` takes a
registered bitmap — but the one symbol a driver looks at most, their own
position, cannot.
Today the location indicator during guidance is drawn entirely by the native
SDK, and neither this plugin nor the native Navigation SDK exposes a way to
replace it.
### What is missing
There is no API for the location indicator itself. Searching the Navigation SDK
documentation for the chevron finds only a note about where it sits relative to
a custom footer, not what it looks like:
> The default position of the chevron does not change when a custom footer is
> present since the footer does not extend to the end side of the map.
`setMyLocationEnabled` is on or off, and that is the whole surface.
### Why this cannot be solved in this repository
This plugin is open source, but the SDK it wraps is not:
```swift
// googlemaps/ios-navigation-sdk — Package.swift
.binaryTarget(
name: "GoogleNavigation",
url: "https://dl.google.com/geosdk/swiftpm/11.1.0/GoogleNavigation_3p.xcframework.zip",
...
)
```
Android is the same — `com.google.android.libraries.navigation:navigation:7.8.0`
is a Maven artifact. A pull request here can only surface what the binary
already offers, and this is not offered. So this is a request to route upstream
rather than a request for a change in this repository.
### What we would need
Either of these would be enough:
1. A bitmap for the location indicator, in the shape markers already take —
`registerBitmapImage()` plus rotation, anchor and a flat flag.
2. Or, closer to what the SDK draws itself, a 3D model. Mapbox does this through
its style specification, where a model is a first-class map primitive
(`LocationPuck3D` with a glTF asset). Google already ships glTF support in
the Maps 3D SDK, though that renderer has no turn-by-turn navigation, so the
two cannot be combined today.
The first would already cover most branding needs.
### Workaround, and its limits
An app can hide the SDK indicator and draw its own marker with `flat: true` and
`rotation`, moved by road-snapped location updates. Two things make that a poor
substitute:
- Heading is not currently reported with those updates (#760, PR #761).
- The SDK animates its own indicator between fixes natively; a marker moved from
Dart jumps at the update rate unless the app interpolates itself.
### Package version
0.11.0
Contributor guide
Assessment
This issue has not been assessed yet.