mobility-toolbox-js 3.0.0-beta.0 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 geOps
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # mobility-toolbox-js
2
+
3
+ Toolbox for JavaScript applications in the domains of mobility and logistics.
4
+ The tools in this library have been inspired by many projects realized for public transport agencies, mobility providers and logistics companies.
5
+
6
+ [![npm](https://img.shields.io/npm/v/mobility-toolbox-js.svg?style=flat-square)](https://www.npmjs.com/package/mobility-toolbox-js)
7
+ [![Build](https://github.com/geops/mobility-toolbox-js/workflows/Build/badge.svg)](https://github.com/geops/mobility-toolbox-js/actions?query=workflow%3ABuild)
8
+ [![Lint / Unit tests](https://github.com/geops/mobility-toolbox-js/workflows/Lint%20/%20Unit%20tests/badge.svg)](https://github.com/geops/mobility-toolbox-js/actions?query=workflow%3ALint%20/%20Unit%20tests)
9
+ ![Vercel](https://vercelbadge.vercel.app/api/geops/mobility-toolbox-js)
10
+
11
+ ## Documentation and examples
12
+
13
+ Visit https://mobility-toolbox-js.vercel.app/
14
+
15
+ ## Demos
16
+
17
+ * Display [real-time vehicle positions and prognosis data](https://mobility.portal.geops.io) on a map.
18
+ * Search for [stops and stations](https://maps.trafimage.ch) all over the world.
19
+ * Get [precise geographic courses](https://routing-demo.geops.io/) for all modes of transport.
20
+ * Generate beautiful [schematic](https://mobility.portal.geops.io/world.geops.networkplans) or [topographic](https://mobility.portal.geops.io) maps for public transport, mobility and logistics.
21
+
22
+ ## Install
23
+
24
+ Install the library and the peer dependencies:
25
+
26
+ ```bash
27
+ yarn add mobility-toolbox-js ol maplibre-gl
28
+ ```
29
+
30
+ ## Development
31
+
32
+ ```bash
33
+ yarn install
34
+ yarn dev
35
+ ```
36
+
37
+ ## Deploy
38
+
39
+ This library website is deployed automatically using [Vercel](https://vercel.com/geops).
40
+ For Vercel we have to add the nextjs and raw-loader modules in the dev dependencies of the main package.json.
41
+ But those 2 librairies are not needed to build the library.
42
+
package/mbt.js CHANGED
@@ -45713,7 +45713,7 @@ uniform ${i3} ${s3} u_${a3};
45713
45713
  this.loaded = false;
45714
45714
  this.olListenersKeys.push(
45715
45715
  // @ts-ignore
45716
- this.map?.on("change:target", this.loadMbMap)
45716
+ this.map?.on("change:target", this.loadMbMap.bind(this))
45717
45717
  );
45718
45718
  if (!this.map?.getTargetElement()) {
45719
45719
  return;
@@ -45721,7 +45721,7 @@ uniform ${i3} ${s3} u_${a3};
45721
45721
  if (!this.visible) {
45722
45722
  this.olListenersKeys.push(
45723
45723
  // @ts-ignore
45724
- this.once("change:visible", this.loadMbMap)
45724
+ this.once("change:visible", this.loadMbMap.bind(this))
45725
45725
  );
45726
45726
  return;
45727
45727
  }
@@ -45730,8 +45730,7 @@ uniform ${i3} ${s3} u_${a3};
45730
45730
  container.style.width = "100%";
45731
45731
  container.style.height = "100%";
45732
45732
  this.mbMap = this.createMap({
45733
- // https://maps.geops.io/styles/t7ravic_v2/style.json',
45734
- style: this.getStyle(),
45733
+ style: this.getStyle() || { version: "8", sources: {}, layers: [] },
45735
45734
  container,
45736
45735
  ...this.options?.mapOptions || {}
45737
45736
  });