Skip to content

Added GeoJSON support by default#2959

Merged
christopherdro merged 6 commits intoreact-native-maps:masterfrom
Peretz30:master
Aug 7, 2019
Merged

Added GeoJSON support by default#2959
christopherdro merged 6 commits intoreact-native-maps:masterfrom
Peretz30:master

Conversation

@Peretz30
Copy link
Copy Markdown
Contributor

Does any other open PR do the same thing?

No

What issue is this PR fixing?

None

How did you test this PR?

Tested on Android Real Device

I think that the less dependencies the better and GeoJSON support should be by default in this package.

import React from 'react';
import MapView, {Geojson} from 'react-native-maps';

const alcatraz = {
  type: 'FeatureCollection',
  features: [
    {
      type: 'Feature',
      properties: {},
      geometry: {
        type: 'Point',
        coordinates: [-122.42305755615234, 37.82687023785448],
      }
    }
  ]
};

const Map = props => (
  <MapView>
    <Geojson geojson={alcatraz} />
  </MapView>
);

@rborn
Copy link
Copy Markdown
Collaborator

rborn commented Jul 11, 2019

@christopherdro @alvelig any thoughts on this?

Comment thread lib/components/Geojson.js Outdated
Copy link
Copy Markdown
Contributor

@nabati nabati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about GeometryCollection type?

@Peretz30
Copy link
Copy Markdown
Contributor Author

@nabati are we really need this GeometryCollection type? There are no issues about that in https://github.com/frankrowe/react-native-geojson/issues for 2 years. So, I think wasting time to implement this feature is not worth it.

@alvelig
Copy link
Copy Markdown
Contributor

alvelig commented Jul 13, 2019

Considering my notes on the uuid use case, LGTM

@Peretz30
Copy link
Copy Markdown
Contributor Author

Deleted uuid generation, used index instead.

@Peretz30
Copy link
Copy Markdown
Contributor Author

Peretz30 commented Jul 21, 2019

So, what about to merge?

@alvelig
Copy link
Copy Markdown
Contributor

alvelig commented Jul 22, 2019

LGTM
@rborn @christopherdro 🐽

@christopherdro
Copy link
Copy Markdown
Collaborator

LGTM. Could we update the docs and add a basic version in the example app?

@Peretz30
Copy link
Copy Markdown
Contributor Author

@christopherdro Added geojson description to docs and examples

@Peretz30
Copy link
Copy Markdown
Contributor Author

Peretz30 commented Aug 5, 2019

@christopherdro @rborn @alvelig Guys, is there anything else I should do?

@christopherdro
Copy link
Copy Markdown
Collaborator

@Peretz30 Could you address the lint errors show in travis?

@Peretz30
Copy link
Copy Markdown
Contributor Author

Peretz30 commented Aug 6, 2019

@christopherdro done

@GuillotJessica
Copy link
Copy Markdown

@Peretz30 will you add bbox feature as it is a common thing on geojson too ? but i don't think your library handles it yet

@Peretz30
Copy link
Copy Markdown
Contributor Author

Peretz30 commented Aug 6, 2019

@GuillotJessica did you mean getMapBoundaries ? It's method of MapView. Geojson is a component that you should to put inside MapView as shown in example. You can use getMapBoundaries as before.

@christopherdro christopherdro merged commit b781c11 into react-native-maps:master Aug 7, 2019
@GuillotJessica
Copy link
Copy Markdown

@Peretz30 i meant to display a map regarding the bbox received in a geojson not to get the bbox displayed

@Peretz30
Copy link
Copy Markdown
Contributor Author

Peretz30 commented Aug 8, 2019

@GuillotJessica I am sorry, but I don't understand what you want to do. Can you, please, provide more details about it?

@GuillotJessica
Copy link
Copy Markdown

i mean if i provide a geojson with boundingBox, i would like the library mapBoundaries to be set accordingly

@Peretz30
Copy link
Copy Markdown
Contributor Author

@GuillotJessica How do you want to provide geojson with boundingBox? Can you, please, post your question with some code on StackOverflow

netmaxt3r pushed a commit to netmaxt3r/react-native-maps that referenced this pull request Oct 6, 2019
* commit '3ae31e4a336102538ee422a0d4e71a2ea32647bb': (24 commits)
  [0.26.1] Release
  rn 0.60.5 support (react-native-maps#3020)
  "AIRMap" was not found in the UIManager IN "0.26.0" (react-native-maps#3103)
  [0.26.0] Release
  Add Heatmap back in (react-native-maps#3064)
  Fixes NPE while removing already removed marker. (react-native-maps#3032)
  Add flat property binding on Marker for iOS (react-native-maps#3051)
  Add heading to the onUserLocationChange listener (react-native-maps#3045)
  Add onDoublePress callback (react-native-maps#2937)
  Allow using onPanDrag while scrollEnabled=true (react-native-maps#2935)
  updating pods for compile error (react-native-maps#3011)
  add overlay onPress event (react-native-maps#3007)
  Fix playServicesVersion name in installation docs (react-native-maps#3016)
  Update index.d.ts (react-native-maps#2887)
  Add @ReactModule annotation to help turbomodules processor (react-native-maps#3001)
  Google Maps - Heatmaps for Android and iOS (react-native-maps#2960)
  Added GeoJSON support by default (react-native-maps#2959)
  Update GoogleMaps pos to 3.2.0 (react-native-maps#2999)
  convert to new react native config format (RN 0.60 (react-native-maps#2975)
  fix select annotation when show/hide callout view (react-native-maps#2973)
  ...

# Conflicts:
#	package.json
pinpong pushed a commit to pinpong/react-native-maps that referenced this pull request Feb 28, 2025
* Added GeoJSON component

* deleted uuid generation, used index instead

* Added geojson description to docs and examples

* Added import to App.js in examples

* fixed prettier syntax errors

* fixed another prettier errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants