mobility-toolbox-js 2.3.9 → 2.3.10
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/.esdoc.js +18 -0
- package/.eslintignore +1 -0
- package/.eslintrc.js +25 -0
- package/.fixpackrc +20 -0
- package/.github/workflows/build.yml +16 -0
- package/.github/workflows/conventional-pr-title.yml +16 -0
- package/.github/workflows/cypress.yml +101 -0
- package/.github/workflows/test.yml +17 -0
- package/.husky/commit-msg +4 -0
- package/.husky/post-checkout +4 -0
- package/.husky/post-merge +4 -0
- package/.husky/post-rebase +4 -0
- package/.husky/pre-commit +4 -0
- package/.lintstagedrc.js +10 -0
- package/.nvmrc +1 -0
- package/.prettierrc.js +5 -0
- package/.stylelintrc.js +4 -0
- package/CHANGELOG.md +132 -0
- package/LICENSE +21 -0
- package/MIGRATION-V2.md +248 -0
- package/README.md +42 -0
- package/__mocks__/mapbox-gl.js +81 -0
- package/__mocks__/maplibre-gl.js +81 -0
- package/babel.config.js +9 -0
- package/commitlint.config.js +1 -0
- package/cypress/e2e/examples/api.cy.js +7 -0
- package/cypress/e2e/examples/examples.cy.js +7 -0
- package/cypress/e2e/examples/navigation.cy.js +29 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/plugins/index.js +21 -0
- package/cypress/support/commands.js +25 -0
- package/cypress/support/e2e.js +20 -0
- package/cypress.config.ts +15 -0
- package/data/fetchRoute.json +292 -0
- package/data/fetchTrajectories.json +18 -0
- package/data/fetchTrajectoryById.json +3 -0
- package/data/fetchTrajectoryStations.json +18 -0
- package/data/stopsSearch.json +15 -0
- package/dependabot.yml +15 -0
- package/doc/.eslintrc.json +1 -0
- package/doc/README.md +34 -0
- package/doc/next.config.js +16 -0
- package/doc/package.json +41 -0
- package/doc/pages/404.js +5 -0
- package/doc/pages/_app.js +61 -0
- package/doc/pages/_document.js +64 -0
- package/doc/pages/doc/[...slug].js +23 -0
- package/doc/pages/doc.js +23 -0
- package/doc/pages/example/[example].js +52 -0
- package/doc/pages/examples.js +34 -0
- package/doc/pages/index.js +25 -0
- package/doc/public/README.md +15 -0
- package/doc/public/favicon.ico +0 -0
- package/doc/public/static/assets/Lato-Black.ttf +0 -0
- package/doc/public/static/assets/Lato-BlackItalic.ttf +0 -0
- package/doc/public/static/assets/Lato-Bold.ttf +0 -0
- package/doc/public/static/assets/Lato-BoldItalic.ttf +0 -0
- package/doc/public/static/assets/Lato-Italic.ttf +0 -0
- package/doc/public/static/assets/Lato-Light.ttf +0 -0
- package/doc/public/static/assets/Lato-LightItalic.ttf +0 -0
- package/doc/public/static/assets/Lato-Regular.ttf +0 -0
- package/doc/public/static/assets/Lato-Thin.ttf +0 -0
- package/doc/public/static/assets/Lato-ThinItalic.ttf +0 -0
- package/doc/public/static/assets/OFL.txt +93 -0
- package/doc/public/static/examples/assets/tralis-live-map/index.js +11 -0
- package/doc/public/static/examples/assets/tralis-live-map/s1kreis.svg +105 -0
- package/doc/public/static/examples/assets/tralis-live-map/s20kreis.svg +101 -0
- package/doc/public/static/examples/assets/tralis-live-map/s2kreis.svg +95 -0
- package/doc/public/static/examples/assets/tralis-live-map/s3kreis.svg +95 -0
- package/doc/public/static/examples/assets/tralis-live-map/s4kreis.svg +95 -0
- package/doc/public/static/examples/assets/tralis-live-map/s6kreis.svg +95 -0
- package/doc/public/static/examples/assets/tralis-live-map/s7kreis.svg +95 -0
- package/doc/public/static/examples/assets/tralis-live-map/s8kreis.svg +93 -0
- package/doc/public/static/examples/assets/tralis-live-map/unknown.svg +107 -0
- package/doc/public/static/examples/layers.html +11 -0
- package/doc/public/static/examples/layers.js +97 -0
- package/doc/public/static/examples/mb-copyright.html +26 -0
- package/doc/public/static/examples/mb-copyright.js +37 -0
- package/doc/public/static/examples/mb-tracker.html +1 -0
- package/doc/public/static/examples/mb-tracker.js +40 -0
- package/doc/public/static/examples/mb-tracker.md +1 -0
- package/doc/public/static/examples/mb-tralis.html +1 -0
- package/doc/public/static/examples/mb-tralis.js +34 -0
- package/doc/public/static/examples/ol-copyright.html +26 -0
- package/doc/public/static/examples/ol-copyright.js +43 -0
- package/doc/public/static/examples/ol-mapbox-layer.html +1 -0
- package/doc/public/static/examples/ol-mapbox-layer.js +28 -0
- package/doc/public/static/examples/ol-mapbox-style-layer.html +12 -0
- package/doc/public/static/examples/ol-mapbox-style-layer.js +48 -0
- package/doc/public/static/examples/ol-query.html +32 -0
- package/doc/public/static/examples/ol-query.js +83 -0
- package/doc/public/static/examples/ol-routing.html +26 -0
- package/doc/public/static/examples/ol-routing.js +65 -0
- package/doc/public/static/examples/ol-routing.md +1 -0
- package/doc/public/static/examples/ol-stop-finder.html +15 -0
- package/doc/public/static/examples/ol-stop-finder.js +35 -0
- package/doc/public/static/examples/ol-stop-finder.md +1 -0
- package/doc/public/static/examples/ol-tracker.html +1 -0
- package/doc/public/static/examples/ol-tracker.js +41 -0
- package/doc/public/static/examples/ol-tracker.md +1 -0
- package/doc/public/static/examples/ol-tralis.html +5 -0
- package/doc/public/static/examples/ol-tralis.js +62 -0
- package/doc/public/static/examples/tralis-live-map.html +1 -0
- package/doc/public/static/examples/tralis-live-map.js +67 -0
- package/doc/public/static/examples/tralis-live-map.md +3 -0
- package/doc/public/static/img/live_tracker_mb.jpg +0 -0
- package/doc/public/static/img/live_tracker_munich.jpg +0 -0
- package/doc/public/static/img/live_tracker_ol.jpg +0 -0
- package/doc/public/static/img/mapbox.jpg +0 -0
- package/doc/public/static/img/mapbox_style.jpg +0 -0
- package/doc/public/static/img/ol-copyright.png +0 -0
- package/doc/public/static/img/query_objects.jpg +0 -0
- package/doc/public/static/img/routing.jpg +0 -0
- package/doc/public/static/img/simple_map.jpg +0 -0
- package/doc/public/static/img/stops.jpg +0 -0
- package/doc/public/vercel.svg +4 -0
- package/doc/src/components/CodeSandboxButton.js +102 -0
- package/doc/src/components/Documentation.js +42 -0
- package/doc/src/components/Esdoc/Anchor.js +57 -0
- package/doc/src/components/Esdoc/ClassDoc.js +272 -0
- package/doc/src/components/Esdoc/DeprecatedHTML.js +16 -0
- package/doc/src/components/Esdoc/DetailDocs.js +279 -0
- package/doc/src/components/Esdoc/DetailHTML.js +33 -0
- package/doc/src/components/Esdoc/DirectSubclassHTML.js +30 -0
- package/doc/src/components/Esdoc/DocBuilderUtils.js +697 -0
- package/doc/src/components/Esdoc/DocLinkHTML.js +63 -0
- package/doc/src/components/Esdoc/DocsLinkHTML.js +38 -0
- package/doc/src/components/Esdoc/Esdoc.js +63 -0
- package/doc/src/components/Esdoc/EsdocContent.js +56 -0
- package/doc/src/components/Esdoc/EsdocNavigation.js +13 -0
- package/doc/src/components/Esdoc/EsdocSearch.js +78 -0
- package/doc/src/components/Esdoc/ExperimentalHTML.js +17 -0
- package/doc/src/components/Esdoc/ExtendsChainHTML.js +32 -0
- package/doc/src/components/Esdoc/FileDocLinkHTML.js +62 -0
- package/doc/src/components/Esdoc/IdentifiersDoc.js +113 -0
- package/doc/src/components/Esdoc/IndirectSubclassHTML.js +30 -0
- package/doc/src/components/Esdoc/InheritedSummaryDoc.js +70 -0
- package/doc/src/components/Esdoc/InheritedSummaryHTML.js +38 -0
- package/doc/src/components/Esdoc/MixinClassesHTML.js +29 -0
- package/doc/src/components/Esdoc/NavDoc.js +112 -0
- package/doc/src/components/Esdoc/OverrideMethod.js +44 -0
- package/doc/src/components/Esdoc/OverrideMethodDescription.js +35 -0
- package/doc/src/components/Esdoc/Properties.js +89 -0
- package/doc/src/components/Esdoc/README.md +45 -0
- package/doc/src/components/Esdoc/SignatureHTML.js +123 -0
- package/doc/src/components/Esdoc/SingleDoc.js +31 -0
- package/doc/src/components/Esdoc/SummaryDoc.js +160 -0
- package/doc/src/components/Esdoc/SummaryHTML.js +96 -0
- package/doc/src/components/Esdoc/TypeDocLinkHTML.js +251 -0
- package/doc/src/components/Esdoc/index.js +7 -0
- package/doc/src/components/Esdoc/taffydb.js +2070 -0
- package/doc/src/components/Example.js +200 -0
- package/doc/src/components/ExampleCard.js +126 -0
- package/doc/src/components/Examples.js +78 -0
- package/doc/src/components/Home.js +121 -0
- package/doc/src/components/TrackerExample.js +39 -0
- package/doc/src/examples.js +117 -0
- package/doc/styles/App.scss +53 -0
- package/doc/styles/identifiers.css +38 -0
- package/doc/styles/search.css +76 -0
- package/doc/styles/style.css +603 -0
- package/esdoc/README.md +27 -0
- package/esdoc/plugins/MyPlugin.js +69 -0
- package/esdoc/plugins/dynamic-property-plugin/Plugin.js +50 -0
- package/esdoc/plugins/externals-plugin/Plugin.js +45 -0
- package/esdoc/plugins/externals-plugin/externals.js +93 -0
- package/esdoc/plugins/optional-chaining-plugin/Plugin.js +8 -0
- package/global-setup.js +3 -0
- package/jest.config.js +24 -0
- package/package.json +18 -18
- package/pull_request_template.md +17 -0
- package/scripts/read-pkg-json.js +22 -0
- package/src/api/RealtimeAPI.test.js +144 -0
- package/src/api/RealtimeAPI.ts +712 -0
- package/src/api/RoutingAPI.test.js +41 -0
- package/src/api/RoutingAPI.ts +47 -0
- package/src/api/StopsAPI.test.js +34 -0
- package/src/api/StopsAPI.ts +45 -0
- package/{api → src/api}/typedefs.js +11 -1
- package/src/common/api/HttpAPI.test.js +68 -0
- package/src/common/api/HttpAPI.ts +77 -0
- package/src/common/api/WebSocketAPI.test.js +421 -0
- package/src/common/api/WebSocketAPI.ts +515 -0
- package/src/common/controls/ControlCommon.test.js +106 -0
- package/src/common/controls/ControlCommon.ts +194 -0
- package/src/common/controls/CopyrightControlCommon.ts +41 -0
- package/src/common/controls/StopFinderControlCommon.ts +192 -0
- package/src/common/layers/LayerCommon.test.js +158 -0
- package/src/common/layers/LayerCommon.ts +321 -0
- package/src/common/mixins/RealtimeLayerMixin.ts +1168 -0
- package/src/common/mixins/UserInteractionsLayerMixin.test.js +227 -0
- package/src/common/mixins/UserInteractionsLayerMixin.ts +352 -0
- package/src/common/styles/realtimeDefaultStyle.ts +436 -0
- package/src/common/styles/realtimeDelayStyle.ts +27 -0
- package/src/common/styles/realtimeHeadingStyle.ts +138 -0
- package/src/common/styles/realtimeSimpleStyle.ts +25 -0
- package/{common → src/common}/typedefs.js +1 -1
- package/src/common/utils/compareDepartures.ts +46 -0
- package/src/common/utils/createCanvas.ts +33 -0
- package/src/common/utils/createRealtimeFilters.test.js +100 -0
- package/src/common/utils/createRealtimeFilters.ts +96 -0
- package/src/common/utils/debounceDeparturesMessages.ts +52 -0
- package/src/common/utils/debounceWebsocketMessages.ts +47 -0
- package/src/common/utils/getLayersAsFlatArray.ts +17 -0
- package/src/common/utils/getMapboxMapCopyrights.test.js +47 -0
- package/src/common/utils/getMapboxMapCopyrights.ts +52 -0
- package/src/common/utils/getMapboxRender.ts +104 -0
- package/src/common/utils/getMaplibreRender.ts +54 -0
- package/{common/utils/getRealtimeModeSuffix.d.ts → src/common/utils/getRealtimeModeSuffix.ts} +4 -2
- package/src/common/utils/getUrlWithParams.ts +21 -0
- package/src/common/utils/getVehiclePosition.ts +92 -0
- package/{common → src/common}/utils/index.js +1 -2
- package/src/common/utils/realtimeConfig.test.js +57 -0
- package/src/common/utils/realtimeConfig.ts +228 -0
- package/src/common/utils/removeDuplicate.test.js +22 -0
- package/src/common/utils/removeDuplicate.ts +22 -0
- package/src/common/utils/renderTrajectories.ts +194 -0
- package/src/common/utils/sortAndFilterDepartures.ts +78 -0
- package/src/common/utils/sortByDelay.ts +29 -0
- package/src/common/utils/timeUtils.test.js +16 -0
- package/src/common/utils/timeUtils.ts +45 -0
- package/{iife.js → src/iife.js} +3 -1
- package/src/index.js +10 -0
- package/{mapbox/controls/CopyrightControl.js → src/mapbox/controls/CopyrightControl.ts} +26 -21
- package/src/mapbox/layers/Layer.test.js +217 -0
- package/src/mapbox/layers/Layer.ts +144 -0
- package/src/mapbox/layers/RealtimeLayer.test.js +13 -0
- package/src/mapbox/layers/RealtimeLayer.ts +350 -0
- package/src/mapbox/utils/getMercatorResolution.ts +21 -0
- package/src/mapbox/utils/getSourceCoordinates.ts +34 -0
- package/src/ol/README.md +0 -0
- package/src/ol/controls/CopyrightControl.test.js +211 -0
- package/src/ol/controls/CopyrightControl.ts +82 -0
- package/src/ol/controls/RoutingControl.test.js +205 -0
- package/src/ol/controls/RoutingControl.ts +869 -0
- package/src/ol/controls/StopFinderControl.test.js +59 -0
- package/{ol/controls/StopFinderControl.js → src/ol/controls/StopFinderControl.ts} +10 -7
- package/src/ol/controls/snapshots/RoutingControlRouteGen10.json +58 -0
- package/src/ol/controls/snapshots/RoutingControlRouteGen100.json +292 -0
- package/src/ol/controls/snapshots/RoutingControlRouteGen30.json +69 -0
- package/src/ol/controls/snapshots/RoutingControlRouteGen5.json +58 -0
- package/src/ol/controls/snapshots/RoutingControlRouteOSM.json +759 -0
- package/src/ol/controls/snapshots/RoutingControlStation1.json +60 -0
- package/src/ol/controls/snapshots/RoutingControlStation2.json +49 -0
- package/src/ol/layers/Layer.test.js +212 -0
- package/src/ol/layers/Layer.ts +252 -0
- package/src/ol/layers/MapGlLayer.ts +294 -0
- package/src/ol/layers/MapboxLayer.test.js +190 -0
- package/src/ol/layers/MapboxLayer.ts +136 -0
- package/src/ol/layers/MapboxStyleLayer.test.js +258 -0
- package/src/ol/layers/MapboxStyleLayer.ts +466 -0
- package/{ol/layers/MaplibreLayer.d.ts → src/ol/layers/MaplibreLayer.ts} +21 -10
- package/src/ol/layers/RealtimeLayer.test.js +84 -0
- package/src/ol/layers/RealtimeLayer.ts +465 -0
- package/src/ol/layers/RoutingLayer.test.js +48 -0
- package/src/ol/layers/RoutingLayer.ts +113 -0
- package/src/ol/layers/VectorLayer.test.js +87 -0
- package/src/ol/layers/VectorLayer.ts +48 -0
- package/src/ol/layers/WMSLayer.test.js +65 -0
- package/src/ol/layers/WMSLayer.ts +114 -0
- package/src/ol/styles/fullTrajectoryDelayStyle.ts +37 -0
- package/src/ol/styles/fullTrajectoryStyle.ts +56 -0
- package/{setupTests.js → src/setupTests.js} +12 -7
- package/tsconfig.json +23 -0
- package/api/RealtimeAPI.d.ts +0 -290
- package/api/RealtimeAPI.d.ts.map +0 -1
- package/api/RealtimeAPI.js +0 -483
- package/api/RoutingAPI.d.ts +0 -37
- package/api/RoutingAPI.d.ts.map +0 -1
- package/api/RoutingAPI.js +0 -35
- package/api/StopsAPI.d.ts +0 -38
- package/api/StopsAPI.d.ts.map +0 -1
- package/api/StopsAPI.js +0 -36
- package/api/index.d.ts +0 -4
- package/api/index.d.ts.map +0 -1
- package/api/typedefs.d.ts +0 -179
- package/api/typedefs.d.ts.map +0 -1
- package/common/api/HttpAPI.d.ts +0 -31
- package/common/api/HttpAPI.d.ts.map +0 -1
- package/common/api/HttpAPI.js +0 -57
- package/common/api/WebSocketAPI.d.ts +0 -153
- package/common/api/WebSocketAPI.d.ts.map +0 -1
- package/common/api/WebSocketAPI.js +0 -341
- package/common/controls/ControlCommon.d.ts +0 -76
- package/common/controls/ControlCommon.d.ts.map +0 -1
- package/common/controls/ControlCommon.js +0 -150
- package/common/controls/CopyrightControlCommon.d.ts +0 -13
- package/common/controls/CopyrightControlCommon.d.ts.map +0 -1
- package/common/controls/CopyrightControlCommon.js +0 -34
- package/common/controls/StopFinderControlCommon.d.ts +0 -55
- package/common/controls/StopFinderControlCommon.d.ts.map +0 -1
- package/common/controls/StopFinderControlCommon.js +0 -144
- package/common/index.d.ts +0 -3
- package/common/index.d.ts.map +0 -1
- package/common/layers/LayerCommon.d.ts +0 -94
- package/common/layers/LayerCommon.d.ts.map +0 -1
- package/common/layers/LayerCommon.js +0 -244
- package/common/mixins/RealtimeLayerMixin.d.ts +0 -288
- package/common/mixins/RealtimeLayerMixin.d.ts.map +0 -1
- package/common/mixins/RealtimeLayerMixin.js +0 -779
- package/common/mixins/UserInteractionsLayerMixin.d.ts +0 -60
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +0 -1
- package/common/mixins/UserInteractionsLayerMixin.js +0 -241
- package/common/styles/index.d.ts +0 -5
- package/common/styles/index.d.ts.map +0 -1
- package/common/styles/realtimeDefaultStyle.d.ts +0 -36
- package/common/styles/realtimeDefaultStyle.d.ts.map +0 -1
- package/common/styles/realtimeDefaultStyle.js +0 -276
- package/common/styles/realtimeDelayStyle.d.ts +0 -12
- package/common/styles/realtimeDelayStyle.d.ts.map +0 -1
- package/common/styles/realtimeDelayStyle.js +0 -13
- package/common/styles/realtimeHeadingStyle.d.ts +0 -12
- package/common/styles/realtimeHeadingStyle.d.ts.map +0 -1
- package/common/styles/realtimeHeadingStyle.js +0 -87
- package/common/styles/realtimeSimpleStyle.d.ts +0 -4
- package/common/styles/realtimeSimpleStyle.d.ts.map +0 -1
- package/common/styles/realtimeSimpleStyle.js +0 -23
- package/common/typedefs.d.ts +0 -183
- package/common/typedefs.d.ts.map +0 -1
- package/common/utils/compareDepartures.d.ts +0 -11
- package/common/utils/compareDepartures.d.ts.map +0 -1
- package/common/utils/compareDepartures.js +0 -35
- package/common/utils/createCanvas.d.ts +0 -11
- package/common/utils/createCanvas.d.ts.map +0 -1
- package/common/utils/createCanvas.js +0 -28
- package/common/utils/createRealtimeFilters.d.ts +0 -13
- package/common/utils/createRealtimeFilters.d.ts.map +0 -1
- package/common/utils/createRealtimeFilters.js +0 -74
- package/common/utils/debounceDeparturesMessages.d.ts +0 -13
- package/common/utils/debounceDeparturesMessages.d.ts.map +0 -1
- package/common/utils/debounceDeparturesMessages.js +0 -28
- package/common/utils/debounceWebsocketMessages.d.ts +0 -12
- package/common/utils/debounceWebsocketMessages.d.ts.map +0 -1
- package/common/utils/debounceWebsocketMessages.js +0 -30
- package/common/utils/getLayersAsFlatArray.d.ts +0 -4
- package/common/utils/getLayersAsFlatArray.d.ts.map +0 -1
- package/common/utils/getLayersAsFlatArray.js +0 -16
- package/common/utils/getMapboxMapCopyrights.d.ts +0 -18
- package/common/utils/getMapboxMapCopyrights.d.ts.map +0 -1
- package/common/utils/getMapboxMapCopyrights.js +0 -30
- package/common/utils/getMapboxRender.d.ts +0 -8
- package/common/utils/getMapboxRender.d.ts.map +0 -1
- package/common/utils/getMapboxRender.js +0 -88
- package/common/utils/getMaplibreRender.d.ts +0 -9
- package/common/utils/getMaplibreRender.d.ts.map +0 -1
- package/common/utils/getMaplibreRender.js +0 -40
- package/common/utils/getRealtimeModeSuffix.d.ts.map +0 -1
- package/common/utils/getRealtimeModeSuffix.js +0 -7
- package/common/utils/getUrlWithParams.d.ts +0 -9
- package/common/utils/getUrlWithParams.d.ts.map +0 -1
- package/common/utils/getUrlWithParams.js +0 -18
- package/common/utils/getVehiclePosition.d.ts +0 -16
- package/common/utils/getVehiclePosition.d.ts.map +0 -1
- package/common/utils/getVehiclePosition.js +0 -72
- package/common/utils/index.d.ts +0 -18
- package/common/utils/index.d.ts.map +0 -1
- package/common/utils/realtimeConfig.d.ts +0 -53
- package/common/utils/realtimeConfig.d.ts.map +0 -1
- package/common/utils/realtimeConfig.js +0 -202
- package/common/utils/removeDuplicate.d.ts +0 -10
- package/common/utils/removeDuplicate.d.ts.map +0 -1
- package/common/utils/removeDuplicate.js +0 -15
- package/common/utils/renderTrajectories.d.ts +0 -17
- package/common/utils/renderTrajectories.d.ts.map +0 -1
- package/common/utils/renderTrajectories.js +0 -110
- package/common/utils/sortAndFilterDepartures.d.ts +0 -16
- package/common/utils/sortAndFilterDepartures.d.ts.map +0 -1
- package/common/utils/sortAndFilterDepartures.js +0 -58
- package/common/utils/sortByDelay.d.ts +0 -4
- package/common/utils/sortByDelay.d.ts.map +0 -1
- package/common/utils/sortByDelay.js +0 -21
- package/common/utils/timeUtils.d.ts +0 -24
- package/common/utils/timeUtils.d.ts.map +0 -1
- package/common/utils/timeUtils.js +0 -39
- package/iife.d.ts +0 -3
- package/iife.d.ts.map +0 -1
- package/index.d.ts +0 -10
- package/index.d.ts.map +0 -1
- package/index.js +0 -10
- package/mapbox/controls/CopyrightControl.d.ts +0 -29
- package/mapbox/controls/CopyrightControl.d.ts.map +0 -1
- package/mapbox/controls/index.d.ts +0 -2
- package/mapbox/controls/index.d.ts.map +0 -1
- package/mapbox/index.d.ts +0 -6
- package/mapbox/index.d.ts.map +0 -1
- package/mapbox/layers/Layer.d.ts +0 -59
- package/mapbox/layers/Layer.d.ts.map +0 -1
- package/mapbox/layers/Layer.js +0 -101
- package/mapbox/layers/RealtimeLayer.d.ts +0 -180
- package/mapbox/layers/RealtimeLayer.d.ts.map +0 -1
- package/mapbox/layers/RealtimeLayer.js +0 -270
- package/mapbox/layers/index.d.ts +0 -3
- package/mapbox/layers/index.d.ts.map +0 -1
- package/mapbox/utils/getMercatorResolution.d.ts +0 -9
- package/mapbox/utils/getMercatorResolution.d.ts.map +0 -1
- package/mapbox/utils/getMercatorResolution.js +0 -18
- package/mapbox/utils/getSourceCoordinates.d.ts +0 -9
- package/mapbox/utils/getSourceCoordinates.d.ts.map +0 -1
- package/mapbox/utils/getSourceCoordinates.js +0 -27
- package/mapbox/utils/index.d.ts +0 -3
- package/mapbox/utils/index.d.ts.map +0 -1
- package/mbt.js +0 -64706
- package/mbt.js.map +0 -7
- package/mbt.min.js +0 -1090
- package/mbt.min.js.map +0 -7
- package/ol/controls/CopyrightControl.d.ts +0 -31
- package/ol/controls/CopyrightControl.d.ts.map +0 -1
- package/ol/controls/CopyrightControl.js +0 -68
- package/ol/controls/RoutingControl.d.ts +0 -193
- package/ol/controls/RoutingControl.d.ts.map +0 -1
- package/ol/controls/RoutingControl.js +0 -631
- package/ol/controls/StopFinderControl.d.ts +0 -30
- package/ol/controls/StopFinderControl.d.ts.map +0 -1
- package/ol/controls/index.d.ts +0 -4
- package/ol/controls/index.d.ts.map +0 -1
- package/ol/index.d.ts +0 -6
- package/ol/index.d.ts.map +0 -1
- package/ol/layers/Layer.d.ts +0 -86
- package/ol/layers/Layer.d.ts.map +0 -1
- package/ol/layers/Layer.js +0 -174
- package/ol/layers/MapGlLayer.d.ts +0 -67
- package/ol/layers/MapGlLayer.d.ts.map +0 -1
- package/ol/layers/MapGlLayer.js +0 -218
- package/ol/layers/MapboxLayer.d.ts +0 -50
- package/ol/layers/MapboxLayer.d.ts.map +0 -1
- package/ol/layers/MapboxLayer.js +0 -109
- package/ol/layers/MapboxStyleLayer.d.ts +0 -130
- package/ol/layers/MapboxStyleLayer.d.ts.map +0 -1
- package/ol/layers/MapboxStyleLayer.js +0 -378
- package/ol/layers/MaplibreLayer.d.ts.map +0 -1
- package/ol/layers/MaplibreLayer.js +0 -34
- package/ol/layers/RealtimeLayer.d.ts +0 -202
- package/ol/layers/RealtimeLayer.d.ts.map +0 -1
- package/ol/layers/RealtimeLayer.js +0 -332
- package/ol/layers/RoutingLayer.d.ts +0 -35
- package/ol/layers/RoutingLayer.d.ts.map +0 -1
- package/ol/layers/RoutingLayer.js +0 -85
- package/ol/layers/VectorLayer.d.ts +0 -25
- package/ol/layers/VectorLayer.d.ts.map +0 -1
- package/ol/layers/VectorLayer.js +0 -38
- package/ol/layers/WMSLayer.d.ts +0 -42
- package/ol/layers/WMSLayer.d.ts.map +0 -1
- package/ol/layers/WMSLayer.js +0 -88
- package/ol/layers/index.d.ts +0 -9
- package/ol/layers/index.d.ts.map +0 -1
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +0 -4
- package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +0 -1
- package/ol/styles/fullTrajectoryDelayStyle.js +0 -33
- package/ol/styles/fullTrajectoryStyle.d.ts +0 -5
- package/ol/styles/fullTrajectoryStyle.d.ts.map +0 -1
- package/ol/styles/fullTrajectoryStyle.js +0 -44
- package/ol/styles/index.d.ts +0 -3
- package/ol/styles/index.d.ts.map +0 -1
- package/setupTests.d.ts +0 -2
- package/setupTests.d.ts.map +0 -1
- /package/{api → src/api}/index.js +0 -0
- /package/{common → src/common}/index.js +0 -0
- /package/{common → src/common}/styles/index.js +0 -0
- /package/{mapbox → src/mapbox}/controls/index.js +0 -0
- /package/{mapbox → src/mapbox}/index.js +0 -0
- /package/{mapbox → src/mapbox}/layers/index.js +0 -0
- /package/{mapbox → src/mapbox}/utils/index.js +0 -0
- /package/{ol → src/ol}/controls/index.js +0 -0
- /package/{ol → src/ol}/index.js +0 -0
- /package/{ol → src/ol}/layers/index.js +0 -0
- /package/{ol → src/ol}/styles/index.js +0 -0
- /package/{types → src/types}/common.d.ts +0 -0
- /package/{types → src/types}/index.d.ts +0 -0
- /package/{types → src/types}/realtime.d.ts +0 -0
- /package/{types → src/types}/routing.d.ts +0 -0
- /package/{types → src/types}/stops.d.ts +0 -0
package/.esdoc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
source: './build',
|
|
3
|
+
destination: './apidoc',
|
|
4
|
+
includes: ['\\.(js)$', 'typedefs\\.js$'],
|
|
5
|
+
excludes: ['setupTests\\.*', '^iife', '^mbt\\.*', '\\.test\\.js$', 'doc/'],
|
|
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
|
+
{ name: './esdoc/plugins/optional-chaining-plugin/Plugin.js' },
|
|
17
|
+
],
|
|
18
|
+
};
|
package/.eslintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
build/*
|
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
'cypress/globals': true,
|
|
4
|
+
node: true,
|
|
5
|
+
browser: true,
|
|
6
|
+
es6: true,
|
|
7
|
+
jest: true,
|
|
8
|
+
},
|
|
9
|
+
parser: '@typescript-eslint/parser',
|
|
10
|
+
extends: ['airbnb', 'airbnb-typescript', 'prettier'],
|
|
11
|
+
plugins: ['@typescript-eslint', 'cypress', 'prettier'],
|
|
12
|
+
parserOptions: {
|
|
13
|
+
project: './tsconfig.json',
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'arrow-body-style': 0,
|
|
17
|
+
'react/jsx-filename-extension': [
|
|
18
|
+
1,
|
|
19
|
+
{
|
|
20
|
+
extensions: ['.js', '.jsx'],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
'prettier/prettier': 'error',
|
|
24
|
+
},
|
|
25
|
+
};
|
package/.fixpackrc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sortToTop": [
|
|
3
|
+
"name",
|
|
4
|
+
"license",
|
|
5
|
+
"description",
|
|
6
|
+
"version",
|
|
7
|
+
"author",
|
|
8
|
+
"homepage",
|
|
9
|
+
"main",
|
|
10
|
+
"module",
|
|
11
|
+
"files",
|
|
12
|
+
"exports",
|
|
13
|
+
"proxy",
|
|
14
|
+
"dependencies",
|
|
15
|
+
"peerDependencies",
|
|
16
|
+
"devDependencies",
|
|
17
|
+
"resolutions",
|
|
18
|
+
"scripts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
|
|
3
|
+
on: ['push']
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v3
|
|
11
|
+
- uses: actions/setup-node@v3
|
|
12
|
+
with:
|
|
13
|
+
node-version-file: '.nvmrc'
|
|
14
|
+
cache: 'yarn'
|
|
15
|
+
- run: yarn install --frozen-lockfile
|
|
16
|
+
- run: yarn build
|
|
@@ -0,0 +1,16 @@
|
|
|
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@v3
|
|
15
|
+
env:
|
|
16
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
name: Cypress
|
|
2
|
+
|
|
3
|
+
on: [push]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
chrome:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
container:
|
|
9
|
+
image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
|
|
10
|
+
options: --user 1001
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout
|
|
13
|
+
uses: actions/checkout@v3
|
|
14
|
+
- run: yarn install --frozen-lockfile
|
|
15
|
+
- run: yarn cypress info
|
|
16
|
+
- run: node --version
|
|
17
|
+
- run: node -p 'os.cpus()'
|
|
18
|
+
- run: yarn cy:test:chrome
|
|
19
|
+
edge:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
container:
|
|
22
|
+
image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
|
|
23
|
+
options: --user 1001
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v3
|
|
27
|
+
- run: yarn install --frozen-lockfile
|
|
28
|
+
- run: yarn cypress info
|
|
29
|
+
- run: node --version
|
|
30
|
+
- run: node -p 'os.cpus()'
|
|
31
|
+
- run: yarn cy:test:edge
|
|
32
|
+
|
|
33
|
+
# chrome:
|
|
34
|
+
# runs-on: ubuntu-latest
|
|
35
|
+
# container:
|
|
36
|
+
# image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
|
|
37
|
+
# options: --user 1001 # very important otherwise there is a permission error
|
|
38
|
+
# needs: install
|
|
39
|
+
# strategy:
|
|
40
|
+
# # when one test fails, DO NOT cancel the other
|
|
41
|
+
# # containers, because this will kill Cypress processes
|
|
42
|
+
# # leaving the Dashboard hanging ...
|
|
43
|
+
# # https://github.com/cypress-io/github-action/issues/48
|
|
44
|
+
# fail-fast: false
|
|
45
|
+
# matrix:
|
|
46
|
+
# # run copies of the current job in parallel
|
|
47
|
+
# containers: [1]
|
|
48
|
+
# steps:
|
|
49
|
+
# - name: Checkout
|
|
50
|
+
# uses: actions/checkout@v3
|
|
51
|
+
|
|
52
|
+
# - name: Download the build folders
|
|
53
|
+
# uses: actions/download-artifact@v3
|
|
54
|
+
# with:
|
|
55
|
+
# name: build
|
|
56
|
+
# path: .next
|
|
57
|
+
|
|
58
|
+
# # Install NPM dependencies, cache them correctly
|
|
59
|
+
# # and run all Cypress tests
|
|
60
|
+
# - name: Test Chrome
|
|
61
|
+
# uses: cypress-io/github-action@v4
|
|
62
|
+
# with:
|
|
63
|
+
# # Specify Browser since container image is compile with Firefox
|
|
64
|
+
# browser: chrome
|
|
65
|
+
# start: yarn start
|
|
66
|
+
# wait-on: 'http://localhost:3000'
|
|
67
|
+
|
|
68
|
+
# edge:
|
|
69
|
+
# runs-on: ubuntu-latest
|
|
70
|
+
# container:
|
|
71
|
+
# image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
|
|
72
|
+
# options: --user 1001 # very important otherwise there is a permission error
|
|
73
|
+
# needs: install
|
|
74
|
+
# strategy:
|
|
75
|
+
# # when one test fails, DO NOT cancel the other
|
|
76
|
+
# # containers, because this will kill Cypress processes
|
|
77
|
+
# # leaving the Dashboard hanging ...
|
|
78
|
+
# # https://github.com/cypress-io/github-action/issues/48
|
|
79
|
+
# fail-fast: false
|
|
80
|
+
# matrix:
|
|
81
|
+
# # run copies of the current job in parallel
|
|
82
|
+
# containers: [1]
|
|
83
|
+
# steps:
|
|
84
|
+
# - name: Checkout
|
|
85
|
+
# uses: actions/checkout@v3
|
|
86
|
+
|
|
87
|
+
# - name: Download the build folders
|
|
88
|
+
# uses: actions/download-artifact@v3
|
|
89
|
+
# with:
|
|
90
|
+
# name: build
|
|
91
|
+
# path: .next
|
|
92
|
+
|
|
93
|
+
# # Install NPM dependencies, cache them correctly
|
|
94
|
+
# # and run all Cypress tests
|
|
95
|
+
# - name: Test Edge
|
|
96
|
+
# uses: cypress-io/github-action@v4
|
|
97
|
+
# with:
|
|
98
|
+
# # Specify Browser since container image is compile with Firefox
|
|
99
|
+
# browser: edge
|
|
100
|
+
# start: yarn start
|
|
101
|
+
# wait-on: 'http://localhost:3000'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Lint / Unit tests
|
|
2
|
+
|
|
3
|
+
on: ['push']
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v3
|
|
11
|
+
- uses: actions/setup-node@v3
|
|
12
|
+
with:
|
|
13
|
+
node-version-file: '.nvmrc'
|
|
14
|
+
cache: 'yarn'
|
|
15
|
+
- run: yarn install --frozen-lockfile
|
|
16
|
+
- run: yarn lint
|
|
17
|
+
- run: yarn test
|
package/.lintstagedrc.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'(src|__mocks__)/**/*.js': [
|
|
3
|
+
'eslint --fix',
|
|
4
|
+
'prettier --write',
|
|
5
|
+
'git add',
|
|
6
|
+
'yarn test --bail --passWithNoTests --findRelatedTests',
|
|
7
|
+
],
|
|
8
|
+
'package.json': ['fixpack', 'git add'],
|
|
9
|
+
'src/**/*.{css,scss}': ['stylelint --fix --allow-empty-input'],
|
|
10
|
+
};
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20
|
package/.prettierrc.js
ADDED
package/.stylelintrc.js
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
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.3.9](https://github.com/geops/mobility-toolbox-js/compare/v2.3.8...v2.3.9) (2024-02-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* calculate the correct gen level when we highlight a trajectory ([#208](https://github.com/geops/mobility-toolbox-js/issues/208)) ([3d06bb7](https://github.com/geops/mobility-toolbox-js/commit/3d06bb71846572bdec185d4a66a5b5fd500d55c6))
|
|
11
|
+
|
|
12
|
+
### [2.3.8](https://github.com/geops/mobility-toolbox-js/compare/v2.3.7...v2.3.8) (2024-01-18)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* debounce calls to setBbox ([#206](https://github.com/geops/mobility-toolbox-js/issues/206)) ([b50feca](https://github.com/geops/mobility-toolbox-js/commit/b50feca53134856409ac79252e244ea97749435f))
|
|
18
|
+
|
|
19
|
+
### [2.3.7](https://github.com/geops/mobility-toolbox-js/compare/v2.3.6...v2.3.7) (2023-12-06)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* add a getText method in style options ([707d5e7](https://github.com/geops/mobility-toolbox-js/commit/707d5e728c8fe1925d676ae41d3dc0e196588f5d))
|
|
25
|
+
|
|
26
|
+
### [2.3.6](https://github.com/geops/mobility-toolbox-js/compare/v2.3.5...v2.3.6) (2023-12-06)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* add a getText method in style options ([92b4e93](https://github.com/geops/mobility-toolbox-js/commit/92b4e93597e4909e4aa996822fe01ee0ae9adbe2))
|
|
32
|
+
|
|
33
|
+
### [2.3.5](https://github.com/geops/mobility-toolbox-js/compare/v2.3.4...v2.3.5) (2023-11-17)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* simplify setBbox function ([8f99991](https://github.com/geops/mobility-toolbox-js/commit/8f99991df3f99c64b3776cd8c18dff0820c4a638))
|
|
39
|
+
* use floored value for the zoom ([7961de0](https://github.com/geops/mobility-toolbox-js/commit/7961de0d3e660d67658205aef5e6578ea79b440b))
|
|
40
|
+
|
|
41
|
+
### [2.3.4](https://github.com/geops/mobility-toolbox-js/compare/v2.3.3...v2.3.4) (2023-11-17)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* do not set generalizationLevelByZoom by default ([69b59ba](https://github.com/geops/mobility-toolbox-js/commit/69b59ba204529eb90cf1bd99a5bedd95705f821f))
|
|
47
|
+
* simplify getMotsByZoom behavior ([1fc259f](https://github.com/geops/mobility-toolbox-js/commit/1fc259f29bf3da276a158aa2c063e7609ca6a6f9))
|
|
48
|
+
* simplify getMotsByZoom behavior ([87e52ec](https://github.com/geops/mobility-toolbox-js/commit/87e52ec26e9d7204b563a39602fa3c0aa1a90530))
|
|
49
|
+
|
|
50
|
+
### [2.3.3](https://github.com/geops/mobility-toolbox-js/compare/v2.3.2...v2.3.3) (2023-11-17)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* add text parameter to getXXXFont functions ([83cec9b](https://github.com/geops/mobility-toolbox-js/commit/83cec9b3b9a58aad76a3944257cf83dc80710b89))
|
|
56
|
+
* send floor/ceil values to the websocket ([50b8b0a](https://github.com/geops/mobility-toolbox-js/commit/50b8b0aaad28f9cc63ab1c7f460d2662262bcfe6))
|
|
57
|
+
* update full trajectory layer when interacting and animating ([97a9ad8](https://github.com/geops/mobility-toolbox-js/commit/97a9ad86d03d4ca8f760df3269840537746cd403))
|
|
58
|
+
|
|
59
|
+
### [2.3.2](https://github.com/geops/mobility-toolbox-js/compare/v2.3.1...v2.3.2) (2023-11-14)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Bug Fixes
|
|
63
|
+
|
|
64
|
+
* add getXXXFont function to realtime style options ([310be23](https://github.com/geops/mobility-toolbox-js/commit/310be2350e96eb815d080f1a00eaafcb8d79e1e6))
|
|
65
|
+
|
|
66
|
+
### [2.3.1](https://github.com/geops/mobility-toolbox-js/compare/v2.3.0...v2.3.1) (2023-11-03)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* display delay in seconds when needed ([d3284f9](https://github.com/geops/mobility-toolbox-js/commit/d3284f988223fbb2e39542d84d875d75fa400cc7))
|
|
72
|
+
|
|
73
|
+
## [2.3.0](https://github.com/geops/mobility-toolbox-js/compare/v2.2.1...v2.3.0) (2023-10-26)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Features
|
|
77
|
+
|
|
78
|
+
* use realtime api v2 by default ([#194](https://github.com/geops/mobility-toolbox-js/issues/194)) ([fb5e950](https://github.com/geops/mobility-toolbox-js/commit/fb5e9509b17ee383278fe1af7d2e56c76633f3dc))
|
|
79
|
+
|
|
80
|
+
### [2.2.1](https://github.com/geops/mobility-toolbox-js/compare/v2.2.0...v2.2.1) (2023-10-25)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
* add new bboxParamters property ([ee56316](https://github.com/geops/mobility-toolbox-js/commit/ee5631604dbfee009c0e8c5208b5cedb51616796))
|
|
86
|
+
|
|
87
|
+
## [2.2.0](https://github.com/geops/mobility-toolbox-js/compare/v2.1.1...v2.2.0) (2023-10-13)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Features
|
|
91
|
+
|
|
92
|
+
* add new get an gettrajectory method in realtimeapi ([#195](https://github.com/geops/mobility-toolbox-js/issues/195)) ([0461fde](https://github.com/geops/mobility-toolbox-js/commit/0461fdebe8f36e0680eb5d802546ec91306da843))
|
|
93
|
+
|
|
94
|
+
### [2.1.1](https://github.com/geops/mobility-toolbox-js/compare/v2.1.0...v2.1.1) (2023-10-06)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Bug Fixes
|
|
98
|
+
|
|
99
|
+
* add trajectory to the list even if they are filtered out ([f0d034c](https://github.com/geops/mobility-toolbox-js/commit/f0d034c6cd815dde6a27c65ff85330df7720521b))
|
|
100
|
+
|
|
101
|
+
## [2.1.0](https://github.com/geops/mobility-toolbox-js/compare/v1.7.5...v2.1.0) (2022-06-20)
|
|
102
|
+
|
|
103
|
+
This version contains lot of breaking change, to make things simpler to use and to remove all application specific stuff.
|
|
104
|
+
We suggest to have a look at the [v2 migration guide](./MIGRATION-V2.md).
|
|
105
|
+
|
|
106
|
+
### Breaking changes
|
|
107
|
+
|
|
108
|
+
* all classes, api and utilities functions are available through a unique import (depending on which mapping library you use): `'mobility-toolbox-js/ol'` or `'mobility-toolbox-js/mapbox'`
|
|
109
|
+
|
|
110
|
+
* rename `TralisAPI` to `RealtimeAPI`
|
|
111
|
+
* rename `TralisModes` to `RealtimeModes`
|
|
112
|
+
* rename `TralisLayer` to `RealtimeLayer`
|
|
113
|
+
* remove `TrajservLayer` class
|
|
114
|
+
|
|
115
|
+
* remove `Map` classes. Use new `attachToMap()` and `detachFromMap()` function to add your layers/controls to a map
|
|
116
|
+
* remove all application specific properties from layers classes.`isQueryable`, `isBaseLayer`, `isAlwaysExpanded`, `isReactSpatialLayer`, `isTrackerLayer`, use `options.properties` in the constructor instead
|
|
117
|
+
|
|
118
|
+
* replace `MapboxLayer.createStyleUrl()` by an utility function `getUrlWithParams`
|
|
119
|
+
|
|
120
|
+
* pass `Mapboxgl.Map` options through a `mapOptions` object in the constructor instead of layers\'s property
|
|
121
|
+
* pass `RealtimeLayer` style properties through a `styleOptions` object in the constructor instead of layers\'s properties
|
|
122
|
+
* pass `RealtimeLayer` filters through the `filter` property instead of specific layers\'s properties
|
|
123
|
+
* harmonize backend responses
|
|
124
|
+
|
|
125
|
+
### Features
|
|
126
|
+
|
|
127
|
+
* use TypeScript
|
|
128
|
+
* use Maplibre
|
|
129
|
+
* use NextJS for website in `doc/` folder
|
|
130
|
+
* all classes, api and functions are available through a unique import (depending on what mapping library you use): `'mobility-toolbox-js/ol'` or `'mobility-toolbox-js/mapbox'`
|
|
131
|
+
* add a full single-file build for an easy use in raw html page or [codepen.io](https://codepen.io)
|
|
132
|
+
* 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
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/MIGRATION-V2.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Migration v2
|
|
2
|
+
|
|
3
|
+
The version contains a lot of breaking changes, to make things simpler to use and to remove all application specific stuff.
|
|
4
|
+
|
|
5
|
+
Here is an exhaustive list of what you have to change in your application code.
|
|
6
|
+
|
|
7
|
+
## exports
|
|
8
|
+
|
|
9
|
+
* all classes, api and utilities functions are available through a unique import (depending on what mapping library you use): `'mobility-toolbox-js/ol'` or `'mobility-toolbox-js/mapbox'`
|
|
10
|
+
|
|
11
|
+
## in Map classes
|
|
12
|
+
|
|
13
|
+
* remove all `Map` classes. Use the Mapbox or Openlayers Map directly then use `attachToMap()` and `detachFromMap()` functions.
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
// Before:
|
|
17
|
+
const map = new Map();
|
|
18
|
+
map.addLayer(myLayer);
|
|
19
|
+
map.addControl(myControl);
|
|
20
|
+
map.removeLayer(myLayer);
|
|
21
|
+
map.removeControl(myControl);
|
|
22
|
+
|
|
23
|
+
// After
|
|
24
|
+
const map = new Openlayers.Map();
|
|
25
|
+
myLayer.attachToMap(map);
|
|
26
|
+
myControl.attachToMap(map);
|
|
27
|
+
myLayer.detachFromMap();
|
|
28
|
+
myControl.detachFromMap();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## in all Layer classes
|
|
32
|
+
|
|
33
|
+
* add `group` property.
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
// Before:
|
|
37
|
+
const layer = new layer({ properties: { radioGroup: 'my group' }});
|
|
38
|
+
|
|
39
|
+
// After
|
|
40
|
+
const layer = new layer({ group: 'my group' });
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
* remove `TrajservLayer`, use `RealtimeLayer` instead
|
|
44
|
+
|
|
45
|
+
* remove `addChild()`,`removeChild()`, `hasVisibleChildren()`, `getVisibleChildren()` convenience methods, use `children` array directly instead
|
|
46
|
+
* remove `setVisible()` method, use layer\'s property instead
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// Before:
|
|
50
|
+
layer.setVisible(true);
|
|
51
|
+
|
|
52
|
+
// After
|
|
53
|
+
layer.visible = true;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
* remove `isBaseLayer` property
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
// Before:
|
|
60
|
+
const layer = new Layer({ isBaseLayer: true});
|
|
61
|
+
const isBaseLayer = layer.isBaseLayer;
|
|
62
|
+
|
|
63
|
+
// After
|
|
64
|
+
const layer = new Layer({ properties: { isBaseLayer: true }});
|
|
65
|
+
const isBaseLayer = layer.get('isBaseLayer');
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
* remove `isQueryable` property
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
// Before:
|
|
72
|
+
const layer = new Layer({ isQueryable: true});
|
|
73
|
+
const isQueryable = layer.isQueryable;
|
|
74
|
+
|
|
75
|
+
// After
|
|
76
|
+
const layer = new Layer({ properties: { isQueryable: true }});
|
|
77
|
+
const isQueryable = layer.get('isQueryable');
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
* remove `isAlwaysExpanded` property
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
// Before:
|
|
84
|
+
const layer = new Layer({ isAlwaysExpanded: true});
|
|
85
|
+
const isAlwaysExpanded = layer.isAlwaysExpanded;
|
|
86
|
+
|
|
87
|
+
// After
|
|
88
|
+
const layer = new Layer({ properties: { isAlwaysExpanded: true }});
|
|
89
|
+
const isAlwaysExpanded = layer.get('isAlwaysExpanded');
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
* remove `isReactSpatialLayer` property
|
|
93
|
+
|
|
94
|
+
* replace `init()` by `attachToMap()`
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
// Before:
|
|
98
|
+
layer.init(map)
|
|
99
|
+
|
|
100
|
+
// After
|
|
101
|
+
layer.attachToMap(map)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
* replace `terminate()` by `detachFromMap()`
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
// Before:
|
|
108
|
+
layer.terminate()
|
|
109
|
+
|
|
110
|
+
// After
|
|
111
|
+
layer.detachFromMap()
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## in MapboxLayer and MaplibreLayer classes
|
|
115
|
+
|
|
116
|
+
* remove `options.preserveDrawingBuffer`, use `options.mapOptions` in the constructor
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
// Before:
|
|
120
|
+
const layer = new MapoxLayer({ preserveDrawingBuffer: true});
|
|
121
|
+
|
|
122
|
+
// After
|
|
123
|
+
const layer = new Layer({ mapOptions: { preserveDrawingBuffer: true}});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
* replace `createStyleUrl()` by an utility function `getUrlWithParams()`
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
// Before:
|
|
130
|
+
const layer = new MapoxLayer();
|
|
131
|
+
const url = layer.createStyleUrl();
|
|
132
|
+
|
|
133
|
+
// After
|
|
134
|
+
import { getUrlWithParams } from 'mobility-toolbox-js/common';
|
|
135
|
+
const layer = new MapoxLayer();
|
|
136
|
+
const url = getUrlWithParams(layer.url, { [layer.apiKeyName]: layer.apiKey }).toString();
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## in TralisLayer classes
|
|
140
|
+
|
|
141
|
+
* rename `TralisLayer` to `RealtimeLayer`
|
|
142
|
+
* remove `isTrackerLayer` property
|
|
143
|
+
* remove properties : `publishedLineName`, `tripNumber`, `operator`, `regexPublishedLineName`. Use utility function `createRealtimeFilters()` instead.
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
// Before:
|
|
147
|
+
const layer = new TralisLayer({
|
|
148
|
+
publishedLineName: 'foo',
|
|
149
|
+
tripNumber: 2,
|
|
150
|
+
operator: 'bar',
|
|
151
|
+
regexPublishedLineName: /.*/,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// After
|
|
155
|
+
import { createRealtimeFilters } from 'mobility-toolbox-js/common';
|
|
156
|
+
|
|
157
|
+
const layer = new RealtimeLayer({
|
|
158
|
+
filter: createRealtimeFilters('foo','2','bar', /.*/),
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
* remove all automatic filter through permalink using `publishedlinename`, `tripnumber`, `operator`
|
|
163
|
+
|
|
164
|
+
```js
|
|
165
|
+
// After
|
|
166
|
+
import { createRealtimeFilters } from 'mobility-toolbox-js/common';
|
|
167
|
+
const params = new URLSearchParans(window.location.search);
|
|
168
|
+
const layer = new RealtimeLayer({
|
|
169
|
+
filter: createRealtimeFilters(
|
|
170
|
+
params.get('publishedlinename'),
|
|
171
|
+
params.get('tripnumber'),
|
|
172
|
+
params.get('operator'),
|
|
173
|
+
),
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
* remove style properties `delayOutlineColor`, `delayDisplay`, `iconScale`. Use `options.styleOptions` in the constructor to proivde these valeu to the rendering.
|
|
178
|
+
|
|
179
|
+
```js
|
|
180
|
+
// Before
|
|
181
|
+
const layer = new RealtimeLayer({
|
|
182
|
+
delayOutlineColor:'#000',
|
|
183
|
+
delayDisplay: 300000,
|
|
184
|
+
iconScale: 0.5,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// After
|
|
188
|
+
const layer = new RealtimeLayer({
|
|
189
|
+
styleOptions: {
|
|
190
|
+
delayOutlineColor:'#000',
|
|
191
|
+
delayDisplay: 300000,
|
|
192
|
+
iconScale: 0.5,
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
* remove `getVehiclesAtCoordinate()`, use `getFeatureAtCoordinate()`instead
|
|
198
|
+
|
|
199
|
+
* remove `useDelayStyle` property, use `style`, `sort` and `fullTrajectoryStyle` instead
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
// Before
|
|
203
|
+
import { TralisLayer } from 'mobility-toolbox-js/ol';
|
|
204
|
+
const layer = new TralisLayer({
|
|
205
|
+
useDelayStyle: true,
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// After
|
|
209
|
+
import {
|
|
210
|
+
RealtimeLayer,
|
|
211
|
+
fullTrajectoryDelayStyle,
|
|
212
|
+
realtimeDelayStyle,
|
|
213
|
+
sortByDelay,
|
|
214
|
+
} from 'mobility-toolbox-js/ol';
|
|
215
|
+
const layer = new RealtimeLayer({
|
|
216
|
+
style: realtimeDelayStyle,
|
|
217
|
+
sort: sortByDelay,
|
|
218
|
+
fullTrajectoryStyle: fullTrajectoryDelayStyle,
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## in api classes
|
|
223
|
+
|
|
224
|
+
* rename `TralisAPI` to `RealtimeAPI`
|
|
225
|
+
* rename `TralisModes` to `RealtimeModes`
|
|
226
|
+
|
|
227
|
+
## in StopsAPI class
|
|
228
|
+
|
|
229
|
+
* `search()` method returns a GeoJSON feature collection instead of an array of GeoJSON feature
|
|
230
|
+
|
|
231
|
+
```js
|
|
232
|
+
// Before
|
|
233
|
+
const api = new StopsAPI({ ... });
|
|
234
|
+
api.search().then((arrayOfFeatures) => {
|
|
235
|
+
const feature = arrayOfFeatures[0];
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
// After
|
|
239
|
+
const api = new StopsAPI({ ... });
|
|
240
|
+
api.search().then((featureCollection) => {
|
|
241
|
+
const feature = featureCollection.features[0];
|
|
242
|
+
});
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## in RealtimeAPI class
|
|
246
|
+
|
|
247
|
+
* `subscribeXXX()` methods have all the same signature and returns now the complete websocket message. Check the [doc](https://mobility-toolbox-js.geops.io/doc/class/build/api/RealtimeAPI%20js~RealtimeAPI) for more informations.
|
|
248
|
+
* some `getXXX()` methods have a different signature. Check the [doc](https://mobility-toolbox-js.geops.io/doc/class/build/api/RealtimeAPI%20js~RealtimeAPI) for more informations.
|