3.2.5 • Published 4 years ago

react-mapfilter v3.2.5

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Mapeo View Components

These components are designed for viewing data in Mapeo. They share a common interface:

Common Props

NameTypeDefaultDescription
observationsObservation[][]Array of Mapeo observations
onUpdateObservationfuncCallback fired when an observation has been updatedby the view. Signature: (observation: Observation) => void observation: The updated observation
presetsPreset[][]Array of Mapeo Presets with an array of Fields instead of Field ids.
filterarrayFilter expression used to filter the observations that will be shown.
getMediaUrlfuncFunction called with an id of an image attachment and a size, should return a valid URL to the image. Signature: (id: string, size: 'thumbnail' | 'preview' | 'original') => string
getIconUrlfuncFunction called with an id of an icon, should return a valid URL to the icon. Signature: (id: string) => string

Contents

<MapView />

Displays observations on a map.

MapView Props

NameTypeDefaultDescription
onMapMovefuncCalled with CameraOptions with properties center, zoom, bearing, pitch whenever the map is moved
initialMapPositionobjectInitial CameraOptions position for map - an object with properties center, zoom, bearing, pitch. If this is not set then the map will by default zoom to the bounds of the observations. If you are going to unmount and re-mount this component (e.g. within tabs) then you will want to use onMove to store the position in state, and pass it as initialPosition for when the map re-mounts.
mapStylestring'mapbox://styles/mapbox/outdoors-v10'A Mapbox Style URL
mapboxAccessTokenstringA Mapbox Access Token used to access the style

MapView instance methods

flyTo({center, zoom}, eventData?)

Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight. The animation seamlessly incorporates zooming and panning to help the user maintain her bearings even after traversing a great distance, takes the same options as the flyTo method of mapbox-gl-js

fitBounds(bounds, options?, eventData?)

Pans and zooms the map to contain its visible area within the specified geographical bounds. This function will also reset the map's bearing to 0 if bearing is nonzero, takes the same options as the fitBounds method of mapbox-gl-js

<MediaView />

Display a grid of all the media attachments from the observations.

MediaView Props

MediaView does not currently have any additional props beyond the common props above.

<ReportView />

Display observations as a report that can be printed.

ReportView Props

ReportView shares several props with MapView. These props apply to the inset map in the ReportView.

NameTypeDefaultDescription
onMapMovefuncCalled with CameraOptions with properties center, zoom, bearing, pitch whenever the map is moved
initialMapPositionobjectInitial CameraOptions position for map - an object with properties center, zoom, bearing, pitch. If this is not set then the map will by default zoom to the bounds of the observations. If you are going to unmount and re-mount this component (e.g. within tabs) then you will want to use onMove to store the position in state, and pass it as initialPosition for when the map re-mounts.
mapStylestring'mapbox://styles/mapbox/outdoors-v10'A Mapbox Style URL
mapboxAccessTokenstringA Mapbox Access Token used to access the style
3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.1.0

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

3.0.0-beta.15

4 years ago

3.0.0-beta.14

4 years ago

3.0.0-beta.13

4 years ago

3.0.0-beta.12

4 years ago

3.0.0-beta.11

5 years ago

3.0.0-beta.10

5 years ago

3.0.0-beta.7

5 years ago

3.0.0-beta.6

5 years ago

3.0.0-beta.5

5 years ago

3.0.0-beta.4

5 years ago

3.0.0-beta.2

5 years ago

3.0.0-beta.1

5 years ago

3.0.0-beta.0

5 years ago

2.0.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.13

5 years ago

1.2.12

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

1.0.0-beta.2

6 years ago

1.0.0-beta.1

6 years ago

1.0.0-alpha.20

6 years ago

1.0.0-alpha.19

6 years ago

1.0.0-alpha.18

7 years ago

1.0.0-alpha.17

7 years ago

1.0.0-alpha.16

7 years ago

1.0.0-alpha.15

7 years ago

1.0.0-alpha.14

7 years ago

1.0.0-alpha.13

7 years ago

1.0.0-alpha.12

7 years ago

1.0.0-alpha.11

7 years ago

1.0.0-alpha.10

7 years ago

1.0.0-alpha.9

7 years ago

1.0.0-alpha.7

7 years ago

1.0.0-alpha.6

7 years ago

1.0.0-alpha.5

7 years ago

1.0.0-alpha.4

7 years ago

1.0.0-alpha.3

7 years ago

1.0.0-alpha.2

7 years ago

1.0.0-alpha.1

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago