npm.io
0.2.5 • Published 4 years ago

mithril-ui-form-maplibre-plugin

Licence
MIT
Version
0.2.5
Deps
3
Size
95 kB
Vulns
0
Weekly
0

A map plugin for Mithril-ui-form using the maplibre library

This is a plugin for Mithril-ui-form. It adds the use of a map based on MapLibre GL.

import { mapLibrePlugin } from 'mithril-ui-form-maplibre-plugin';

...

registerPlugin('libremap', mapLibrePlugin());

You can load your own icons that can then be used in symbol layers.

import { mapLibrePlugin } from 'mithril-ui-form-maplibre-plugin';
import red from './assets/red.png';
import blue from './assets/blue.png';
import fallbackIcon from './assets/x.png';
...
const icons: Array<[img: string, name: string]> = [
    [red, 'RED'],
    [blue, 'BLUE'],
];

registerPlugin('libremap', mapLibrePlugin(fallbackIcon, icons));