You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
react-native-maps provides a <Geojson> component that renders GeoJSON FeatureCollection data as native map overlays (points, lines, polygons) with styling and press handlers.
react-native-nitro-maps requires manually mapping each feature to <Marker>, <Polyline>, or <Polygon>. That does not scale when:
interfaceGeojsonProps{id?: string;/** GeoJSON object or FeatureCollection JSON string */geojson: GeoJSON.GeoJsonObject|string;strokeColor?: string;fillColor?: string;strokeWidth?: number;/** Default marker color for Point features */markerColor?: string;tappable?: boolean;zIndex?: number;onPress?: (feature: GeoJSON.Feature)=>void;}
Support geometry types:
GeoJSON type
Rendered as
Point / MultiPoint
Marker(s)
LineString / MultiLineString
Polyline(s)
Polygon / MultiPolygon
Polygon(s) (including holes from GeoJSON rings)
FeatureCollection
Recursive flatten
Feature
By inner geometry
GeometryCollection
Each sub-geometry
Scope
Add Geojson React component + OverlayType.Geojson for child collection.
Optional geojson / geojsonLayers bulk prop on MapView (evaluate one vs many layers).
Prefer converting GeoJSON to existing MarkerDescriptor / PolylineDescriptor / PolygonDescriptor arrays in JS rather than adding native GeoJSON parsers on both platforms — keeps one source of truth and reuses overlay diffing.
For large datasets (1000+ features), consider internal simplification or warning. Bulk polygons prop may outperform child components.
Notes
Polygon holes in GeoJSON use interior rings — align with polygon holes support if tracked separately. GeoJSON is vector data (interactive shapes); distinct from raster tile overlays (#17).
Context
react-native-mapsprovides a<Geojson>component that renders GeoJSONFeatureCollectiondata as native map overlays (points, lines, polygons) with styling and press handlers.react-native-nitro-mapsrequires manually mapping each feature to<Marker>,<Polyline>, or<Polygon>. That does not scale when:propertiesused for styling andonPresspayloadsGeoJSON is a common format in logistics, GIS, and analytics apps. Missing GeoJSON is a visible gap in the migration compatibility matrix (#13).
Reference: GeoJSON spec · react-native-maps Geojson
Goal
Render GeoJSON on the map with a single component:
Or bulk prop:
Proposed API
Support geometry types:
Point/MultiPointLineString/MultiLineStringPolygon/MultiPolygonFeatureCollectionFeatureGeometryCollectionScope
GeojsonReact component +OverlayType.Geojsonfor child collection.geojson/geojsonLayersbulk prop onMapView(evaluate one vs many layers).strokeColor,fillColor)properties(document convention, e.g.properties.strokeColor)onPressreturns the tappedFeaturewithproperties..geojsonfile.Out of scope
Feature3D coordinates (Z ignored).Acceptance criteria
FeatureCollectionwith Polygon features renders filled regions on iOS and Android.LineStringfeatures render as polylines.Pointfeatures render as markers.onPressreturns correct featurepropertieswhen tappable..geojsonexample works in example app.Implementation notes
Suggested JS module:
Prefer converting GeoJSON to existing
MarkerDescriptor/PolylineDescriptor/PolygonDescriptorarrays in JS rather than adding native GeoJSON parsers on both platforms — keeps one source of truth and reuses overlay diffing.For large datasets (1000+ features), consider internal simplification or warning. Bulk
polygonsprop may outperform child components.Notes
Polygon holes in GeoJSON use interior rings — align with polygon holes support if tracked separately. GeoJSON is vector data (interactive shapes); distinct from raster tile overlays (#17).