Web: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
()
()
Line 18: Line 18:
Included in map-core is an example project using the package located in ./examples.  
Included in map-core is an example project using the package located in ./examples.  
=== Maria map ===
=== Maria map ===
The maria-map example is written in React using create-react-app. It shows how the map-component can be used in a react component, and an example of how to set up map layers. It also shows an implementation of a map layer selector.
The maria-map example is written in React using create-react-app. It shows how the map-component can be used in a react component, and an example of how to set up map layers. It also shows an implementation of a map layer selector, a header and a status bar footer that uses the api of the map component.
To run the example, follow the readme in the example project.
To run the example, follow the readme in the example project.

Revision as of 22:48, 24 January 2022

Getting Started

The Maria web map component is published as a pure javascript/typescript library. It can be used with the framework of the developrers own choosing.

An access token from Teleplan is needed to access these NPM-packages. The access token can be placed in a local .npmrc file in the root of the project using the packages.

Example .npmrc:

//registry.npmjs.org/:_authToken=YOUR_ACCESS_TOKEN

The .npmrc file should not be checked in to version control.

To add the Maria map to to your existing project, install the @mariateleplan/map-core npm package.

npm i @mariateleplan/map-core

Example

Included in map-core is an example project using the package located in ./examples.

Maria map

The maria-map example is written in React using create-react-app. It shows how the map-component can be used in a react component, and an example of how to set up map layers. It also shows an implementation of a map layer selector, a header and a status bar footer that uses the api of the map component. To run the example, follow the readme in the example project.