npm

boomack-plugin-leaflet

0.2.1 • Public • Published

Boomack Plug-In Leaflet

Features

Plug-In ID: leaflet

Text Transformation leaflet

Render a geographic map with markers, using the JavaScript library Leaflet. The default map source is OpenStreetMap.

Input

The input is expected to be a valid JSON or YAML map. The input map is merged with the map from the display options and interpreted in the way described below.

The properties from the input take precedence over the properties from the display options.

Display Options

  • leaflet
    A map, which is merged with the input and interpreted in the way described below.

Specification

The merged map from the input and the display options supports the following properties:

  • width
    The width of the viewport in CSS compatible units. Defaults to "100%".
  • height
    The height of the viewport in CSS compatible units. Defaults to "100%".
  • attribution
    An HTML fragment to be displayed at the bottom of the map. Defaults to &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.
  • tileServerUrl
    A template for the URL for loading map tiles. Defaults to https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png.
  • tileSize
    Default to null.
  • accessToken
    An access token to transmit when requesting tiles. Intended for commercial tile servers. Defaults to null.
  • minZoom
    The minimal allowed zoom level: 1 – 20. Defaults to null.
  • maxZoom
    The maximal allowed zoom level: 1 – 20. Defaults to null.
  • maxBounds
    A region to limit the view to. Described by a pair of two geo coordinates as diagonal corners of a rectangular region.
  • bounds
    The initial region to display in the view. Described by a pair of two geo coordinates as diagonal corners of a rectangular region.
  • zoom
    The initial zoom level: 1 – 20. Defaults to null.
  • center
    The center of the initially visible region in the viewport. Defaults to lat and lon, or null.
  • lat
    The latitude of a single point marker without any additional properties, and potentially the center of the initially visible region. Defaults to null.
  • lon / lng
    The longitude of a single point marker without any additional properties, and potentially the center of the initially visible region. Defaults to null.
  • marker
    One or multiple point markers. Defaults to [].
  • lines
    One or multiple line markers. Defaults to [].
  • areas
    One or multiple area markers. Defaults to [].

You can use either bounds, or center in combination with zoom.

Geo Position

A geo position is encoded with one of the following structures:

  • [ <lat>, <lon> ]
  • { lat: <lat>, lon: <lon> }
  • { lat: <lat>, lng: <lon> }

Point Marker

A point marker is a geo position, optionally with the following additional properties:

  • type
    One of "icon" or null for a marker icon, "circle", or "rectangle". The short version "rect" is accepted also. Defaults to null.
  • width
    The width of a rectangular marker in kilometers.
  • height
    The height of a rectangular marker in kilometers.
  • title
    A simple tool tip text to display, when hovering over the marker with the mouse cursor.
  • popup
    A HTML fragment for the content area of a pop-up. Which is displayed after clicking on the marker.

If type is set to "circle" all options of a Leaflet Circle are supported. If type is set to "rectangle" all properties of a Leaflet Polyline are supported.

Line Marker

A line marker is either an array of geo positions, or a map with the following properties:

  • vertices
    An array with geo positions.
  • popup
    A HTML fragment for the content area of a pop-up. Which is displayed after clicking on the marker.

Additionally all properties of a Leaflet Polyline are supported.

Area Marker

An area marker is either an array of geo positions, or a map with the following properties:

  • vertices
    An array with geo positions.
  • popup
    A HTML fragment for the content area of a pop-up. Which is displayed after clicking on the marker.

Additionally all properties of a Leaflet Polygon are supported.

Media Types

The plug-in provides the following media types:

  • application/x-leaflet

Package Sidebar

Install

npm i boomack-plugin-leaflet

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

183 kB

Total Files

10

Last publish

Collaborators

  • mastersign