react-mapfilter
These components are designed for viewing data in Mapeo. They share a common interface:
Last updated 14 days ago by karissa .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-mapfilter 
SYNC missed versions from official npm registry.

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' | 'original') => string
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

Current Tags

  • 3.0.0-beta.15                                ...           beta (9 months ago)
  • 3.2.5                                ...           latest (14 days ago)

69 Versions

  • 3.2.5                                ...           14 days ago
  • 3.2.4                                ...           a month ago
  • 3.2.3                                ...           a month ago
  • 3.2.2                                ...           a month ago
  • 3.2.1                                ...           a month ago
  • 3.1.0                                ...           a month ago
  • 3.0.2                                ...           6 months ago
  • 3.0.1                                ...           6 months ago
  • 3.0.0                                ...           9 months ago
  • 3.0.0-beta.15                                ...           9 months ago
  • 3.0.0-beta.14                                ...           9 months ago
  • 3.0.0-beta.13                                ...           9 months ago
  • 3.0.0-beta.12                                ...           9 months ago
  • 3.0.0-beta.11                                ...           10 months ago
  • 3.0.0-beta.10                                ...           10 months ago
  • 3.0.0-beta.7                                ...           10 months ago
  • 3.0.0-beta.6                                ...           10 months ago
  • 3.0.0-beta.5                                ...           10 months ago
  • 3.0.0-beta.4                                ...           10 months ago
  • 3.0.0-beta.2                                ...           10 months ago
  • 3.0.0-beta.1                                ...           10 months ago
  • 3.0.0-beta.0                                ...           10 months ago
  • 2.0.0                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.13                                ...           a year ago
  • 1.2.12                                ...           a year ago
  • 1.2.11                                ...           2 years ago
  • 1.2.10                                ...           2 years ago
  • 1.2.9                                ...           2 years ago
  • 1.2.8                                ...           2 years ago
  • 1.2.7                                ...           2 years ago
  • 1.2.6                                ...           2 years ago
  • 1.2.5                                ...           2 years ago
  • 1.2.4                                ...           2 years ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.4                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 1.0.0-beta.2                                ...           2 years ago
  • 1.0.0-beta.1                                ...           3 years ago
  • 1.0.0-alpha.20                                ...           3 years ago
  • 1.0.0-alpha.19                                ...           3 years ago
  • 1.0.0-alpha.18                                ...           3 years ago
  • 1.0.0-alpha.17                                ...           3 years ago
  • 1.0.0-alpha.16                                ...           3 years ago
  • 1.0.0-alpha.15                                ...           3 years ago
  • 1.0.0-alpha.14                                ...           3 years ago
  • 1.0.0-alpha.13                                ...           3 years ago
  • 1.0.0-alpha.12                                ...           3 years ago
  • 1.0.0-alpha.11                                ...           3 years ago
  • 1.0.0-alpha.10                                ...           3 years ago
  • 1.0.0-alpha.9                                ...           3 years ago
  • 1.0.0-alpha.7                                ...           3 years ago
  • 1.0.0-alpha.6                                ...           3 years ago
  • 1.0.0-alpha.5                                ...           3 years ago
  • 1.0.0-alpha.4                                ...           3 years ago
  • 1.0.0-alpha.3                                ...           3 years ago
  • 1.0.0-alpha.2                                ...           3 years ago
  • 1.0.0-alpha.1                                ...           3 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Downloads
Today 0
This Week 1
This Month 20
Last Day 0
Last Week 8
Last Month 121
Dev Dependencies (56)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |