Problem
onPoiPress gives a placeId on the Google provider and nothing identifying on Apple.
AppleMapProviderAdapter.notifyPoiPress sets placeId: nil
(package/ios/AppleMapProviderAdapter.swift:360-372), because MKMapFeatureAnnotation
exposes no stable public identifier.
Since the default provider is apple on iOS and google on Android
(package/src/providers.ts:4-20), the same <MapView onPoiPress={...} /> gives:
Platform (no provider prop) |
Payload |
| iOS |
{ provider: 'apple', coordinate, name?, category, rawCategory? } |
| Android |
{ provider: 'google', coordinate, name, placeId } |
The types are honest about this — PoiPressEvent is a discriminated union keyed on
provider (package/src/types/map.ts:24-39), so TypeScript forces narrowing before
placeId can be read, and the README documents the three payload shapes
(README.md:307-311).
What is missing is the consequence, which is what anyone building "tap a POI → look it up"
hits: on Apple there is no identifier to look anything up with, and the fix is to opt into
provider="google" on iOS.
Proposal
Add to the POI section of the README:
- Apple POI events carry no identifier. Correlate by
coordinate + name, or use
provider="google" on iOS if a Place ID is needed on both platforms.
placeId is a Google Place ID, usable with the Google Places API.
- A note that the default provider differs per platform, so code written against
placeId
needs an explicit provider="google".
The same note belongs on the ApplePoiPressEvent / GooglePoiPressEvent JSDoc in
package/src/types/map.ts:24-39, since that is what shows up in editor tooltips.
Notes
This came out of checking a claim that placeId itself differs between platforms for the
same POI. It does not, as far as the source goes: both platforms forward the Google Maps
SDK's place ID verbatim, with no parsing or normalisation — iOS
package/ios/GoogleMapProviderAdapter.swift:530-546, Android
GoogleMapProviderAdapter.kt:445-456, and straight through JS at
package/src/components/MapView.tsx:206-213. If the two SDKs ever disagreed for one
feature, that would be a Google-side discrepancy and there would be nothing here to change.
Related
Problem
onPoiPressgives aplaceIdon the Google provider and nothing identifying on Apple.AppleMapProviderAdapter.notifyPoiPresssetsplaceId: nil(
package/ios/AppleMapProviderAdapter.swift:360-372), becauseMKMapFeatureAnnotationexposes no stable public identifier.
Since the default provider is
appleon iOS andgoogleon Android(
package/src/providers.ts:4-20), the same<MapView onPoiPress={...} />gives:providerprop){ provider: 'apple', coordinate, name?, category, rawCategory? }{ provider: 'google', coordinate, name, placeId }The types are honest about this —
PoiPressEventis a discriminated union keyed onprovider(package/src/types/map.ts:24-39), so TypeScript forces narrowing beforeplaceIdcan be read, and the README documents the three payload shapes(
README.md:307-311).What is missing is the consequence, which is what anyone building "tap a POI → look it up"
hits: on Apple there is no identifier to look anything up with, and the fix is to opt into
provider="google"on iOS.Proposal
Add to the POI section of the README:
coordinate+name, or useprovider="google"on iOS if a Place ID is needed on both platforms.placeIdis a Google Place ID, usable with the Google Places API.placeIdneeds an explicit
provider="google".The same note belongs on the
ApplePoiPressEvent/GooglePoiPressEventJSDoc inpackage/src/types/map.ts:24-39, since that is what shows up in editor tooltips.Notes
This came out of checking a claim that
placeIditself differs between platforms for thesame POI. It does not, as far as the source goes: both platforms forward the Google Maps
SDK's place ID verbatim, with no parsing or normalisation — iOS
package/ios/GoogleMapProviderAdapter.swift:530-546, AndroidGoogleMapProviderAdapter.kt:445-456, and straight through JS atpackage/src/components/MapView.tsx:206-213. If the two SDKs ever disagreed for onefeature, that would be a Google-side discrepancy and there would be nothing here to change.
Related
Apple POI without having an identifier for it.