@open-pioneer/experimental-ol-map
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

@open-pioneer/experimental-ol-map

This package provides a map container component to integrate an open layers map into an open pioneer project. Besides the component, there is a service, which handles the registration and creation of a map.

Usage

Map container component

To integrate a map container in a react template, place it at the point where it should appear. The wrapping component should provide 100% height.

The component itself uses the map registry service to create the map. Therefore a unique map id should be defined. With this map id, the map can be used in other component via the map registry service. For more configuration of the map see in ./ProMapContainer.tsx and check the .

Simple integration of a map container with an map id:

<div height="100%">
    <MapContainer mapId="map_id"></MapContainer>
</div>

Map registry service

The service is registered with the name "ol-map.MapRegistry". While injecting it the common way, you can access the map via the following snippet:

// get open layers map registry
const olMapRegistry = useService("ol-map.MapRegistry");
// get mapState with a given map id
const mapState = useAsync(async () => await olMapRegistry.getMap(MAP_ID));

License

Apache-2.0

Readme

Keywords

none

Package Sidebar

Install

npm i @open-pioneer/experimental-ol-map

Weekly Downloads

16

Version

0.1.6

License

Apache-2.0

Unpacked Size

37.8 kB

Total Files

21

Last publish

Collaborators

  • open_pioneer
  • antoniave_conterra
  • jessebluemr
  • mbeckem_conterra