npm.io
1.3.16 • Published 21h agoCLI

@kispace-io/gs-lib

Licence
EPL-2.0
Version
1.3.16
Deps
0
Size
518 kB
Vulns
0
Weekly
0
Stars
5

@kispace-io/gs-lib

Runtime library for geo!space maps. This package provides the core functionality to convert GsMap domain models into OpenLayers map instances.

Features

  • Type definitions for GsMap domain model (GsMap, GsLayer, GsFeature, etc.)
  • Conversion from GsMap to OpenLayers (toOlMap)
  • Conversion from OpenLayers to GsMap (toGsFeature, etc.)
  • Style management and evaluation
  • Control and overlay support
  • Lit integration for custom components

Installation

npm install @kispace-io/gs-lib

Usage

import { gsLib, GsMap } from '@kispace-io/gs-lib';

const gsMap: GsMap = {
  view: { center: [0, 0], zoom: 2, projection: 'EPSG:3857' },
  layers: [...],
  // ...
};

const olMap = await gsLib({
  containerSelector: '#map',
  gsMap: gsMap,
  env: { /* environment variables */ }
});

WebAwesome Support

If your application uses user modules (controls/overlays) that utilize WebAwesome components (e.g., <wa-button>, <wa-icon>), you need to import WebAwesome in your application:

import '@awesome.me/webawesome/dist/components/button/button.js';
// ... import other components as needed

Or if using the appspace package:

import '@kispace-io/core/externals/webawesome';

WebAwesome is an optional peer dependency of this package - it's only needed if your user modules use WebAwesome components.

License

EPL-2.0