0.1.6 • Published 11 months ago

@open-pioneer/experimental-ol-map v0.1.6

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
11 months ago

@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

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago