Skip to content

Map on React Native #1

Open
Open

Description

@anonymze

Hello guys,

I will try to implement this map on React Native, do you think this will work out of the box ? Do you have any advices to do it correctly ?

Activity

  1. sandeshveerani4 commented on Apr 17, 2026

    @sandeshveerani4
    Collaborator

    Sorry for the late reply @anonymze . That's a great idea and would be a very welcome contribution! The SDK is structured as a monorepo with separate packages (core, react), so a react-native package would fit in naturally alongside them.

    Here's a breakdown of what that package would need to do:

    What you get for free from @mapfirst.ai/core:

    • All API calls (runPropertiesSearch, smartFilterSearch, pollForPricing, etc.)
    • State management and callbacks
    • The clustering algorithm (clusterMarkers) — it's pure JS, no DOM dependencies

    What you'd need to implement:

    1. A MapAdapter: this is the main integration point. You'd implement the MapAdapter interface (from packages/core/src/adapters/index.ts) wrapping a React Native map library like @rnmapbox/maps or react-native-maps. The key method the clustering system needs is map.project() (lat/lng → screen pixels) — most RN map libraries expose something equivalent.

    2. A marker manager: instead of DOM elements, you'd render markers as React Native components driven by the ClusterDisplayItem[] output from the clustering system.

    3. A useMapFirstNative hook: (similar to useMapFirst in the React package) — wiring MapFirstCore to React state, largely copy-pasteable from packages/react/src/index.tsx.

    4. Geolocation: navigator.geolocation works in RN but the Permissions API (navigator.permissions) used internally doesn't. You'd want to replace that with react-native-permissions or the Expo equivalent.

    If you're planning to contribute, feel free to open an issue or draft PR so we can align on the API surface before you dive deep. Happy to help guide the implementation!

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