Skip to content

Pragmatic implementation of OGC API -- Features Parts 1 and 4

Notifications You must be signed in to change notification settings

KrausMatthias/Leaflet.OGCAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet OGC API -- Features

Pragmatic implementation of OGC API -- Features Parts 1 and 4

Visualize and modify Layers from OGC API -- Features Servers in Leaflet.

This is still work in progress and takes some assumptions which are not fully standard compliant.

Demo

See demo.html for a minimal demo.

Collections

Represents FeatureCollections offered by an OGC API as described in OGC API -- Features 7.13 Collections as a list of FeatureCollection Leaflet Layers. This currently filters for collections with at least a link-relation "items".

Methods

Method Parameters Response
constructor Collections instance
getLayers None List of all FeatureCollection layers.
getLayer collection_id FeatureCollection for the given collection id
createCollection Collection Metadata Promise returning a FeatureCollection on success.

Options

Option Description
fetch_options Options applied to all fetch operations. Use this if you need to set e.g. Headers.
pagination_limit Maximum number of features to fetch in one batch. Default: Use Server default.
feature_limit Maximum total number of features to load. Default: unlimited.

Options from Leaflet.GeoJSON. These are applied to each FeatureCollection.

FeatureCollection

Extends Leaflet.GeoJSON. Uses Feature IDs from the server to allow for seamless updates.

Methods

Method Parameters Response
constructor FeatureCollection instance
configure Collection Metadata Promise. Updates the metadata of this FeatureCollection on success
subscribe None. Requires link with relation "hub" pointing to a SSE endpoint in metadata of this FeatureCollection. None. Updates features in this FeatureCollection based on SSE events
unsubscribe None. Drops SSE stream
delete Promise. Deletes this collection from the server
createFeature Leaflet Layer implementing toGeojson Promise. Creates this Layer as new Item in the FeatureCollection on the server. Adds the given layer to this FeatureCollection
updateFeature Leaflet Layer from this FeatureCollection Promise. Updates this Layer on the server
deleteFeature Leaflet Layer from this FeatureCollection Promise. Deletes this Layer on the server and removes it from this FeatureCollection

More methods inherited from Leaflet.GeoJSON.

Options

Option Description
fetch_options Options applied to all fetch operations. Use this if you need to set e.g. Headers.
pagination_limit Maximum number of features to fetch in one batch. Default: Use Server default.
feature_limit Maximum total number of features to load. Default: unlimited.

Options from Leaflet.GeoJSON.

Tested OGC API Implementations

Alternative implementations

About

Pragmatic implementation of OGC API -- Features Parts 1 and 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published