Skip to content
/ munimap Public

Javascript library for showing interactive maps of Masaryk University buildings and rooms on webpages.

License

Notifications You must be signed in to change notification settings

ICS-MU/munimap

Repository files navigation

munimap

Requirements

  • Node.js 12+

Installation

npm ci



Develop

npm run dev

Visit http://localhost:8080/munimap/testing/.

Development script starts webpack with configuration in webpack.config.dev.babel.js. Webpack then ensures three main functions:




Build

npm run build

Build script runs webpack with configuration in webpack.config.production.babel.js. Webpack builds everything (including CSS styles) into dist/latest.

Content of dist folder is then prepared to be published online.

You can also start server to see built version, just run

npm run start-build

and visit http://localhost:8080/munimap/latest/quickstart.html.

Build to different web server folder

npm run build-testing
npm run build-v2n

Build script runs webpack with configuration in webpack.config.production.babel.js. Webpack builds everything (including CSS styles) into dist/testing or dist/<previous-version>.




Test

npm run test

Test framework is designed for integration tests and use mocha, chai and puppeteer libraries.

To create test use javascript files in test/integration.

Main functionality:

await page.evaluate(async () => {
   // code to run into browser
});

// assertions that compare expected and actual values
assert.equal();
assert.include();
...



Type check

Type checking is ensure by JSDoc annotations and TypeScript in the same way as OpenLayers do. The configuration is set in tsconfig.json.

To check types, run

npm run typecheck



Code style

Code style is ensured by ESLint with the same configuration as Openlayers library. The configuration is set in

To check code style, run

npm run lint

To automatically fix some code-style issues, run

npm run fix-lint



Breaking changes

  • OpenLayers library is not exported as legacy build anymore

    It means there is no ol namespace with all OpenLayers functions.

    It's possible to export any subset of OpenLayers classes and methods to munimap.ol object. Example is available in src/munimap/index.js, where two classes Map and View are exported. Such classes are available as munimap.ol.Map and munimap.ol.View. For legacy support this exported object is added to window as global object ol. If ol already exists, munimap library can't be initialized.




Upgrading OpenLayers

When upgrading OpenLayers, upgrade also following packages to the same version as new OpenLayers version uses.

Also, upgrade @types/ol package to the same version as OpenLayers.

About

Javascript library for showing interactive maps of Masaryk University buildings and rooms on webpages.

Resources

License

Stars

Watchers

Forks

Packages

No packages published