mobility-toolbox-js 2.0.0-beta.6 → 2.0.0-beta.8

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.
Files changed (55) hide show
  1. package/package.json +1 -1
  2. package/src/common/index.js +5 -0
  3. package/src/common/styles/index.js +1 -1
  4. package/src/common/utils/index.js +0 -1
  5. package/src/iife.js +2 -2
  6. package/src/index.js +8 -23
  7. package/src/mapbox/controls/index.js +2 -0
  8. package/src/mapbox/index.js +4 -3
  9. package/src/mapbox/layers/index.js +2 -0
  10. package/src/ol/controls/index.js +3 -0
  11. package/src/ol/index.js +4 -12
  12. package/src/ol/layers/index.js +8 -0
  13. package/Layer.js +0 -2
  14. package/Layer.js.map +0 -7
  15. package/src/doc/components/esm.min.js +0 -2
  16. package/src/doc/components/examples/assets/tralis-live-map/index.js +0 -11
  17. package/src/doc/components/examples/assets/tralis-live-map/s1kreis.svg +0 -105
  18. package/src/doc/components/examples/assets/tralis-live-map/s20kreis.svg +0 -101
  19. package/src/doc/components/examples/assets/tralis-live-map/s2kreis.svg +0 -95
  20. package/src/doc/components/examples/assets/tralis-live-map/s3kreis.svg +0 -95
  21. package/src/doc/components/examples/assets/tralis-live-map/s4kreis.svg +0 -95
  22. package/src/doc/components/examples/assets/tralis-live-map/s6kreis.svg +0 -95
  23. package/src/doc/components/examples/assets/tralis-live-map/s7kreis.svg +0 -95
  24. package/src/doc/components/examples/assets/tralis-live-map/s8kreis.svg +0 -93
  25. package/src/doc/components/examples/assets/tralis-live-map/unknown.svg +0 -107
  26. package/src/doc/components/examples/mb-copyright.html +0 -26
  27. package/src/doc/components/examples/mb-copyright.js +0 -37
  28. package/src/doc/components/examples/mb-tracker.html +0 -1
  29. package/src/doc/components/examples/mb-tracker.js +0 -39
  30. package/src/doc/components/examples/mb-tracker.md +0 -1
  31. package/src/doc/components/examples/mb-tralis.html +0 -1
  32. package/src/doc/components/examples/mb-tralis.js +0 -34
  33. package/src/doc/components/examples/ol-copyright.html +0 -26
  34. package/src/doc/components/examples/ol-copyright.js +0 -43
  35. package/src/doc/components/examples/ol-mapbox-layer.html +0 -1
  36. package/src/doc/components/examples/ol-mapbox-layer.js +0 -28
  37. package/src/doc/components/examples/ol-mapbox-layer.md +0 -0
  38. package/src/doc/components/examples/ol-mapbox-style-layer.html +0 -12
  39. package/src/doc/components/examples/ol-mapbox-style-layer.js +0 -44
  40. package/src/doc/components/examples/ol-query.html +0 -32
  41. package/src/doc/components/examples/ol-query.js +0 -83
  42. package/src/doc/components/examples/ol-routing.html +0 -26
  43. package/src/doc/components/examples/ol-routing.js +0 -59
  44. package/src/doc/components/examples/ol-routing.md +0 -1
  45. package/src/doc/components/examples/ol-stop-finder.html +0 -15
  46. package/src/doc/components/examples/ol-stop-finder.js +0 -31
  47. package/src/doc/components/examples/ol-stop-finder.md +0 -1
  48. package/src/doc/components/examples/ol-tracker.html +0 -1
  49. package/src/doc/components/examples/ol-tracker.js +0 -44
  50. package/src/doc/components/examples/ol-tracker.md +0 -1
  51. package/src/doc/components/examples/ol-tralis.html +0 -5
  52. package/src/doc/components/examples/ol-tralis.js +0 -57
  53. package/src/doc/components/examples/tralis-live-map.html +0 -1
  54. package/src/doc/components/examples/tralis-live-map.js +0 -51
  55. package/src/doc/components/examples/tralis-live-map.md +0 -3
@@ -1,107 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
9
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
10
- version="1.1"
11
- id="Ebene_1"
12
- x="0px"
13
- y="0px"
14
- viewBox="0 0 25 25"
15
- xml:space="preserve"
16
- width="25"
17
- height="25"
18
- sodipodi:docname="unknown.svg"
19
- inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)"><metadata
20
- id="metadata29"><rdf:RDF><cc:Work
21
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
22
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>unknown</dc:title></cc:Work></rdf:RDF></metadata><defs
23
- id="defs27" /><sodipodi:namedview
24
- pagecolor="#ffffff"
25
- bordercolor="#666666"
26
- borderopacity="1"
27
- objecttolerance="10"
28
- gridtolerance="10"
29
- guidetolerance="10"
30
- inkscape:pageopacity="0"
31
- inkscape:pageshadow="2"
32
- inkscape:window-width="2149"
33
- inkscape:window-height="1712"
34
- id="namedview25"
35
- showgrid="false"
36
- fit-margin-top="0"
37
- fit-margin-left="0"
38
- fit-margin-right="0"
39
- fit-margin-bottom="0"
40
- inkscape:zoom="5.5333333"
41
- inkscape:cx="44.1"
42
- inkscape:cy="44.1"
43
- inkscape:window-x="2391"
44
- inkscape:window-y="0"
45
- inkscape:window-maximized="0"
46
- inkscape:current-layer="g22" />
47
- <style
48
- type="text/css"
49
- id="style2">
50
- .st0{fill:#E6E6E6;}
51
- .st1{fill:#999999;}
52
- .st2{fill:#666666;}
53
- .st3{fill:#FFFFFF;}
54
- .st4{fill:none;}
55
- </style>
56
- <title
57
- id="title4">unknown</title>
58
- <g
59
- id="g22"
60
- transform="translate(-30.9,-30.9)">
61
- <g
62
- id="g10"
63
- transform="matrix(0.28344671,0,0,0.28344671,22.141497,22.141497)">
64
- <circle
65
- class="st0"
66
- cx="75"
67
- cy="75"
68
- r="42.599998"
69
- id="circle6" />
70
- <path
71
- class="st1"
72
- d="M 75,119.1 C 50.6,119.1 30.9,99.4 30.9,75 30.9,50.6 50.6,30.9 75,30.9 c 24.4,0 44.1,19.7 44.1,44.1 v 0 c 0,24.1 -19.7,43.8 -44.1,44.1 z m 0,-85.3 c -22.6,0 -41.2,18.5 -41.2,41.2 0,22.7 18.5,41.2 41.2,41.2 22.7,0 41.2,-18.5 41.2,-41.2 C 116.2,52.1 97.9,33.8 75,33.8 Z"
73
- id="path8" />
74
- </g>
75
- <path
76
- class="st2"
77
- d="m 47.566667,35.491837 h -8.333334 c -1.162131,0 -2.097505,0.907029 -2.097505,2.097505 v 11.678005 c 0,1.162131 0.907029,2.097506 2.097505,2.097506 h 8.333334 c 1.162131,0 2.097505,-0.90703 2.097505,-2.097506 V 37.560998 c 0,-1.162132 -0.935374,-2.069161 -2.097505,-2.069161 z m -7.511338,14.172335 c -0.680272,0 -1.247166,-0.595238 -1.247166,-1.247165 0,-0.680272 0.595238,-1.247166 1.247166,-1.247166 0.680272,0 1.247165,0.595238 1.247165,1.247166 0,0.651927 -0.481859,1.247165 -1.247165,1.247165 z m 6.689342,0 c -0.680272,0 -1.247165,-0.595238 -1.247165,-1.247165 0,-0.680272 0.595238,-1.247166 1.247165,-1.247166 0.680272,0 1.247166,0.595238 1.247166,1.247166 0,0.651927 -0.510204,1.247165 -1.247166,1.247165 z m 1.247166,-6.774376 c 0,0.510204 -0.42517,0.907029 -0.90703,0.907029 h -7.426304 c -0.510204,0 -0.907029,-0.42517 -0.907029,-0.907029 v -4.903628 c 0,-0.510204 0.42517,-0.90703 0.907029,-0.90703 h 7.426304 c 0.510204,0 0.90703,0.42517 0.90703,0.90703 z"
78
- id="path12"
79
- style="stroke-width:0.283447" />
80
- <circle
81
- class="st3"
82
- cx="40.055328"
83
- cy="48.38866"
84
- r="1.2471656"
85
- id="circle14"
86
- style="stroke-width:0.283447" />
87
- <circle
88
- class="st3"
89
- cx="46.744671"
90
- cy="48.38866"
91
- r="1.2471656"
92
- id="circle16"
93
- style="stroke-width:0.283447" />
94
- <path
95
- class="st3"
96
- d="m 39.743537,37.135828 h 7.426304 c 0.510204,0 0.90703,0.42517 0.90703,0.907029 v 4.931973 c 0,0.510204 -0.42517,0.907029 -0.90703,0.907029 h -7.426304 c -0.510204,0 -0.907029,-0.42517 -0.907029,-0.907029 v -4.903628 c -0.02835,-0.595238 0.396825,-0.935374 0.907029,-0.935374 z"
97
- id="path18"
98
- style="stroke-width:0.283447" />
99
- <rect
100
- class="st4"
101
- width="150"
102
- height="150"
103
- id="rect20"
104
- x="0"
105
- y="0" />
106
- </g>
107
- </svg>
@@ -1,26 +0,0 @@
1
- <style>
2
- #button,
3
- #copyright {
4
- margin: 10px 10px;
5
- }
6
-
7
- #button {
8
- position: absolute;
9
- bottom: 0;
10
- left: 0;
11
- }
12
-
13
- #copyright {
14
- position: absolute;
15
- bottom: 0;
16
- right: 0;
17
- background: rgba(255, 255, 255, 0.8);
18
- padding: 0px 5px;
19
- }
20
- </style>
21
-
22
- <div style="width: 100%; height: 100%; position: relative">
23
- <div id="map" style="width: 100%; height: 100%"></div>
24
- <button id="button" type="button" class="geops-ui">Toggle copyright</button>
25
- <div id="copyright"></div>
26
- </div>
@@ -1,37 +0,0 @@
1
- import { Map } from 'maplibre-gl';
2
- import { CopyrightControl } from '../../mapbox';
3
- import 'maplibre-gl/dist/maplibre-gl.css';
4
-
5
- export default () => {
6
- // Define the map
7
- const map = new Map({
8
- container: 'map',
9
- style: `https://maps.geops.io/styles/travic_v2/style.json?key=${window.apiKey}`,
10
- center: [7.47, 46.95],
11
- zoom: 12,
12
- attributionControl: false,
13
- });
14
-
15
- // Define a custom copyright
16
- const control = new CopyrightControl({
17
- target: document.getElementById('copyright'),
18
- element: document.createElement('div'),
19
- render() {
20
- this.element.innerHTML = this.active
21
- ? this.getCopyrights().join(' | ')
22
- : '';
23
- },
24
- });
25
-
26
- // Attach the control to the map
27
- control.map = map;
28
-
29
- // Add example button to toggle the copyright control.
30
- document.getElementById('button').addEventListener('click', () => {
31
- if (control.map) {
32
- control.map = null;
33
- } else {
34
- control.map = map;
35
- }
36
- });
37
- };
@@ -1 +0,0 @@
1
- <div id="map" style="width: 100%; height: 100%;"></div>
@@ -1,39 +0,0 @@
1
- import { Map } from 'maplibre-gl';
2
- import { TralisLayer, CopyrightControl } from '../../mapbox';
3
- import 'maplibre-gl/dist/maplibre-gl.css';
4
-
5
- export default () => {
6
- // Define the map
7
- const map = new Map({
8
- container: 'map',
9
- style: `https://maps.geops.io/styles/travic_v2/style.json?key=${window.apiKey}`,
10
- center: [7.47, 46.95],
11
- zoom: 12,
12
- touchPitch: false,
13
- pitchWithRotate: false,
14
- attributionControl: false,
15
- });
16
-
17
- const control = new CopyrightControl();
18
- control.map = map;
19
-
20
- // Define the layer
21
- const tracker = new TralisLayer({
22
- url: 'wss://api.geops.io/tracker-ws/v1/',
23
- apiKey: window.apiKey,
24
- });
25
-
26
- // Add the layer to the map
27
- tracker.init(map);
28
-
29
- // Remove the layer from the map
30
- // tracker.terminate(map);
31
-
32
- // Display informations on click in the console
33
- tracker.onClick(([feature]) => {
34
- if (feature) {
35
- // eslint-disable-next-line no-console
36
- console.log(`trajectory: ${feature.getProperties()}`);
37
- }
38
- });
39
- };
@@ -1 +0,0 @@
1
- Follow [this link](https://developer.geops.io/) to get information about the API and how to get an API key.
@@ -1 +0,0 @@
1
- <div id="map" style="width: 100%; height: 100%;"></div>
@@ -1,34 +0,0 @@
1
- import { Map } from 'maplibre-gl';
2
- import { toLonLat } from 'ol/proj';
3
- import { TralisLayer, CopyrightControl } from '../../mapbox';
4
- import 'maplibre-gl/dist/maplibre-gl.css';
5
-
6
- export default () => {
7
- const map = new Map({
8
- container: 'map',
9
- style: 'https://maps.geops.io/styles/travic_v2/style.json',
10
- apiKey: window.apiKey,
11
- center: toLonLat([1282278, 6128615]),
12
- zoom: 9,
13
- attributionControl: false,
14
- });
15
-
16
- const control = new CopyrightControl();
17
- control.map = map;
18
-
19
- const tracker = new TralisLayer({
20
- url: '',
21
- apiKey: '',
22
- });
23
-
24
- map.on('load', () => {
25
- tracker.init(map, 'waterway-name');
26
- });
27
-
28
- tracker.onClick(([feature]) => {
29
- if (feature) {
30
- // eslint-disable-next-line no-console
31
- console.log(feature.getProperties());
32
- }
33
- });
34
- };
@@ -1,26 +0,0 @@
1
- <style>
2
- #button,
3
- #copyright {
4
- margin: 10px 10px;
5
- }
6
-
7
- #button {
8
- position: absolute;
9
- bottom: 0;
10
- left: 0;
11
- }
12
-
13
- #copyright {
14
- position: absolute;
15
- bottom: 0;
16
- right: 0;
17
- background: rgba(255, 255, 255, 0.8);
18
- padding: 0px 5px;
19
- }
20
- </style>
21
-
22
- <div style="width: 100%; height: 100%; position: relative">
23
- <div id="map" style="width: 100%; height: 100%"></div>
24
- <button id="button" type="button" class="geops-ui">Toggle copyright</button>
25
- <div id="copyright"></div>
26
- </div>
@@ -1,43 +0,0 @@
1
- import { Map, View } from 'ol';
2
- import { MaplibreLayer, CopyrightControl } from '../../ol';
3
- import 'ol/ol.css';
4
-
5
- export default () => {
6
- // Define the map
7
- const map = new Map({
8
- target: 'map',
9
- view: new View({
10
- center: [0, 0],
11
- zoom: 1,
12
- }),
13
- controls: [],
14
- });
15
-
16
- // Define a custom rendering for the copyright
17
- const control = new CopyrightControl({
18
- target: document.getElementById('copyright'),
19
- element: document.createElement('div'),
20
- render() {
21
- this.element.innerHTML = this.active
22
- ? this.getCopyrights().join(' | ')
23
- : '';
24
- },
25
- });
26
-
27
- // Attach to the map
28
- control.map = map;
29
-
30
- // Define the Mapbox style to display
31
- const mapboxLayer = new MaplibreLayer({
32
- url: 'https://maps.geops.io/styles/travic_v2/style.json',
33
- apiKey: window.apiKey,
34
- });
35
-
36
- // Display the Mapbox style on the map
37
- mapboxLayer.init(map);
38
-
39
- // Toggle the copyright control.
40
- document.getElementById('button').addEventListener('click', () => {
41
- control.map = control.map ? null : map;
42
- });
43
- };
@@ -1 +0,0 @@
1
- <div id="map" style="width: 100%; height: 100%"></div>
@@ -1,28 +0,0 @@
1
- import { Map, View } from 'ol';
2
- import { MaplibreLayer, CopyrightControl } from '../../ol';
3
- import 'ol/ol.css';
4
-
5
- export default () => {
6
- // Define the map
7
- const map = new Map({
8
- target: 'map',
9
- view: new View({
10
- center: [0, 0],
11
- zoom: 1,
12
- }),
13
- controls: [],
14
- });
15
-
16
- // Add copyright control
17
- const control = new CopyrightControl();
18
- control.map = map;
19
-
20
- // Define the Mapbox style to display
21
- const layer = new MaplibreLayer({
22
- url: 'https://maps.geops.io/styles/travic_v2/style.json',
23
- apiKey: window.apiKey,
24
- });
25
-
26
- // Display the Mapbox style on the map
27
- layer.init(map);
28
- };
File without changes
@@ -1,12 +0,0 @@
1
- <style>
2
- #button {
3
- position: absolute;
4
- margin: 10px 10px;
5
- bottom: 0;
6
- left: 0;
7
- }
8
- </style>
9
- <div style="width: 100%; height: 100%; position: relative">
10
- <div id="map" style="width: 100%; height: 100%"></div>
11
- <button id="button" type="button" class="geops-ui">Hide the POIs</button>
12
- </div>
@@ -1,44 +0,0 @@
1
- import { Map, View } from 'ol';
2
- import { MaplibreLayer, MapboxStyleLayer, CopyrightControl } from '../../ol';
3
- import 'ol/ol.css';
4
-
5
- export default () => {
6
- // Define the map
7
- const map = new Map({
8
- target: 'map',
9
- view: new View({
10
- center: [950690.34, 6003962.67],
11
- zoom: 20,
12
- }),
13
- controls: [],
14
- });
15
-
16
- // Add copyright control
17
- const control = new CopyrightControl();
18
- control.map = map;
19
-
20
- // Define the Mapbox style to display
21
- const mapboxLayer = new MaplibreLayer({
22
- url: 'https://maps.geops.io/styles/travic_v2/style.json',
23
- apiKey: window.apiKey,
24
- });
25
-
26
- // Display the style on the map
27
- mapboxLayer.init(map);
28
-
29
- // Define the list of Mapbox style layers representing the pois.
30
- const poiLayer = new MapboxStyleLayer({
31
- mapboxLayer,
32
- styleLayersFilter: ({ id }) => /^poi_/.test(id),
33
- });
34
-
35
- // Display the pois on the map
36
- poiLayer.init(map);
37
-
38
- // Toggle pois visibility
39
- document.getElementById('button').addEventListener('click', (evt) => {
40
- poiLayer.setVisible(!poiLayer.visible);
41
- const { target } = evt;
42
- target.innerHTML = `${poiLayer.visible ? 'Hide' : 'Show'} the POIs`;
43
- });
44
- };
@@ -1,32 +0,0 @@
1
- <style>
2
- div#box {
3
- position: absolute;
4
- z-index: 1;
5
- top: 100px;
6
- left: 10px;
7
- width: 200px;
8
- padding: 10px;
9
- background-color: #FFFFFF;
10
- border-radius: 5px;
11
- font-family: Lato, Arial, sans-serif;
12
- color: #353535;
13
- }
14
-
15
- div#box .heading {
16
- font-weight: bold;
17
- font-size: 22px;
18
- line-height: 27px;
19
- }
20
-
21
- div#box #content {
22
- font-size: 18px;
23
- line-height: 22px;
24
- }
25
- </style>
26
- <div style="width: 100%; height: 100%; position: relative;">
27
- <div id="box">
28
- <div class="heading">Query result</div>
29
- <div id="content">Click on a feature.</div>
30
- </div>
31
- <div id="map" style="width: 100%; height: 100%;"></div>
32
- </div>
@@ -1,83 +0,0 @@
1
- import OLVectorLayer from 'ol/layer/Vector';
2
- import VectorSource from 'ol/source/Vector';
3
- import Feature from 'ol/Feature';
4
- import { Polygon } from 'ol/geom';
5
- import View from 'ol/View';
6
- import Map from 'ol/Map';
7
- import {
8
- MaplibreLayer,
9
- MapboxStyleLayer,
10
- VectorLayer,
11
- CopyrightControl,
12
- } from '../../ol';
13
- import 'ol/ol.css';
14
-
15
- export default () => {
16
- const map = new Map({
17
- target: 'map',
18
- view: new View({
19
- center: [950690.34, 6003962.67],
20
- zoom: 20,
21
- }),
22
- controls: [],
23
- });
24
-
25
- // Add copyright control
26
- const control = new CopyrightControl();
27
- control.map = map;
28
-
29
- map.on('pointermove', () => {
30
- map.getTargetElement().style.cursor = '';
31
- });
32
-
33
- const onHover = ([feature]) => {
34
- if (feature) {
35
- map.getTargetElement().style.cursor = 'pointer';
36
- }
37
- };
38
-
39
- const onClick = ([feature]) => {
40
- if (feature) {
41
- document.getElementById('content').innerHTML = feature.get('name');
42
- }
43
- };
44
-
45
- const mapboxLayer = new MaplibreLayer({
46
- url: 'https://maps.geops.io/styles/travic_v2/style.json',
47
- apiKey: window.apiKey,
48
- });
49
- mapboxLayer.init(map);
50
-
51
- const poiLayer = new MapboxStyleLayer({
52
- visible: true,
53
- mapboxLayer,
54
- styleLayersFilter: ({ id }) => /^poi_named/.test(id),
55
- onHover,
56
- onClick,
57
- });
58
- poiLayer.init(map);
59
-
60
- const vectorLayer = new VectorLayer({
61
- olLayer: new OLVectorLayer({
62
- source: new VectorSource({
63
- features: [
64
- new Feature({
65
- name: 'Rectangle',
66
- geometry: new Polygon([
67
- [
68
- [950693, 6003968],
69
- [950693, 6003936],
70
- [950760, 6003936],
71
- [950760, 6003968],
72
- [950693, 6003968],
73
- ],
74
- ]),
75
- }),
76
- ],
77
- }),
78
- }),
79
- onHover,
80
- onClick,
81
- });
82
- vectorLayer.init(map);
83
- };
@@ -1,26 +0,0 @@
1
- <style>
2
- #control-button,
3
- #mot-button,
4
- #reset-button {
5
- margin: 10px 10px;
6
- }
7
-
8
- .buttons {
9
- display: flex;
10
- }
11
- </style>
12
- <div style="width: 100%; height: 100%; position: relative;">
13
- <div id="map" style="width: 100%; height: 100%;"></div>
14
- <div class="buttons">
15
- <button id="control-button" type="button" class="geops-ui">
16
- Deactivate RoutingControl
17
- </button>
18
- <button id="mot-button" type="button" class="geops-ui">
19
- Switch to foot routing
20
- </button>
21
- <button id="reset-button" type="button" class="geops-ui">
22
- Clear route
23
- </button>
24
- </div>
25
- <div id="copyright"></div>
26
- </div>
@@ -1,59 +0,0 @@
1
- import View from 'ol/View';
2
- import Map from 'ol/Map';
3
- import { MaplibreLayer, CopyrightControl, RoutingControl } from '../../ol';
4
- import 'ol/ol.css';
5
-
6
- export default () => {
7
- const map = new Map({
8
- target: 'map',
9
- view: new View({
10
- center: [950690.34, 6003962.67],
11
- zoom: 15,
12
- }),
13
- controls: [],
14
- });
15
-
16
- const mapboxLayer = new MaplibreLayer({
17
- url: `https://maps.geops.io/styles/travic_v2/style.json?key=${window.apiKey}`,
18
- });
19
- mapboxLayer.init(map);
20
-
21
- const copyright = new CopyrightControl();
22
- copyright.map = map;
23
-
24
- const control = new RoutingControl({
25
- element: document.createElement('div'),
26
- apiKey: `${window.apiKey}`,
27
- });
28
- control.map = map;
29
-
30
- control.addViaPoint([950476.4055933182, 6003322.253698345]);
31
- control.addViaPoint([950389.0813034325, 6003656.659274571]);
32
- control.addViaPoint('29563461696e881d');
33
-
34
- // Add example button to toggle the RoutingControl.
35
- document.getElementById('control-button').addEventListener('click', (e) => {
36
- e.target.innerHTML = control.active
37
- ? 'Activate RoutingControl'
38
- : 'Deactivate RoutingControl';
39
- if (control.active) {
40
- control.active = false;
41
- } else {
42
- control.active = true;
43
- }
44
- });
45
-
46
- // Add example button to toggle the RoutingControl mot.
47
- document.getElementById('mot-button').addEventListener('click', (e) => {
48
- e.target.innerHTML =
49
- control.mot === 'bus'
50
- ? 'Switch to bus routing'
51
- : 'Switch to foot routing';
52
- control.mot = control.mot === 'bus' ? 'foot' : 'bus';
53
- });
54
-
55
- // Add example button to toggle the RoutingControl mot.
56
- document.getElementById('reset-button').addEventListener('click', () => {
57
- control.reset();
58
- });
59
- };
@@ -1 +0,0 @@
1
- Follow [this link](https://developer.geops.io/) to get information about the API and how to get an API key.
@@ -1,15 +0,0 @@
1
- <style>
2
-
3
- #mbt-search > div > div:hover {
4
- background-color: lightgray;
5
- }
6
-
7
- #mbt-search {
8
- max-height: 90%;
9
- }
10
-
11
- </style>
12
-
13
- <div style="width: 100%; height: 100%; position: relative;">
14
- <div id="map" style="width: 100%; height: 100%;"></div>
15
- </div>
@@ -1,31 +0,0 @@
1
- import View from 'ol/View';
2
- import Map from 'ol/Map';
3
- import { MapboxLayer, CopyrightControl, StopFinderControl } from '../../ol';
4
- import 'ol/ol.css';
5
-
6
- export default () => {
7
- const map = new Map({
8
- target: 'map',
9
- view: new View({
10
- center: [950690.34, 6003962.67],
11
- zoom: 15,
12
- }),
13
- controls: [],
14
- });
15
-
16
- const copyright = new CopyrightControl();
17
- copyright.map = map;
18
-
19
- const stopFinder = new StopFinderControl({
20
- apiKey: window.apiKey,
21
- });
22
- stopFinder.map = map;
23
-
24
- const mapboxLayer = new MapboxLayer({
25
- url: 'https://maps.geops.io/styles/travic_v2/style.json',
26
- apiKey: window.apiKey,
27
- });
28
- mapboxLayer.init(map);
29
-
30
- map.on('singleclick', () => stopFinder.clear());
31
- };
@@ -1 +0,0 @@
1
- Follow [this link](https://developer.geops.io/) to get information about the API and how to get an API key.
@@ -1 +0,0 @@
1
- <div id="map" style="width: 100%; height: 100%;"></div>