0.9.1 • Published 2 years ago

geovisto-legend v0.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Geovisto Legend Tool

Extension of the Geovisto core library which provides the legend tool.

This repository is a snapshot of Geoviosto tools/legend derived from the development repository: geovisto/geovisto-map.

sample

Usage

import {
    GeovistoLegendTool
} from 'geovisto-legend';
import 'geovisto-legend/dist/index.css';

// ,,,

// create instance of map with given props
const map = Geovisto.createMap({
    // ...
    tools?: Geovisto.createMapToolsManager([
        // instances of Geovisto tools (extensions) which will be directly used in the map
        // ...
        GeovistoLegendTool.createTool({
            id: "geovisto-tool-legend",
        }),
    ])
});

// rendering of the map
map.draw(Geovisto.getMapConfigManagerFactory().default({
    // initial settings of the map can be overriden by the map config - JSON structure providing user settings 
    // ...
    tools?: [
        // config of Geovisto tools (extensions) used in the map
        {
            "type": "geovisto-tool-legend",
            "id": "geovisto-tool-legend",
            "enabled": true,
            "tools": [
                "geovisto-tool-layer-choropleth",
                "geovisto-tool-layer-marker"
            ]
        }
    ]
}));

Installation

npm install --save geovisto-legend

Peer dependencies:

npm install --save geovisto leaflet

This package serves as an extension of Geovisto core using the API for Geovisto tools (extensions). Follow Geovisto core on Github.

License

MIT