Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-mapfilter

Package Overview
Dependencies
Maintainers
6
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-mapfilter

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

  • 3.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

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'
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

FAQs

Package last updated on 31 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc