[Feature request]: Support custom marker icons (bitmap/URI) via icon field in MarkerOptions
Maintainer antworten meist innerhalb von 5 Tagen
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Is there an existing issue for this?
- I have searched the existing issues
Use case
addMarker() via MapViewController only renders the default Google Maps pin regardless of what MarkerOptions is passed. There is no way to supply a custom image as the marker icon through the JS layer.
This is a blocking limitation for any app that needs to differentiate markers visually — the most common real-world case being live location sharing, where each member's marker should display their profile photo rather than an indistinguishable default pin.
Concrete scenario: In a group coordination app where 8 users share live location on the same NavigationView, all 8 markers render as identical red pins. There is no way to tell who is who without tapping each one individually. A custom avatar icon per member solves this entirely.
Alternatives considered:
Rendering an RN View as an overlay — Possible for static UI, but overlays are not anchored to map coordinates and don't move correctly with map pan/zoom/tilt. Not a real substitute for a native map marker.
react-native-maps — Supports custom marker icons but is a completely separate library. It cannot be used alongside @googlemaps/react-native-navigation-sdk on the same map surface, as both require owning the map view.
No existing package solves this within the Navigation SDK's MapViewController surface.
The underlying native SDKs fully support this — BitmapDescriptorFactory.fromBitmap() on Android and GMSMarker.icon on iOS. The gap is only in the React Native wrapper not exposing it.
Proposal
Add an optional icon field to MarkerOptions that accept a URI string pointing to a local asset or remote image, passed through the JS-to-native bridge and applied as the marker's bitmap icon on both Android and iOS.
Proposed TypeScript change:
export interface MarkerOptions {
position: LatLng;
title?: string;
snippet?: string;
isVisible?: boolean;
isFlat?: boolean;
isDraggable?: boolean;
rotation?: number;
alpha?: number;
icon?: { uri: string }; // ← proposed addition
}
Expected usage:
mapViewController.addMarker({
position: { lat: 17.385, lng: 78.4867 },
title: 'Sannihith',
icon: { uri: 'https://example.com/avatar.jpg' },
});
Android (Kotlin) — intended implementation path:
kotlinval iconUri = markerOptionsMap.getString("icon_uri")
val markerOptions = MarkerOptions()
.position(LatLng(lat, lng))
if (iconUri != null) {
val bitmap = BitmapFactory.decodeStream(
URL(iconUri).openConnection().getInputStream()
)
markerOptions.icon(BitmapDescriptorFactory.fromBitmap(bitmap))
}
iOS (Swift) — intended implementation path:
swiftif let iconUri = options["icon_uri"] as? String,
let url = URL(string: iconUri),
let data = try? Data(contentsOf: url),
let image = UIImage(data: data) {
marker.icon = image
}
I am willing to implement the Android side and submit a PR. Happy to align on the preferred API shape before starting if maintainers have a different approach in mind.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 226
- Forks
- 39
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus googlemaps/react-native-navigation-sdk
-
[Support Request]: Status of Expo config plugin release (prebuild fails on 0.19.0)Evtl. vergeben @jokerttu hat das vor 2 Tagen übernommen. Offen
googlemaps/react-native-navigation-sdk#711 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 5 Tagen
-
[Bug]: In-navigation notification can't be stoppedEvtl. vergeben @jokerttu hat das vor 8 Tagen übernommen. Offentriage me type: bug
googlemaps/react-native-navigation-sdk#696 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 5 Tagen
-
[Bug]: [iOS] Navigation SDK init/quota retry loop pins the main thread; React Native's Settings module and addMarker's temporary GMSMarker add to the costEvtl. vergeben @illuminati1911 hat das vor 15 Tagen übernommen. Offentriage me type: bug
googlemaps/react-native-navigation-sdk#687 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 5 Tagen
-
[Bug]: iOS crash in GMSObjectDataCache Core Data save (fatal optimistic locking failure)Evtl. wieder frei @illuminati1911 hat das vor 61 Tagen übernommen, und es ist kein Pull Request offen. Offennative sdk issue
googlemaps/react-native-navigation-sdk#647 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 5 Tagen
-
[Bug]: CarPlay map view never sets GMSMapViewOptions.screen, so the navigation header and footer are sized for the phoneEvtl. wieder frei @jokerttu hat das vor 74 Tagen übernommen, und es ist kein Pull Request offen. Offen
googlemaps/react-native-navigation-sdk#640 · 4 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 5 Tagen
Alle Issues in googlemaps/react-native-navigation-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
home-assistant/frontend#55841 ·
Maintainer antworten meist innerhalb von 1 Tag
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
lingdojo/kana-dojo#33905 · 1 Kommentar · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug(semester-planning): the edit application dialog cannot save with an empty «Annet fra bedriften»Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
blocklist removal
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
MetaMask/eth-phishing-detect#311215 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Explore filter: multi-select value list with allowNewOptions stops accepting values and drops earlier onesEvtl. vergeben @isaac-jaynes-imperva hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/superset#46146 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen