Skip to content

Dataport/polar

Repository files navigation

Public Money, Public Value License: EUPL v1.2 We're on NPM!

POLAR

Plugins for OpenLAyeRs is based on the masterportalAPI and OpenLayers.

POLAR is ...

  • ... a configurable map client package.
  • ... a flexible map client factory.
  • ... an extensible library.

Quick Start

Usage without NPM documented in chapter "Getting started (for developers)".

npm i @polar/client-generic
import polar from '@polar/client-generic'

polar.createMap({
  // a div must have this id
  containerId: 'polarstern',
  // any service register – this is Hamburg's
  services: 'https://geodienste.hamburg.de/services-internet.json',
  mapConfiguration: {
    // this initially shows Hamburg's city plan
    layers: [{
      id: '453',
      visibility: true,
      type: 'background',
    }]
  }
})

See our documentation page for all features and configuration options included in this modulith client, with running examples.

Example clients

The most common use case for this client is in citizen's application processes regarding public service.

Other clients with more specific code include the Denkmalkarte Schleswig-Holstein, a memorial map, and the Meldemichel Hamburg, a map to inspect and create reports regarding damages to public infrastructure. The latter is currently being migrated to the version seen in this repository.

Backers and users

States of Germany

Bremer Wappenzeichen
Freie Hansestadt Bremen
Hamburg-Symbol
Freie Freie und Hansestadt Hamburg
Landessymbol Sachsen-Anhalt
Sachsen-Anhalt
Landessymbol Schleswig-Holstein
Schleswig-Holstein

Government agencies

Technical concepts

Reusability and adaptability

POLAR is built to ease the creation of new map clients. A lot of feature requests in map clients are recurring and can be fulfilled with reusable parts. Then again, many map clients require a little extra.

POLAR is built to serve both worlds. For generic use cases, generic clients are ready-made and usable by configuration. More specific use cases can be matched with special clients that still make use of the plugins and fill in the missing parts.

POLAR runs both as full page application and as component. The most common usage is as component: Think of it as a form input where the input data is geospatial.

Plugin-based approach

To see our plugins in action, please visit our documentation page to see running examples. Plugins are designed to be configurable, optional, and replacable.

Name Details
AddressSearch Offers a search field and standard search service implementations with API for your own configurable custom search services. For already usable search services, see the documentation of the package. Integration with Reverse Geocoder and Pins possible, or usable as a data source for further processing.
Attributions Shows layer copyright information of visible layers and client.
Draw Allows the user to draw various geometries onto the map. The resulting GeoJSON can be forwarded to later processing steps, or be used by the Export plugin to generate screenshots.
Export Offers screenshot functionality for the user or further processing.
Filter Allows users to filter vector layers to content relevant to their interests.
Fullscreen User can toggle between integrated and fullscreen view with this plugin.
GeoLocation Geolocalizes the user either on user demand or as a background procedure. An icon is shown on the user position on the map.
Gfi Short for "Get Feature Information". Retrieves feature information from a WMS or WFS layer for display or usage by further processing steps. Can be used as feature list viewer for vector layers.
IconMenu Handles display of visible plugin buttons. Only relevant for programming clients, no direct user feature.
LayerChooser Allows choosing a background layer and an arbitrary amount of feature or overlay layers. WMS layers can optionally be filtered by sub-layers by the user.
Legend Displays an overview of layer legend images as delivered by the used WMS services. Images can be clicked for large view.
LoadingIndicator Loading spinner. Only relevant for programming clients, no direct user feature.
Pins Pin feature that allows users to set and move pins to indicate a position. Integration with AddressSearch and ReverseGeocoder configurable.
ReverseGeocoder Configurable to translate an arbitrary coordinate to an address. Integration with AddressSearch and Pins configurable.
Scale Shows current scale as ratio and size indicator.
Toast Shows information to the user. Configurable in many plugins to communicate status updates or procedural advice.
Zoom Allows zooming in and out of the client with buttons.

Getting started (for developers)

Using POLAR

First check if the generic map client fulfills your need. For this, see the section "Quick start" above. Should your project not use NPM, you may also select a client from our releases. On all client releases, the zipped client is downloadable and attached as an asset to the release.

Client packages contain example files that illustrate how the client can be used. The @polar/client-generic package's use is furthermore illustrated on our documentation page.

Developing POLAR

Clone the repository and run npm install && npm run snowbox. This winds up our development client in a minimal test environment as a starting point.

If you aim to create an additional plugin, you may now create and install it to the snowbox during development. To create a new client, it is advised to create a copy of e.g. @polar/client-generic as a base project and adjust it to your needs.

Clients run anywhere, but their development requires further setup. Right now, clients should be developed in this repository or in a fork of it to make use of its setup.

Stay In Touch

made by Dataport with ❤️