Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Create a "map" React component #6 #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nicolapagni
Copy link

@nicolapagni nicolapagni commented Oct 8, 2017

DAF Open Map

React Open Map Component with OpenStreetMap and react-leaf.

https://imgur.com/t5FXMw5

https://imgur.com/a/4Giiz

How to start:

cd react-open-map
npm install
yarn storybook

How to use map component:

<DafOpenMap
  url={"http://localhost:9009/example_dataset.json"}
  lat={"enteBeneficiario.geoLat"}
  lng={"enteBeneficiario.geoLng"}
/>

Where:

url: The URL of dataset
lat: Path of the JSON field latitude defined in the dataset
lng: Path of the JSON field longitude defined in the dataset

You can modify the component by editing the file in the following path :

react-open-map/src/components/DafOpenMap.js

You can create new stories by editing the file in the following path :

react-open-map/src/stories/DafOpenMap.js

NOTE: Currently the popup shown when user clicks on the geopoint is customized on a example dataset in :

react-open-map/public/example_dataset.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants