1.9.6 • Published 1 year ago

react-leaflet-ellipsis v1.9.6

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Import Ellipsis layers in react-leaflet

Install

Install using npm install react-leaflet-ellipsis

Usage

In a React app, import the RasterLayer and VectorLayer: import { EllipsisRasterLayer } from 'react-leaflet-ellipsis' import { EllipsisVectorLayer } from 'react-leaflet-ellipsis' import { EllipsisApi } from 'react-leaflet-ellipsis'

Example

You can use RasterLayer and VectorLayer within a <MapContainer /> or <Map /> component.

<MapContainer>
  <EllipsisRasterLayer pathId={pathId} />
  <EllipsisVectorLayer pathId={pathId} />
</MapContainer>

To login or request metadata of maps you can use the functions available in EllipsisApi.

useEffect(() => {
  EllipsisApi.login(username, password).then((response) => {
    console.log(response);
    token = response.token;
    expires = response.expires;
  });
  EllipsisApi.getMetadata(mapId).then((response) => {
    console.log(response);
  });
}, []);

RasterLayer props

NameDescription
pathIdid of the path
timestampIdid of the timestamp (optional)
styleid of a style or an object describing it (optional)
zoomint to use as max native zoom (optional)
tokentoken of the user (optional)
maskMask of type multipolygon (optional)

VectorLayer props

NameDescription
pathIdId of the path (Only required option)
timestampIdId of the timestamp
onFeatureClickA function to run on feature click, with as argument the clicked feature
zoommaxZoomlevel of the layer. If not specified, use the one specified in layer info.
tokenToken of the user
styleId of a style or a style object.
filterA property filter to use
levelOfDetailThe level of detail ranging from 1 to 5, or 6 to disable this feature. Default 6.
levelOfDetailModeA string of value 'dynamic' (=default) to change the level of detail with zoom, or 'static'.
levelOfDetailMapperA function that transforms zoom to a levelOfDetail, used in dynamic mode.
centerPointsBoolean whether to render only center points. Default false.
pageSizeSize to retreive per step. Default 25, max 3000.
maxMbPerTileThe maximum mb to load per tile. Default 16mb.
maxTilesInCacheThe number of tiles to keep in cache. Default 500.
maxFeaturesPerTileThe maximum number of vectors to load per tile. Default 200.
loadAllAlways load all vectors, even if not visible or far away. Default false
fetchIntervalThe interval in ms between finishing a request and starting a new request. Default 0.

warning loadAll=true will ignore maxMbPerTile, maxTilesInCache and maxFeaturesPerTile settings.

Any details about the style object are documented in (this documentation)https://docs.ellipsis-drive.com/developers/api-v3/path-vector/styles/add-style

Use the EllipsisApi to login into Ellipsis Drive or view metadata of paths

EllipsisApi.login description

parameters

namedescription
usernameThe username of your ellipsis-drive account
passwordThe password of your ellipsis-drive account
validFor(Optional) The number of second the access token will be valid for. Default 86400 (24 hours).

return value

token: string; //token to use in other api calls
expires: number; //expiration time in milliseconds

EllipsisApi.getPath description

parameters

namedescription
pathIdThe id of the path.
user(Optional) An user object which can contain a token like user: {token: mytoken}

return value It returns JSON, which depends on the type of the specified object.

1.9.6

1 year ago

1.9.5

1 year ago

1.9.1

2 years ago

1.9.0

2 years ago

1.9.4

1 year ago

1.9.3

1 year ago

1.9.2

1 year ago

1.8.1

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.6.5

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

0.0.0

3 years ago