Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-mapfilter

digidem179MIT3.2.5

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

readme

Mapeo View Components

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

Common Props

Name Type Default Description
observations Observation[] [] Array of Mapeo observations
onUpdateObservation func | Callback fired when an observation has been updatedby the view.

Signature:
(observation: Observation) => void observation: The updated observation
presets Preset[] [] Array of Mapeo Presets with an array of Fields instead of Field ids.
filter array | Filter expression used to filter the observations that will be shown.
getMediaUrl func | Function 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'
getIconUrl func | Function 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

Name Type Default Description
onMapMove func | Called with CameraOptions with properties center, zoom, bearing, pitch whenever the map is moved
initialMapPosition object | Initial 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.
mapStyle string 'mapbox://styles/mapbox/outdoors-v10' A Mapbox Style URL
mapboxAccessToken string | A 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.

Name Type Default Description
onMapMove func | Called with CameraOptions with properties center, zoom, bearing, pitch whenever the map is moved
initialMapPosition object | Initial 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.
mapStyle string 'mapbox://styles/mapbox/outdoors-v10' A Mapbox Style URL
mapboxAccessToken string | A Mapbox Access Token used to access the style

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

3.2.5 (2020-07-31)

Bug Fixes

  • Editing multiselect fields with single values shouldn't cause (85c4dbc)
  • Fix flow types not being correctly removed from compiled code (cc2cfb5)

3.2.4 (2020-07-16)

Bug Fixes

  • Fix flow types not being correctly removed from compiled code (cc2cfb5)

3.2.3 (2020-07-14)

Bug Fixes

  • fix failing test for converting btween non-string values and labels (79561db)
  • Fix number fields to always return number not string (01968ca)
  • Select should properly respect value/label objects for options (60aeb28)

3.2.2 (2020-07-09)

Bug Fixes

  • Ensure TextField fallback has handleChange property (801dfcd)
  • SelectMultiple should not throw errors in console (f5a219d)

3.2.1 (2020-07-09)

Bug Fixes

  • Don't automatically expand filters by default (162722b)

3.2.0 (2020-07-09)

Features

  • use @material-ui/lab/Autocomplete for SelectMultiple (aced10d)

3.1.0 (2020-07-09)

Features

  • Support localized type fields (9dba6f1)
  • Support singleline text fields (67295b1)

3.0.0 (2019-11-25)

Bug Fixes

  • Change label from "created" to "date of observation" (607bcd0)

3.0.0-beta.15 (2019-11-23)

Bug Fixes

  • Fix filter bug (can't return to show all) when filtering by two or more fields (69a8aa3)

3.0.0-beta.14 (2019-11-18)

Bug Fixes

  • Translate Delete Observation menu item (9faeec9)

3.0.0-beta.13 (2019-11-12)

Features

  • Add read-only select_multiple field support (0fc88e3)

3.0.0-beta.12 (2019-10-31)

Features

  • Add delete observation action (9688317)

Bug Fixes

  • Remove unused IntlProvider in MapView (fa5c45b)

3.0.0-beta.11 (2019-10-08)

Bug Fixes

3.0.0-beta.10 (2019-10-08)

Bug Fixes

  • broken image color (85005b3)
  • don't move map if initialMapPosition is set (526a5ef)
  • Don't show option to hide categoryId and notes from reports (79d1fa4)
  • Fix date filter not including max day (dd52013)
  • fix hiding fields in Report view (24e3d44)
  • Fix report toolbar positioning (0516d07)
  • forward map ref (005a454)
  • Min/max date always less than / greater than other (1cc7a27)
  • sort media (most recent first) (3f999c1)
  • Sort presets by sort field, then by name (d64312d)
  • Support textarea fields (legacy support for iD presets) (08e86c4)
  • Temp fix - allow wider field names in hidden fields dialog (a7a6169)
  • Use @material-ui/core styles - fixes styling issues e.g. report printing (1957010)

Features

  • Don't show notes or categoryId in additional detail (dba51e7)

3.0.0-beta.9 (2019-10-06)

Bug Fixes

  • Don't show preset fields in "additional fields" (9170100)
  • Report toolbar positioning (eeb3691)
  • Support textarea fields (multi-line text fields) as well as just 'text' (7febef4)

3.0.0-beta.8 (2019-10-06)

Bug Fixes

  • more hacky, more better (e7a7df7)
  • report layout with scrollbars (cf3e204)

Features

  • Add Spanish translations (d69b68b)
  • build translations and include in npm publish (496dda1)

3.0.0-beta.7 (2019-10-02)

Bug Fixes

3.0.0-beta.6 (2019-10-02)

Bug Fixes

3.0.0-beta.5 (2019-10-02)

Bug Fixes

  • Fix print view crash on print (a35eb84)
  • remove shadow on toolbar (9c2dc1c)

3.0.0-beta.4 (2019-10-02)

Bug Fixes

  • remove paper styling for filter pane (fd25320)

3.0.0-beta.3 (2019-10-02)

3.0.0-beta.2 (2019-10-02)

Bug Fixes

  • wrap filterpanel with picker utils (87727d6)

3.0.0-beta.1 (2019-10-02)

Bug Fixes