mobility-toolbox-js 2.0.0-beta.6 → 2.0.0-beta.60
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/README.md +29 -8
- package/api/RealtimeAPI.d.ts +279 -0
- package/api/RealtimeAPI.d.ts.map +1 -0
- package/api/RealtimeAPI.js +462 -0
- package/api/RoutingAPI.d.ts +37 -0
- package/api/RoutingAPI.d.ts.map +1 -0
- package/api/RoutingAPI.js +35 -0
- package/api/StopsAPI.d.ts +38 -0
- package/api/StopsAPI.d.ts.map +1 -0
- package/api/StopsAPI.js +36 -0
- package/api/index.d.ts +4 -0
- package/api/index.d.ts.map +1 -0
- package/api/index.js +3 -0
- package/api/typedefs.d.ts +179 -0
- package/api/typedefs.d.ts.map +1 -0
- package/{src/api/tralis → api}/typedefs.js +4 -10
- package/common/api/HttpAPI.d.ts +31 -0
- package/common/api/HttpAPI.d.ts.map +1 -0
- package/common/api/HttpAPI.js +57 -0
- package/common/api/WebSocketAPI.d.ts +153 -0
- package/common/api/WebSocketAPI.d.ts.map +1 -0
- package/common/api/WebSocketAPI.js +328 -0
- package/common/controls/ControlCommon.d.ts +76 -0
- package/common/controls/ControlCommon.d.ts.map +1 -0
- package/common/controls/ControlCommon.js +150 -0
- package/common/controls/CopyrightControlCommon.d.ts +13 -0
- package/common/controls/CopyrightControlCommon.d.ts.map +1 -0
- package/common/controls/CopyrightControlCommon.js +34 -0
- package/common/controls/StopFinderControlCommon.d.ts +55 -0
- package/common/controls/StopFinderControlCommon.d.ts.map +1 -0
- package/common/controls/StopFinderControlCommon.js +144 -0
- package/common/index.d.ts +3 -0
- package/common/index.d.ts.map +1 -0
- package/common/index.js +2 -0
- package/common/layers/LayerCommon.d.ts +94 -0
- package/common/layers/LayerCommon.d.ts.map +1 -0
- package/common/layers/LayerCommon.js +244 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +289 -0
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
- package/common/mixins/RealtimeLayerMixin.js +746 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts +60 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
- package/common/mixins/UserInteractionsLayerMixin.js +241 -0
- package/common/styles/index.d.ts +5 -0
- package/common/styles/index.d.ts.map +1 -0
- package/common/styles/index.js +4 -0
- package/common/styles/realtimeDefaultStyle.d.ts +36 -0
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.js +261 -0
- package/{src/common/styles/trackerDelayStyle.js → common/styles/realtimeDelayStyle.d.ts} +4 -9
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
- package/common/styles/realtimeDelayStyle.js +13 -0
- package/common/styles/realtimeSimpleStyle.d.ts +4 -0
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
- package/common/styles/realtimeSimpleStyle.js +24 -0
- package/common/typedefs.d.ts +111 -0
- package/common/typedefs.d.ts.map +1 -0
- package/common/typedefs.js +52 -0
- package/common/utils/compareDepartures.d.ts +11 -0
- package/common/utils/compareDepartures.d.ts.map +1 -0
- package/common/utils/compareDepartures.js +35 -0
- package/common/utils/createCanvas.d.ts +10 -0
- package/common/utils/createCanvas.d.ts.map +1 -0
- package/common/utils/createCanvas.js +27 -0
- package/common/utils/createRealtimeFilters.d.ts +13 -0
- package/common/utils/createRealtimeFilters.d.ts.map +1 -0
- package/common/utils/createRealtimeFilters.js +74 -0
- package/common/utils/debounceDeparturesMessages.d.ts +12 -0
- package/common/utils/debounceDeparturesMessages.d.ts.map +1 -0
- package/common/utils/debounceDeparturesMessages.js +24 -0
- package/common/utils/debounceWebsocketMessages.d.ts +11 -0
- package/common/utils/debounceWebsocketMessages.d.ts.map +1 -0
- package/common/utils/debounceWebsocketMessages.js +29 -0
- package/common/utils/getLayersAsFlatArray.d.ts +3 -0
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
- package/common/utils/getLayersAsFlatArray.js +15 -0
- package/common/utils/getMapboxMapCopyrights.d.ts +18 -0
- package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
- package/common/utils/getMapboxMapCopyrights.js +30 -0
- package/common/utils/getMapboxRender.d.ts +7 -0
- package/common/utils/getMapboxRender.d.ts.map +1 -0
- package/common/utils/getMapboxRender.js +87 -0
- package/common/utils/getMaplibreRender.d.ts +7 -0
- package/common/utils/getMaplibreRender.d.ts.map +1 -0
- package/common/utils/getMaplibreRender.js +38 -0
- package/common/utils/getRealtimeModeSuffix.d.ts +10 -0
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
- package/common/utils/getRealtimeModeSuffix.js +7 -0
- package/common/utils/getUrlWithParams.d.ts +9 -0
- package/common/utils/getUrlWithParams.d.ts.map +1 -0
- package/common/utils/getUrlWithParams.js +18 -0
- package/common/utils/getVehiclePosition.d.ts +16 -0
- package/common/utils/getVehiclePosition.d.ts.map +1 -0
- package/common/utils/getVehiclePosition.js +63 -0
- package/common/utils/index.d.ts +16 -0
- package/common/utils/index.d.ts.map +1 -0
- package/common/utils/index.js +16 -0
- package/common/utils/realtimeConfig.d.ts +49 -0
- package/common/utils/realtimeConfig.d.ts.map +1 -0
- package/common/utils/realtimeConfig.js +173 -0
- package/common/utils/removeDuplicate.d.ts +10 -0
- package/common/utils/removeDuplicate.d.ts.map +1 -0
- package/common/utils/removeDuplicate.js +15 -0
- package/common/utils/renderTrajectories.d.ts +17 -0
- package/common/utils/renderTrajectories.d.ts.map +1 -0
- package/common/utils/renderTrajectories.js +121 -0
- package/common/utils/sortAndFilterDepartures.d.ts +16 -0
- package/common/utils/sortAndFilterDepartures.d.ts.map +1 -0
- package/common/utils/sortAndFilterDepartures.js +58 -0
- package/common/utils/sortByDelay.d.ts +3 -0
- package/common/utils/sortByDelay.d.ts.map +1 -0
- package/common/utils/sortByDelay.js +20 -0
- package/common/utils/timeUtils.d.ts +24 -0
- package/common/utils/timeUtils.d.ts.map +1 -0
- package/{src/common → common}/utils/timeUtils.js +13 -18
- package/iife.d.ts +3 -0
- package/iife.d.ts.map +1 -0
- package/{src/iife.js → iife.js} +2 -4
- package/index.d.ts +10 -0
- package/index.d.ts.map +1 -0
- package/index.js +10 -0
- package/mapbox/controls/CopyrightControl.d.ts +29 -0
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
- package/mapbox/controls/CopyrightControl.js +48 -0
- package/mapbox/controls/index.d.ts +2 -0
- package/mapbox/controls/index.d.ts.map +1 -0
- package/mapbox/controls/index.js +2 -0
- package/mapbox/index.d.ts +6 -0
- package/mapbox/index.d.ts.map +1 -0
- package/mapbox/index.js +5 -0
- package/mapbox/layers/Layer.d.ts +59 -0
- package/mapbox/layers/Layer.d.ts.map +1 -0
- package/mapbox/layers/Layer.js +101 -0
- package/mapbox/layers/RealtimeLayer.d.ts +180 -0
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
- package/mapbox/layers/RealtimeLayer.js +276 -0
- package/mapbox/layers/index.d.ts +3 -0
- package/mapbox/layers/index.d.ts.map +1 -0
- package/mapbox/layers/index.js +2 -0
- package/mapbox/utils/getMercatorResolution.d.ts +9 -0
- package/mapbox/utils/getMercatorResolution.d.ts.map +1 -0
- package/mapbox/utils/getMercatorResolution.js +18 -0
- package/mapbox/utils/getSourceCoordinates.d.ts +9 -0
- package/mapbox/utils/getSourceCoordinates.d.ts.map +1 -0
- package/mapbox/utils/getSourceCoordinates.js +27 -0
- package/mapbox/utils/index.d.ts +3 -0
- package/mapbox/utils/index.d.ts.map +1 -0
- package/mapbox/utils/index.js +2 -0
- package/mbt.js +50785 -0
- package/mbt.js.map +7 -0
- package/mbt.min.js +1083 -0
- package/mbt.min.js.map +7 -0
- package/ol/controls/CopyrightControl.d.ts +31 -0
- package/ol/controls/CopyrightControl.d.ts.map +1 -0
- package/ol/controls/CopyrightControl.js +68 -0
- package/ol/controls/RoutingControl.d.ts +193 -0
- package/ol/controls/RoutingControl.d.ts.map +1 -0
- package/ol/controls/RoutingControl.js +632 -0
- package/ol/controls/StopFinderControl.d.ts +30 -0
- package/ol/controls/StopFinderControl.d.ts.map +1 -0
- package/{src/ol → ol}/controls/StopFinderControl.js +10 -16
- package/ol/controls/index.d.ts +4 -0
- package/ol/controls/index.d.ts.map +1 -0
- package/ol/controls/index.js +3 -0
- package/ol/index.d.ts +6 -0
- package/ol/index.d.ts.map +1 -0
- package/ol/index.js +5 -0
- package/ol/layers/Layer.d.ts +86 -0
- package/ol/layers/Layer.d.ts.map +1 -0
- package/ol/layers/Layer.js +159 -0
- package/ol/layers/MapGlLayer.d.ts +67 -0
- package/ol/layers/MapGlLayer.d.ts.map +1 -0
- package/ol/layers/MapGlLayer.js +218 -0
- package/ol/layers/MapboxLayer.d.ts +50 -0
- package/ol/layers/MapboxLayer.d.ts.map +1 -0
- package/ol/layers/MapboxLayer.js +109 -0
- package/ol/layers/MapboxStyleLayer.d.ts +129 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.js +374 -0
- package/ol/layers/MaplibreLayer.d.ts +28 -0
- package/ol/layers/MaplibreLayer.d.ts.map +1 -0
- package/ol/layers/MaplibreLayer.js +34 -0
- package/ol/layers/RealtimeLayer.d.ts +201 -0
- package/ol/layers/RealtimeLayer.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.js +310 -0
- package/ol/layers/RoutingLayer.d.ts +34 -0
- package/ol/layers/RoutingLayer.d.ts.map +1 -0
- package/ol/layers/RoutingLayer.js +85 -0
- package/ol/layers/VectorLayer.d.ts +25 -0
- package/ol/layers/VectorLayer.d.ts.map +1 -0
- package/ol/layers/VectorLayer.js +38 -0
- package/ol/layers/WMSLayer.d.ts +42 -0
- package/ol/layers/WMSLayer.d.ts.map +1 -0
- package/ol/layers/WMSLayer.js +88 -0
- package/ol/layers/index.d.ts +9 -0
- package/ol/layers/index.d.ts.map +1 -0
- package/ol/layers/index.js +8 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryDelayStyle.js +33 -0
- package/ol/styles/fullTrajectoryStyle.d.ts +5 -0
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryStyle.js +44 -0
- package/ol/styles/index.d.ts +3 -0
- package/ol/styles/index.d.ts.map +1 -0
- package/{src/ol → ol}/styles/index.js +0 -0
- package/package.json +71 -126
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/{src/setupTests.js → setupTests.js} +0 -2
- package/types/common.d.ts +118 -0
- package/types/index.d.ts +11 -0
- package/types/realtime.d.ts +315 -0
- package/types/routing.d.ts +206 -0
- package/types/stops.d.ts +143 -0
- package/.babelrc +0 -6
- package/.esdoc.json +0 -17
- package/.eslintignore +0 -1
- package/.github/workflows/conventional-pr-title.yml +0 -21
- package/.github/workflows/cypress.yml +0 -29
- package/.github/workflows/nodejs.yml +0 -28
- package/.husky/commit-msg +0 -4
- package/.husky/post-checkout +0 -4
- package/.husky/post-merge +0 -4
- package/.husky/post-rebase +0 -4
- package/.husky/pre-commit +0 -4
- package/.neutrinorc.js +0 -176
- package/.nvmrc +0 -1
- package/CHANGELOG.md +0 -10
- package/LICENSE +0 -21
- package/Layer.js +0 -2
- package/Layer.js.map +0 -7
- package/__mocks__/mapbox-gl.js +0 -81
- package/__mocks__/maplibre-gl.js +0 -81
- package/commitlint.config.js +0 -1
- package/cypress/fixtures/example.json +0 -5
- package/cypress/integration/examples/api.spec.js +0 -7
- package/cypress/integration/examples/examples.spec.js +0 -7
- package/cypress/integration/examples/navigation.spec.js +0 -29
- package/cypress/plugins/index.js +0 -21
- package/cypress/support/commands.js +0 -25
- package/cypress/support/index.js +0 -20
- package/cypress.json +0 -4
- package/data/fetchRoute.json +0 -292
- package/data/fetchTrajectories.json +0 -18
- package/data/fetchTrajectoryById.json +0 -3
- package/data/fetchTrajectoryStations.json +0 -18
- package/data/stopsSearch.json +0 -15
- package/documentation.yml +0 -4
- package/esdoc/README.md +0 -27
- package/esdoc/plugins/MyPlugin.js +0 -69
- package/esdoc/plugins/dynamic-property-plugin/Plugin.js +0 -50
- package/esdoc/plugins/externals-plugin/Plugin.js +0 -45
- package/esdoc/plugins/externals-plugin/externals.js +0 -96
- package/global-setup.js +0 -3
- package/index.html +0 -0
- package/indexweb.html +0 -49
- package/jest.config.js +0 -5
- package/pull_request_template.md +0 -17
- package/renovate.json +0 -4
- package/scripts/read-pkg-json.js +0 -22
- package/src/api/index.js +0 -3
- package/src/api/routing/RoutingAPI.js +0 -44
- package/src/api/routing/RoutingAPI.test.js +0 -41
- package/src/api/stops/StopsAPI.js +0 -41
- package/src/api/stops/StopsAPI.test.js +0 -34
- package/src/api/tralis/TralisAPI.js +0 -731
- package/src/api/tralis/TralisAPI.test.js +0 -75
- package/src/api/tralis/TralisAPIUtils.js +0 -73
- package/src/api/tralis/WebSocketConnector.js +0 -338
- package/src/api/tralis/WebSocketConnector.test.js +0 -356
- package/src/assets/Lato-Black.ttf +0 -0
- package/src/assets/Lato-BlackItalic.ttf +0 -0
- package/src/assets/Lato-Bold.ttf +0 -0
- package/src/assets/Lato-BoldItalic.ttf +0 -0
- package/src/assets/Lato-Italic.ttf +0 -0
- package/src/assets/Lato-Light.ttf +0 -0
- package/src/assets/Lato-LightItalic.ttf +0 -0
- package/src/assets/Lato-Regular.ttf +0 -0
- package/src/assets/Lato-Thin.ttf +0 -0
- package/src/assets/Lato-ThinItalic.ttf +0 -0
- package/src/assets/OFL.txt +0 -93
- package/src/common/Tracker.js +0 -197
- package/src/common/api/api.js +0 -64
- package/src/common/api/api.test.js +0 -68
- package/src/common/controls/Control.js +0 -146
- package/src/common/controls/Control.test.js +0 -98
- package/src/common/layers/Layer.js +0 -404
- package/src/common/layers/Layer.test.js +0 -585
- package/src/common/mixins/CopyrightMixin.js +0 -48
- package/src/common/mixins/SearchMixin.js +0 -176
- package/src/common/mixins/TralisLayerMixin.js +0 -930
- package/src/common/styles/index.js +0 -4
- package/src/common/styles/trackerDefaultStyle.js +0 -333
- package/src/common/styles/trackerSimpleStyle.js +0 -22
- package/src/common/trackerConfig.js +0 -190
- package/src/common/trackerConfig.test.js +0 -25
- package/src/common/typedefs.js +0 -23
- package/src/common/utils/createTrackerFilters.js +0 -87
- package/src/common/utils/createTrackerFilters.test.js +0 -95
- package/src/common/utils/getMapboxMapCopyrights.js +0 -32
- package/src/common/utils/getMapboxMapCopyrights.test.js +0 -47
- package/src/common/utils/getMapboxStyleUrl.js +0 -32
- package/src/common/utils/getVehiclePosition.js +0 -72
- package/src/common/utils/index.js +0 -6
- package/src/common/utils/removeDuplicate.js +0 -22
- package/src/common/utils/removeDuplicate.test.js +0 -22
- package/src/common/utils/sortByDelay.js +0 -23
- package/src/common/utils/timeUtils.test.js +0 -16
- package/src/doc/App.js +0 -116
- package/src/doc/App.scss +0 -51
- package/src/doc/_redirects +0 -2
- package/src/doc/components/CodeSandboxButton.js +0 -103
- package/src/doc/components/Documentation.js +0 -40
- package/src/doc/components/Esdoc/Anchor.js +0 -57
- package/src/doc/components/Esdoc/ClassDoc.js +0 -272
- package/src/doc/components/Esdoc/DeprecatedHTML.js +0 -16
- package/src/doc/components/Esdoc/DetailDocs.js +0 -281
- package/src/doc/components/Esdoc/DetailHTML.js +0 -33
- package/src/doc/components/Esdoc/DirectSubclassHTML.js +0 -30
- package/src/doc/components/Esdoc/DocBuilderUtils.js +0 -694
- package/src/doc/components/Esdoc/DocLinkHTML.js +0 -62
- package/src/doc/components/Esdoc/DocsLinkHTML.js +0 -38
- package/src/doc/components/Esdoc/Esdoc.js +0 -63
- package/src/doc/components/Esdoc/EsdocContent.js +0 -51
- package/src/doc/components/Esdoc/EsdocNavigation.js +0 -13
- package/src/doc/components/Esdoc/EsdocSearch.js +0 -81
- package/src/doc/components/Esdoc/ExperimentalHTML.js +0 -17
- package/src/doc/components/Esdoc/ExtendsChainHTML.js +0 -32
- package/src/doc/components/Esdoc/FileDocLinkHTML.js +0 -60
- package/src/doc/components/Esdoc/IdentifiersDoc.js +0 -113
- package/src/doc/components/Esdoc/IndirectSubclassHTML.js +0 -30
- package/src/doc/components/Esdoc/InheritedSummaryDoc.js +0 -70
- package/src/doc/components/Esdoc/InheritedSummaryHTML.js +0 -38
- package/src/doc/components/Esdoc/MixinClassesHTML.js +0 -29
- package/src/doc/components/Esdoc/NavDoc.js +0 -112
- package/src/doc/components/Esdoc/OverrideMethod.js +0 -44
- package/src/doc/components/Esdoc/OverrideMethodDescription.js +0 -35
- package/src/doc/components/Esdoc/Properties.js +0 -89
- package/src/doc/components/Esdoc/README.md +0 -45
- package/src/doc/components/Esdoc/SignatureHTML.js +0 -123
- package/src/doc/components/Esdoc/SingleDoc.js +0 -31
- package/src/doc/components/Esdoc/SummaryDoc.js +0 -160
- package/src/doc/components/Esdoc/SummaryHTML.js +0 -96
- package/src/doc/components/Esdoc/TypeDocLinkHTML.js +0 -249
- package/src/doc/components/Esdoc/css/identifiers.css +0 -38
- package/src/doc/components/Esdoc/css/search.css +0 -76
- package/src/doc/components/Esdoc/css/style.css +0 -603
- package/src/doc/components/Esdoc/index.js +0 -7
- package/src/doc/components/Example.js +0 -153
- package/src/doc/components/Examples.js +0 -183
- package/src/doc/components/Home.js +0 -106
- package/src/doc/components/TrackerExample.js +0 -38
- package/src/doc/components/esm.min.js +0 -2
- package/src/doc/components/examples/assets/tralis-live-map/index.js +0 -11
- package/src/doc/components/examples/assets/tralis-live-map/s1kreis.svg +0 -105
- package/src/doc/components/examples/assets/tralis-live-map/s20kreis.svg +0 -101
- package/src/doc/components/examples/assets/tralis-live-map/s2kreis.svg +0 -95
- package/src/doc/components/examples/assets/tralis-live-map/s3kreis.svg +0 -95
- package/src/doc/components/examples/assets/tralis-live-map/s4kreis.svg +0 -95
- package/src/doc/components/examples/assets/tralis-live-map/s6kreis.svg +0 -95
- package/src/doc/components/examples/assets/tralis-live-map/s7kreis.svg +0 -95
- package/src/doc/components/examples/assets/tralis-live-map/s8kreis.svg +0 -93
- package/src/doc/components/examples/assets/tralis-live-map/unknown.svg +0 -107
- package/src/doc/components/examples/mb-copyright.html +0 -26
- package/src/doc/components/examples/mb-copyright.js +0 -37
- package/src/doc/components/examples/mb-tracker.html +0 -1
- package/src/doc/components/examples/mb-tracker.js +0 -39
- package/src/doc/components/examples/mb-tracker.md +0 -1
- package/src/doc/components/examples/mb-tralis.html +0 -1
- package/src/doc/components/examples/mb-tralis.js +0 -34
- package/src/doc/components/examples/ol-copyright.html +0 -26
- package/src/doc/components/examples/ol-copyright.js +0 -43
- package/src/doc/components/examples/ol-mapbox-layer.html +0 -1
- package/src/doc/components/examples/ol-mapbox-layer.js +0 -28
- package/src/doc/components/examples/ol-mapbox-layer.md +0 -0
- package/src/doc/components/examples/ol-mapbox-style-layer.html +0 -12
- package/src/doc/components/examples/ol-mapbox-style-layer.js +0 -44
- package/src/doc/components/examples/ol-query.html +0 -32
- package/src/doc/components/examples/ol-query.js +0 -83
- package/src/doc/components/examples/ol-routing.html +0 -26
- package/src/doc/components/examples/ol-routing.js +0 -59
- package/src/doc/components/examples/ol-routing.md +0 -1
- package/src/doc/components/examples/ol-stop-finder.html +0 -15
- package/src/doc/components/examples/ol-stop-finder.js +0 -31
- package/src/doc/components/examples/ol-stop-finder.md +0 -1
- package/src/doc/components/examples/ol-tracker.html +0 -1
- package/src/doc/components/examples/ol-tracker.js +0 -44
- package/src/doc/components/examples/ol-tracker.md +0 -1
- package/src/doc/components/examples/ol-tralis.html +0 -5
- package/src/doc/components/examples/ol-tralis.js +0 -57
- package/src/doc/components/examples/tralis-live-map.html +0 -1
- package/src/doc/components/examples/tralis-live-map.js +0 -51
- package/src/doc/components/examples/tralis-live-map.md +0 -3
- package/src/doc/examples/assets/tralis-live-map/index.js +0 -11
- package/src/doc/examples/assets/tralis-live-map/s1kreis.svg +0 -105
- package/src/doc/examples/assets/tralis-live-map/s20kreis.svg +0 -101
- package/src/doc/examples/assets/tralis-live-map/s2kreis.svg +0 -95
- package/src/doc/examples/assets/tralis-live-map/s3kreis.svg +0 -95
- package/src/doc/examples/assets/tralis-live-map/s4kreis.svg +0 -95
- package/src/doc/examples/assets/tralis-live-map/s6kreis.svg +0 -95
- package/src/doc/examples/assets/tralis-live-map/s7kreis.svg +0 -95
- package/src/doc/examples/assets/tralis-live-map/s8kreis.svg +0 -93
- package/src/doc/examples/assets/tralis-live-map/unknown.svg +0 -107
- package/src/doc/examples/mb-copyright.html +0 -26
- package/src/doc/examples/mb-copyright.js +0 -37
- package/src/doc/examples/mb-tracker.html +0 -1
- package/src/doc/examples/mb-tracker.js +0 -39
- package/src/doc/examples/mb-tracker.md +0 -1
- package/src/doc/examples/mb-tralis.html +0 -1
- package/src/doc/examples/mb-tralis.js +0 -34
- package/src/doc/examples/ol-copyright.html +0 -26
- package/src/doc/examples/ol-copyright.js +0 -43
- package/src/doc/examples/ol-mapbox-layer.html +0 -1
- package/src/doc/examples/ol-mapbox-layer.js +0 -28
- package/src/doc/examples/ol-mapbox-layer.md +0 -0
- package/src/doc/examples/ol-mapbox-style-layer.html +0 -12
- package/src/doc/examples/ol-mapbox-style-layer.js +0 -44
- package/src/doc/examples/ol-query.html +0 -32
- package/src/doc/examples/ol-query.js +0 -83
- package/src/doc/examples/ol-routing.html +0 -26
- package/src/doc/examples/ol-routing.js +0 -59
- package/src/doc/examples/ol-routing.md +0 -1
- package/src/doc/examples/ol-stop-finder.html +0 -15
- package/src/doc/examples/ol-stop-finder.js +0 -31
- package/src/doc/examples/ol-stop-finder.md +0 -1
- package/src/doc/examples/ol-tracker.html +0 -1
- package/src/doc/examples/ol-tracker.js +0 -44
- package/src/doc/examples/ol-tracker.md +0 -1
- package/src/doc/examples/ol-tralis.html +0 -5
- package/src/doc/examples/ol-tralis.js +0 -57
- package/src/doc/examples/tralis-live-map.html +0 -1
- package/src/doc/examples/tralis-live-map.js +0 -51
- package/src/doc/examples/tralis-live-map.md +0 -3
- package/src/doc/examples.js +0 -107
- package/src/doc/img/examples/live_tracker_mb.jpg +0 -0
- package/src/doc/img/examples/live_tracker_munich.jpg +0 -0
- package/src/doc/img/examples/live_tracker_ol.jpg +0 -0
- package/src/doc/img/examples/mapbox.jpg +0 -0
- package/src/doc/img/examples/mapbox_style.jpg +0 -0
- package/src/doc/img/examples/ol-copyright.png +0 -0
- package/src/doc/img/examples/query_objects.jpg +0 -0
- package/src/doc/img/examples/routing.jpg +0 -0
- package/src/doc/img/examples/simple_map.jpg +0 -0
- package/src/doc/img/examples/stops.jpg +0 -0
- package/src/doc/img/favico.ico +0 -0
- package/src/doc/index.js +0 -21
- package/src/index.js +0 -25
- package/src/mapbox/controls/CopyrightControl.js +0 -58
- package/src/mapbox/index.js +0 -3
- package/src/mapbox/layers/Layer.js +0 -118
- package/src/mapbox/layers/Layer.test.js +0 -202
- package/src/mapbox/layers/TralisLayer.js +0 -329
- package/src/mapbox/layers/TralisLayer.test.js +0 -40
- package/src/mapbox/utils.js +0 -46
- package/src/ol/README.md +0 -0
- package/src/ol/controls/CopyrightControl.js +0 -80
- package/src/ol/controls/CopyrightControl.test.js +0 -211
- package/src/ol/controls/RoutingControl.js +0 -752
- package/src/ol/controls/RoutingControl.test.js +0 -216
- package/src/ol/controls/StopFinderControl.test.js +0 -59
- package/src/ol/controls/snapshots/RoutingControlRouteGen10.json +0 -58
- package/src/ol/controls/snapshots/RoutingControlRouteGen100.json +0 -292
- package/src/ol/controls/snapshots/RoutingControlRouteGen30.json +0 -69
- package/src/ol/controls/snapshots/RoutingControlRouteGen5.json +0 -58
- package/src/ol/controls/snapshots/RoutingControlRouteOSM.json +0 -759
- package/src/ol/controls/snapshots/RoutingControlStation1.json +0 -60
- package/src/ol/controls/snapshots/RoutingControlStation2.json +0 -49
- package/src/ol/index.js +0 -13
- package/src/ol/layers/Layer.js +0 -193
- package/src/ol/layers/Layer.test.js +0 -197
- package/src/ol/layers/MapboxLayer.js +0 -378
- package/src/ol/layers/MapboxLayer.test.js +0 -186
- package/src/ol/layers/MapboxStyleLayer.js +0 -417
- package/src/ol/layers/MapboxStyleLayer.test.js +0 -262
- package/src/ol/layers/MaplibreLayer.js +0 -280
- package/src/ol/layers/RoutingLayer.js +0 -91
- package/src/ol/layers/RoutingLayer.test.js +0 -49
- package/src/ol/layers/TralisLayer.js +0 -359
- package/src/ol/layers/TralisLayer.test.js +0 -97
- package/src/ol/layers/VectorLayer.js +0 -43
- package/src/ol/layers/VectorLayer.test.js +0 -98
- package/src/ol/layers/WMSLayer.js +0 -80
- package/src/ol/layers/WMSLayer.test.js +0 -84
- package/src/ol/styles/fullTrajectoryDelayStyle.js +0 -35
- package/src/ol/styles/fullTrajectoryStyle.js +0 -51
- package/webpack.config.js +0 -6
package/types/stops.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface Paths {
|
|
7
|
+
'/': {
|
|
8
|
+
/** Returns a stop (or multiple) as GeoJSON FeatureCollection */
|
|
9
|
+
get: {
|
|
10
|
+
parameters: {
|
|
11
|
+
query: {
|
|
12
|
+
/** Control how many matches will be returned */
|
|
13
|
+
limit?: number;
|
|
14
|
+
/** Anything you'd like to search for */
|
|
15
|
+
q: string;
|
|
16
|
+
/**
|
|
17
|
+
* comma seperated list, order chooses which agency will be preferred
|
|
18
|
+
* as ident_source (for id and code fields)
|
|
19
|
+
*/
|
|
20
|
+
prefagencies?: 'sbb' | 'db';
|
|
21
|
+
/**
|
|
22
|
+
* comma seperated list of mot's which should be available
|
|
23
|
+
* at the stop
|
|
24
|
+
*/
|
|
25
|
+
mots?:
|
|
26
|
+
| 'bus'
|
|
27
|
+
| 'ferry'
|
|
28
|
+
| 'gondola'
|
|
29
|
+
| 'tram'
|
|
30
|
+
| 'rail'
|
|
31
|
+
| 'funicular'
|
|
32
|
+
| 'cable_car'
|
|
33
|
+
| 'subway';
|
|
34
|
+
/**
|
|
35
|
+
* left,bottom,right,up coordinates in WGS84 wherein the
|
|
36
|
+
* station should lie
|
|
37
|
+
*/
|
|
38
|
+
bbox?: string;
|
|
39
|
+
/** which field to look up, default: all of them */
|
|
40
|
+
field?: 'id' | 'name' | 'coords';
|
|
41
|
+
/**
|
|
42
|
+
* Coordinates in WGS84 (in lat,lon order) used to rank stops close to
|
|
43
|
+
* this position higher
|
|
44
|
+
*/
|
|
45
|
+
ref_location?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
responses: {
|
|
49
|
+
/** stop(s) */
|
|
50
|
+
200: {
|
|
51
|
+
schema: {
|
|
52
|
+
/** @enum {string} */
|
|
53
|
+
type?: 'FeatureCollection';
|
|
54
|
+
features?: {
|
|
55
|
+
/** @enum {string} */
|
|
56
|
+
type?: 'Feature';
|
|
57
|
+
properties?: {
|
|
58
|
+
/** @description internal ID */
|
|
59
|
+
uid?: string;
|
|
60
|
+
/**
|
|
61
|
+
* @description name of the stop
|
|
62
|
+
* @example Bern
|
|
63
|
+
*/
|
|
64
|
+
name?: string;
|
|
65
|
+
/**
|
|
66
|
+
* @description 2 letter country code where the station is located
|
|
67
|
+
* @example CH
|
|
68
|
+
*/
|
|
69
|
+
country_code?: string;
|
|
70
|
+
/**
|
|
71
|
+
* @description how well the result matches your query, 0
|
|
72
|
+
* means best
|
|
73
|
+
*/
|
|
74
|
+
rank?: number;
|
|
75
|
+
/**
|
|
76
|
+
* @description array of translations of the stopname
|
|
77
|
+
* @default []
|
|
78
|
+
*/
|
|
79
|
+
translated_names?: {
|
|
80
|
+
value?: string;
|
|
81
|
+
/** @enum {string} */
|
|
82
|
+
language?: 'de' | 'en' | 'fr' | 'it';
|
|
83
|
+
}[];
|
|
84
|
+
/** @description Means of transport that are available at this station */
|
|
85
|
+
mot?: {
|
|
86
|
+
bus?: boolean;
|
|
87
|
+
ferry?: boolean;
|
|
88
|
+
gondola?: boolean;
|
|
89
|
+
tram?: boolean;
|
|
90
|
+
rail?: boolean;
|
|
91
|
+
funicular?: boolean;
|
|
92
|
+
cable_car?: boolean;
|
|
93
|
+
subway?: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* @description source agency for id and code (see below)
|
|
97
|
+
* @example sbb
|
|
98
|
+
*/
|
|
99
|
+
ident_source?: string;
|
|
100
|
+
/**
|
|
101
|
+
* @description uic number
|
|
102
|
+
* @example 8507000
|
|
103
|
+
*/
|
|
104
|
+
id?: string;
|
|
105
|
+
/**
|
|
106
|
+
* @description Abbreviation code from the transport agency (e.g. DS100 for Deutsche Bahn)
|
|
107
|
+
*
|
|
108
|
+
* @example BN
|
|
109
|
+
*/
|
|
110
|
+
code?: string;
|
|
111
|
+
/** @description ifopt identifier, if available */
|
|
112
|
+
ifopt?: string;
|
|
113
|
+
};
|
|
114
|
+
/** @description the coordinates of the stop */
|
|
115
|
+
geometry?: {
|
|
116
|
+
/** @enum {string} */
|
|
117
|
+
type?: 'Point';
|
|
118
|
+
/**
|
|
119
|
+
* @example [
|
|
120
|
+
* 7.439119,
|
|
121
|
+
* 46.94882
|
|
122
|
+
* ]
|
|
123
|
+
*/
|
|
124
|
+
coordinates?: number[];
|
|
125
|
+
};
|
|
126
|
+
}[];
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
/** limit parameter too high */
|
|
130
|
+
400: {
|
|
131
|
+
schema: {
|
|
132
|
+
/** @enum {string} */
|
|
133
|
+
error?: '400 Bad Request: Limit has to be an integer between 1 and 500';
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface Operations {}
|
|
142
|
+
|
|
143
|
+
export interface External {}
|
package/.babelrc
DELETED
package/.esdoc.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"source": "./src",
|
|
3
|
-
"destination": "./apidoc",
|
|
4
|
-
"includes": ["\\.js$"],
|
|
5
|
-
"excludes": ["\\.test\\.js$", "doc/", "(u|U)tils"],
|
|
6
|
-
"plugins": [
|
|
7
|
-
{
|
|
8
|
-
"name": "esdoc-standard-plugin"
|
|
9
|
-
},
|
|
10
|
-
{ "name": "esdoc-ecmascript-proposal-plugin", "option": { "all": true } },
|
|
11
|
-
{
|
|
12
|
-
"name": "esdoc-publish-html-plugin"
|
|
13
|
-
},
|
|
14
|
-
{ "name": "./esdoc/plugins/dynamic-property-plugin/Plugin.js" },
|
|
15
|
-
{ "name": "./esdoc/plugins/externals-plugin/Plugin.js" }
|
|
16
|
-
]
|
|
17
|
-
}
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
build/*
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
name: Check PR title
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
types:
|
|
5
|
-
- opened
|
|
6
|
-
- reopened
|
|
7
|
-
- edited
|
|
8
|
-
- synchronize
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
lint:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: aslafy-z/conventional-pr-title-action@v2.2.0
|
|
15
|
-
with:
|
|
16
|
-
success-state: Title follows the specification.
|
|
17
|
-
failure-state: Title does not follow the specification.
|
|
18
|
-
context-name: conventional-pr-title
|
|
19
|
-
preset: conventional-changelog-angular@latest
|
|
20
|
-
env:
|
|
21
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Cypress
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
steps:
|
|
9
|
-
- uses: actions/checkout@v1
|
|
10
|
-
|
|
11
|
-
- uses: actions/setup-node@v1
|
|
12
|
-
with:
|
|
13
|
-
node-version: '14.x'
|
|
14
|
-
|
|
15
|
-
- name: Get yarn cache
|
|
16
|
-
id: yarn-cache
|
|
17
|
-
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
18
|
-
|
|
19
|
-
- uses: actions/cache@v1
|
|
20
|
-
with:
|
|
21
|
-
path: ${{ steps.yarn-cache.outputs.dir }}
|
|
22
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
23
|
-
restore-keys: |
|
|
24
|
-
${{ runner.os }}-yarn-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: yarn install --frozen-lockfile
|
|
27
|
-
|
|
28
|
-
- name: Run and record Cypress tests
|
|
29
|
-
run: yarn run cy:test
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
name: Build
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
|
|
9
|
-
strategy:
|
|
10
|
-
matrix:
|
|
11
|
-
node-version: [14.x]
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v1
|
|
15
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
16
|
-
uses: actions/setup-node@v1
|
|
17
|
-
with:
|
|
18
|
-
node-version: ${{ matrix.node-version }}
|
|
19
|
-
- name: yarn install, build, and test
|
|
20
|
-
run: |
|
|
21
|
-
echo '[]' > src/doc/components/Esdoc/index.json
|
|
22
|
-
npm install -g yarn
|
|
23
|
-
yarn install
|
|
24
|
-
yarn lint
|
|
25
|
-
yarn test
|
|
26
|
-
yarn build
|
|
27
|
-
env:
|
|
28
|
-
CI: true
|
package/.husky/commit-msg
DELETED
package/.husky/post-checkout
DELETED
package/.husky/post-merge
DELETED
package/.husky/post-rebase
DELETED
package/.husky/pre-commit
DELETED
package/.neutrinorc.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
const react = require('@neutrinojs/react');
|
|
2
|
-
const library = require('@neutrinojs/library');
|
|
3
|
-
const copy = require('@neutrinojs/copy');
|
|
4
|
-
const jest = require('@neutrinojs/jest');
|
|
5
|
-
const styles = require('@neutrinojs/style-loader');
|
|
6
|
-
const merge = require('deepmerge');
|
|
7
|
-
const path = require('path');
|
|
8
|
-
|
|
9
|
-
const webpackDevServer = (neutrino) => {
|
|
10
|
-
neutrino.config.watchOptions({
|
|
11
|
-
ignored: /node_modules/,
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
if (process.env.REACT_APP_LIB_MODE) {
|
|
16
|
-
module.exports = {
|
|
17
|
-
options: {
|
|
18
|
-
root: __dirname,
|
|
19
|
-
mains: {
|
|
20
|
-
index: './index.js',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
use: [
|
|
24
|
-
(neutrino) => {
|
|
25
|
-
neutrino.config.output
|
|
26
|
-
.globalObject('this') // will prevent `window`
|
|
27
|
-
.end()
|
|
28
|
-
.module.rule('worker')
|
|
29
|
-
.test(neutrino.regexFromExtensions(['worker.js']))
|
|
30
|
-
.use('worker')
|
|
31
|
-
.loader(require.resolve('worker-loader'))
|
|
32
|
-
.options({
|
|
33
|
-
// See: https://github.com/webpack-contrib/worker-loader#options
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
library({
|
|
37
|
-
name: 'mobility-toolbox-js',
|
|
38
|
-
targets: {
|
|
39
|
-
browsers: [
|
|
40
|
-
'last 2 Chrome versions',
|
|
41
|
-
'last 2 Firefox versions',
|
|
42
|
-
'last 2 Edge versions',
|
|
43
|
-
'last 2 Opera versions',
|
|
44
|
-
'last 2 Safari versions',
|
|
45
|
-
'last 2 iOS versions',
|
|
46
|
-
'ie 11',
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
jest({
|
|
51
|
-
testRegex: 'src/.*.test.js$',
|
|
52
|
-
coveragePathIgnorePatterns: ['src/doc/'],
|
|
53
|
-
coverageReporters: ['text', 'html'],
|
|
54
|
-
snapshotSerializers: ['jest-serializer-html'],
|
|
55
|
-
setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'],
|
|
56
|
-
globalSetup: './global-setup.js',
|
|
57
|
-
transformIgnorePatterns: [
|
|
58
|
-
'/node_modules/(?!(ol|ol-mapbox-style|geotiff)/).*/',
|
|
59
|
-
],
|
|
60
|
-
}),
|
|
61
|
-
(neutrino) => {
|
|
62
|
-
if (process.env.NODE_ENV === 'test') {
|
|
63
|
-
neutrino.config.module
|
|
64
|
-
.rule('compile')
|
|
65
|
-
.use('babel')
|
|
66
|
-
.tap((options) =>
|
|
67
|
-
merge(options, {
|
|
68
|
-
env: {
|
|
69
|
-
test: {
|
|
70
|
-
plugins: ['@babel/plugin-transform-runtime'], // async/await
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
}),
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
copy({
|
|
78
|
-
patterns: [
|
|
79
|
-
{
|
|
80
|
-
from: path.join(__dirname, 'README.md'),
|
|
81
|
-
to: path.join(__dirname, 'build/README.md'),
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
from: path.join(__dirname, 'src/api'),
|
|
85
|
-
to: path.join(__dirname, 'build/api'),
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
from: path.join(__dirname, 'src/common'),
|
|
89
|
-
to: path.join(__dirname, 'build/common'),
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
from: path.join(__dirname, 'src/ol'),
|
|
93
|
-
to: path.join(__dirname, 'build/ol'),
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
from: path.join(__dirname, 'src/mapbox'),
|
|
97
|
-
to: path.join(__dirname, 'build/mapbox'),
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
from: path.join(__dirname, 'package.json'),
|
|
101
|
-
to: path.join(__dirname, 'build/package.json'),
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
from: path.join(__dirname, 'src/index.js'),
|
|
105
|
-
to: path.join(__dirname, 'build/module.js'),
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
}),
|
|
109
|
-
],
|
|
110
|
-
};
|
|
111
|
-
} else {
|
|
112
|
-
module.exports = {
|
|
113
|
-
options: {
|
|
114
|
-
root: __dirname,
|
|
115
|
-
mains: {
|
|
116
|
-
index: 'doc/index.js',
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
use: [
|
|
120
|
-
react({
|
|
121
|
-
html: {
|
|
122
|
-
title: 'mobility-toolbox-js',
|
|
123
|
-
favicon: 'src/doc/img/favico.ico',
|
|
124
|
-
},
|
|
125
|
-
targets: {
|
|
126
|
-
browsers: [
|
|
127
|
-
'last 2 Chrome versions',
|
|
128
|
-
'last 2 Firefox versions',
|
|
129
|
-
'last 2 Edge versions',
|
|
130
|
-
'last 2 Opera versions',
|
|
131
|
-
'last 2 Safari versions',
|
|
132
|
-
'last 2 iOS versions',
|
|
133
|
-
'ie 11',
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
style: {
|
|
137
|
-
// Override the default file extension of `.css` if needed
|
|
138
|
-
test: /\.(css|sass|scss)$/,
|
|
139
|
-
modulesTest: /\.module\.(css|sass|scss)$/,
|
|
140
|
-
loaders: [
|
|
141
|
-
// Define loaders as objects. Note: loaders must be specified in reverse order.
|
|
142
|
-
// ie: for the loaders below the actual execution order would be:
|
|
143
|
-
// input file -> sass-loader -> postcss-loader -> css-loader -> style-loader/mini-css-extract-plugin
|
|
144
|
-
{
|
|
145
|
-
loader: 'postcss-loader',
|
|
146
|
-
options: {
|
|
147
|
-
plugins: [require('autoprefixer')],
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
loader: 'sass-loader',
|
|
152
|
-
useId: 'sass',
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
}),
|
|
157
|
-
webpackDevServer,
|
|
158
|
-
copy({
|
|
159
|
-
patterns: [
|
|
160
|
-
{
|
|
161
|
-
from: path.join(__dirname, 'README.md'),
|
|
162
|
-
to: path.join(__dirname, 'build/README.md'),
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
from: path.join(__dirname, 'src/doc/examples'),
|
|
166
|
-
to: path.join(__dirname, 'build/examples'),
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
from: path.join(__dirname, 'src/doc/_redirects'),
|
|
170
|
-
to: path.join(__dirname, 'build/'),
|
|
171
|
-
},
|
|
172
|
-
],
|
|
173
|
-
}),
|
|
174
|
-
],
|
|
175
|
-
};
|
|
176
|
-
}
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
14
|
package/CHANGELOG.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
## [2.0.0](https://github.com/geops/mobility-toolbox-js/compare/v1.7.5...v2.0.0) (2022-06-20)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
* use standard-version for automatic versioning and changelog ([#167](https://github.com/geops/mobility-toolbox-js/issues/167)) ([045ad0b](https://github.com/geops/mobility-toolbox-js/commit/045ad0b533aaa56d84b90178de8e6aa18c2cbd89))
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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/Layer.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{unByKey as r}from"ol/Observable";import h from"ol/layer/Group";import l from"../../common/layers/Layer";class t extends l{constructor(e){super(e),this.olLayer&&this.olLayer.setVisible(this.visible)}defineProperties(e){super.defineProperties(e),Object.defineProperties(this,{olLayer:{value:e.olLayer,writable:!0},olListenersKeys:{value:[]}})}init(e){if(super.init(e),!!this.map&&(this.map&&this.olLayer&&this.map.addLayer(this.olLayer),this.olListenersKeys.push(this.map.getLayers().on("remove",i=>{i.element===this.olLayer&&this.terminate()})),(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.olListenersKeys.push(this.on("change:visible",this.toggleVisibleListeners))),this.copyrights&&this.olLayer)){const i=this.copyrights||[];this.olLayer instanceof h?this.olLayer.getLayers().getArray().forEach(s=>{s.getSource().setAttributions(i)}):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(i)}}terminate(){r(this.olListenersKeys),this.map&&this.olLayer&&this.map.removeLayer(this.olLayer),super.terminate()}setVisible(e,i=!1,s=!1,o=!1){e!==this.visible&&(super.setVisible(e,i,s,o),this.olLayer&&this.olLayer.setVisible(this.visible))}toggleVisibleListeners(){this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach(e=>{const i=this.olListenersKeys.indexOf(e);i>-1&&this.olListenersKeys.splice(i,1),r([this.isHoverListenerKey,this.isClickListenerKey])}),this.visible&&(this.isClickActive&&(this.isClickListenerKey=this.map.on("singleclick",this.onUserClickCallback)),this.isHoverActive&&(this.isHoverListenerKey=this.map.on("pointermove",this.onUserMoveCallback)),this.olListenersKeys.push(this.isClickListenerKey,this.isHoverListenerKey))}clone(e){return new t({...this.options,...e})}}export default t;
|
|
2
|
-
//# sourceMappingURL=Layer.js.map
|
package/Layer.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["src/ol/layers/Layer.js"],
|
|
4
|
-
"sourcesContent": ["import { unByKey } from 'ol/Observable';\nimport Group from 'ol/layer/Group';\nimport LayerCommon from '../../common/layers/Layer';\n\n/**\n * A class representing a layer to display on an OpenLayers map.\n *\n * @example\n * import { Layer } from 'mobility-toolbox-js/ol';\n *\n * const layer = new Layer({\n * olLayer: ...,\n * });\n *\n * @see <a href=\"/example/ol-map\">Map example</a>\n *\n * @classproperty {ol/Map~Map} map - The map where the layer is displayed.\n * @extends {Layer}\n */\nclass Layer extends LayerCommon {\n /**\n * Constructor.\n *\n * @param {Object} options\n * @param {ol/layer/Layer~Layer} options.olLayer The layer (required).\n * @param {string} [options.name=uuid()] Layer name. Default use a generated uuid.\n * @param {string} [options.key=uuid().toLowerCase()] Layer key, will use options.name.toLowerCase() if not specified.\n * @param {string} [options.copyright=undefined] Copyright-Statement.\n * @param {Array<Layer>} [options.children=[]] Sublayers.\n * @param {Object} [options.properties={}] Application-specific layer properties.\n * @param {boolean} [options.visible=true] If true this layer is the currently visible layer on the map.\n * @param {boolean} [options.isBaseLayer=false] If true this layer is a baseLayer.\n * @param {boolean} [options.isQueryable=true] If true feature information can be queried by the react-spatial LayerService. Default is true.\n * @param {boolean} [options.isClickActive=true] If true feature information will be queried on 'singleclick' event. All results will be passed to function registered using `onClick` function. Default is true.\n */\n constructor(options) {\n super(options);\n\n if (this.olLayer) {\n this.olLayer.setVisible(this.visible);\n }\n }\n\n /**\n * Define layer's properties.\n *\n * @ignore\n */\n defineProperties(options) {\n super.defineProperties(options);\n Object.defineProperties(this, {\n olLayer: { value: options.olLayer, writable: true },\n olListenersKeys: {\n value: [],\n },\n });\n }\n\n /**\n * Initialize the layer and listen to feature clicks.\n * @param {ol/Map~Map} map\n */\n init(map) {\n super.init(map);\n\n if (!this.map) {\n return;\n }\n\n if (this.map && this.olLayer) {\n this.map.addLayer(this.olLayer);\n }\n\n this.olListenersKeys.push(\n this.map.getLayers().on('remove', (evt) => {\n if (evt.element === this.olLayer) {\n this.terminate();\n }\n }),\n );\n\n if (this.isClickActive || this.isHoverActive) {\n this.toggleVisibleListeners();\n this.olListenersKeys.push(\n this.on('change:visible', this.toggleVisibleListeners),\n );\n }\n\n // We set the copyright to the source used by the layer.\n if (this.copyrights && this.olLayer) {\n const attributions = this.copyrights || [];\n if (this.olLayer instanceof Group) {\n this.olLayer\n .getLayers()\n .getArray()\n .forEach((layer) => {\n layer.getSource().setAttributions(attributions);\n });\n } else if (this.olLayer.getSource) {\n this.olLayer.getSource().setAttributions(attributions);\n }\n }\n }\n\n /**\n * Terminate what was initialized in init function. Remove layer, events...\n */\n terminate() {\n unByKey(this.olListenersKeys);\n\n if (this.map && this.olLayer) {\n this.map.removeLayer(this.olLayer);\n }\n\n super.terminate();\n }\n\n /**\n * Change the visibility of the layer\n *\n * @param {boolean} visible Defines the visibility of the layer\n * @param {boolean} [stopPropagationDown]\n * @param {boolean} [stopPropagationUp]\n * @param {boolean} [stopPropagationSiblings]\n */\n setVisible(\n visible,\n stopPropagationDown = false,\n stopPropagationUp = false,\n stopPropagationSiblings = false,\n ) {\n if (visible === this.visible) {\n return;\n }\n\n super.setVisible(\n visible,\n stopPropagationDown,\n stopPropagationUp,\n stopPropagationSiblings,\n );\n\n if (this.olLayer) {\n this.olLayer.setVisible(this.visible);\n }\n }\n\n /**\n * Toggle listeners needed when a layer is avisible or not.\n * @private\n */\n toggleVisibleListeners() {\n // Remove previous event\n if (this.isClickListenerKey && this.isHoverListenerKey) {\n [this.isClickListenerKey, this.isHoverListenerKey].forEach((key) => {\n const index = this.olListenersKeys.indexOf(key);\n if (index > -1) {\n this.olListenersKeys.splice(index, 1);\n }\n unByKey([this.isHoverListenerKey, this.isClickListenerKey]);\n });\n }\n\n if (this.visible) {\n if (this.isClickActive) {\n this.isClickListenerKey = this.map.on(\n 'singleclick',\n this.onUserClickCallback,\n );\n }\n if (this.isHoverActive) {\n this.isHoverListenerKey = this.map.on(\n 'pointermove',\n this.onUserMoveCallback,\n );\n }\n this.olListenersKeys.push(\n this.isClickListenerKey,\n this.isHoverListenerKey,\n );\n }\n }\n\n /**\n * Create a copy of the Layer.\n * @param {Object} newOptions Options to override\n * @return {Layer} A Layer\n */\n clone(newOptions) {\n return new Layer({ ...this.options, ...newOptions });\n }\n}\nexport default Layer;\n"],
|
|
5
|
-
"mappings": "AAAA,wCACA,8BACA,yCAiBA,MAAM,SAAc,EAAY,CAgB9B,YAAY,EAAS,CACnB,MAAM,CAAO,EAET,KAAK,SACP,KAAK,QAAQ,WAAW,KAAK,OAAO,CAExC,CAOA,iBAAiB,EAAS,CACxB,MAAM,iBAAiB,CAAO,EAC9B,OAAO,iBAAiB,KAAM,CAC5B,QAAS,CAAE,MAAO,EAAQ,QAAS,SAAU,EAAK,EAClD,gBAAiB,CACf,MAAO,CAAC,CACV,CACF,CAAC,CACH,CAMA,KAAK,EAAK,CAGR,GAFA,MAAM,KAAK,CAAG,EAEV,EAAC,KAAK,KAIN,MAAK,KAAO,KAAK,SACnB,KAAK,IAAI,SAAS,KAAK,OAAO,EAGhC,KAAK,gBAAgB,KACnB,KAAK,IAAI,UAAU,EAAE,GAAG,SAAU,AAAC,GAAQ,CACzC,AAAI,EAAI,UAAY,KAAK,SACvB,KAAK,UAAU,CAEnB,CAAC,CACH,EAEI,MAAK,eAAiB,KAAK,gBAC7B,MAAK,uBAAuB,EAC5B,KAAK,gBAAgB,KACnB,KAAK,GAAG,iBAAkB,KAAK,sBAAsB,CACvD,GAIE,KAAK,YAAc,KAAK,SAAS,CACnC,KAAM,GAAe,KAAK,YAAc,CAAC,EACzC,AAAI,KAAK,kBAAmB,GAC1B,KAAK,QACF,UAAU,EACV,SAAS,EACT,QAAQ,AAAC,GAAU,CAClB,EAAM,UAAU,EAAE,gBAAgB,CAAY,CAChD,CAAC,EACM,KAAK,QAAQ,WACtB,KAAK,QAAQ,UAAU,EAAE,gBAAgB,CAAY,CAEzD,CACF,CAKA,WAAY,CACV,EAAQ,KAAK,eAAe,EAExB,KAAK,KAAO,KAAK,SACnB,KAAK,IAAI,YAAY,KAAK,OAAO,EAGnC,MAAM,UAAU,CAClB,CAUA,WACE,EACA,EAAsB,GACtB,EAAoB,GACpB,EAA0B,GAC1B,CACA,AAAI,IAAY,KAAK,SAIrB,OAAM,WACJ,EACA,EACA,EACA,CACF,EAEI,KAAK,SACP,KAAK,QAAQ,WAAW,KAAK,OAAO,EAExC,CAMA,wBAAyB,CAEvB,AAAI,KAAK,oBAAsB,KAAK,oBAClC,CAAC,KAAK,mBAAoB,KAAK,kBAAkB,EAAE,QAAQ,AAAC,GAAQ,CAClE,KAAM,GAAQ,KAAK,gBAAgB,QAAQ,CAAG,EAC9C,AAAI,EAAQ,IACV,KAAK,gBAAgB,OAAO,EAAO,CAAC,EAEtC,EAAQ,CAAC,KAAK,mBAAoB,KAAK,kBAAkB,CAAC,CAC5D,CAAC,EAGC,KAAK,SACH,MAAK,eACP,MAAK,mBAAqB,KAAK,IAAI,GACjC,cACA,KAAK,mBACP,GAEE,KAAK,eACP,MAAK,mBAAqB,KAAK,IAAI,GACjC,cACA,KAAK,kBACP,GAEF,KAAK,gBAAgB,KACnB,KAAK,mBACL,KAAK,kBACP,EAEJ,CAOA,MAAM,EAAY,CAChB,MAAO,IAAI,GAAM,CAAE,GAAG,KAAK,QAAS,GAAG,CAAW,CAAC,CACrD,CACF,CACA,cAAe",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/__mocks__/mapbox-gl.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
const callbacks = {};
|
|
2
|
-
|
|
3
|
-
/* eslint-disable class-methods-use-this */
|
|
4
|
-
class Map {
|
|
5
|
-
constructor(options) {
|
|
6
|
-
this.options = options;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
addLayer() {}
|
|
10
|
-
|
|
11
|
-
addSource() {}
|
|
12
|
-
|
|
13
|
-
isStyleLoaded() {}
|
|
14
|
-
|
|
15
|
-
getLayer() {}
|
|
16
|
-
|
|
17
|
-
getBounds() {
|
|
18
|
-
return {
|
|
19
|
-
toArray: () => [
|
|
20
|
-
[1, 2],
|
|
21
|
-
[1, 2],
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getCanvas() {
|
|
27
|
-
return {
|
|
28
|
-
height: '100px',
|
|
29
|
-
width: '100px',
|
|
30
|
-
setAttribute: () => {},
|
|
31
|
-
removeAttribute: () => {},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
getCenter() {
|
|
36
|
-
return { lng: 0, lat: 0 };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getZoom() {}
|
|
40
|
-
|
|
41
|
-
getBearing() {
|
|
42
|
-
return 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
once() {}
|
|
46
|
-
|
|
47
|
-
on(type, func) {
|
|
48
|
-
if (!callbacks[type]) {
|
|
49
|
-
callbacks[type] = [];
|
|
50
|
-
}
|
|
51
|
-
callbacks[type].push(func);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
off(type, func) {
|
|
55
|
-
if (!callbacks[type]) {
|
|
56
|
-
callbacks[type] = [];
|
|
57
|
-
}
|
|
58
|
-
const index = callbacks[type].indexOf(func);
|
|
59
|
-
if (index > -1) {
|
|
60
|
-
callbacks[type].splice(index, 1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
fire(type, evt) {
|
|
65
|
-
if (!callbacks[type]) {
|
|
66
|
-
callbacks[type] = [];
|
|
67
|
-
}
|
|
68
|
-
callbacks[type].forEach((callback) => callback(evt));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
loaded() {}
|
|
72
|
-
|
|
73
|
-
remove() {}
|
|
74
|
-
|
|
75
|
-
unproject() {
|
|
76
|
-
return { lng: 0, lat: 0 };
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
module.exports = {
|
|
80
|
-
Map,
|
|
81
|
-
};
|
package/__mocks__/maplibre-gl.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
const callbacks = {};
|
|
2
|
-
|
|
3
|
-
/* eslint-disable class-methods-use-this */
|
|
4
|
-
class Map {
|
|
5
|
-
constructor(options) {
|
|
6
|
-
this.options = options;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
addLayer() {}
|
|
10
|
-
|
|
11
|
-
addSource() {}
|
|
12
|
-
|
|
13
|
-
isStyleLoaded() {}
|
|
14
|
-
|
|
15
|
-
getLayer() {}
|
|
16
|
-
|
|
17
|
-
getBounds() {
|
|
18
|
-
return {
|
|
19
|
-
toArray: () => [
|
|
20
|
-
[1, 2],
|
|
21
|
-
[1, 2],
|
|
22
|
-
],
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getCanvas() {
|
|
27
|
-
return {
|
|
28
|
-
height: '100px',
|
|
29
|
-
width: '100px',
|
|
30
|
-
setAttribute: () => {},
|
|
31
|
-
removeAttribute: () => {},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
getCenter() {
|
|
36
|
-
return { lng: 0, lat: 0 };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getZoom() {}
|
|
40
|
-
|
|
41
|
-
getBearing() {
|
|
42
|
-
return 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
once() {}
|
|
46
|
-
|
|
47
|
-
on(type, func) {
|
|
48
|
-
if (!callbacks[type]) {
|
|
49
|
-
callbacks[type] = [];
|
|
50
|
-
}
|
|
51
|
-
callbacks[type].push(func);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
off(type, func) {
|
|
55
|
-
if (!callbacks[type]) {
|
|
56
|
-
callbacks[type] = [];
|
|
57
|
-
}
|
|
58
|
-
const index = callbacks[type].indexOf(func);
|
|
59
|
-
if (index > -1) {
|
|
60
|
-
callbacks[type].splice(index, 1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
fire(type, evt) {
|
|
65
|
-
if (!callbacks[type]) {
|
|
66
|
-
callbacks[type] = [];
|
|
67
|
-
}
|
|
68
|
-
callbacks[type].forEach((callback) => callback(evt));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
loaded() {}
|
|
72
|
-
|
|
73
|
-
remove() {}
|
|
74
|
-
|
|
75
|
-
unproject() {
|
|
76
|
-
return { lng: 0, lat: 0 };
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
module.exports = {
|
|
80
|
-
Map,
|
|
81
|
-
};
|