Skip to content

Document that POI events carry an identifier only on the Google provider #138

Description

@jkasprzyk17

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

Activity

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

    documentationImprovements or additions to documentationgood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions