mobility-toolbox-js 2.3.10 → 2.3.11
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/api/RealtimeAPI.d.ts +290 -0
- package/api/RealtimeAPI.d.ts.map +1 -0
- package/api/RealtimeAPI.js +483 -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/typedefs.d.ts +179 -0
- package/api/typedefs.d.ts.map +1 -0
- package/{src/api → api}/typedefs.js +1 -11
- 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 +341 -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/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 +288 -0
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
- package/common/mixins/RealtimeLayerMixin.js +779 -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/realtimeDefaultStyle.d.ts +36 -0
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.js +276 -0
- package/common/styles/realtimeDelayStyle.d.ts +12 -0
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
- package/common/styles/realtimeDelayStyle.js +13 -0
- package/common/styles/realtimeHeadingStyle.d.ts +12 -0
- package/common/styles/realtimeHeadingStyle.d.ts.map +1 -0
- package/common/styles/realtimeHeadingStyle.js +87 -0
- package/common/styles/realtimeSimpleStyle.d.ts +4 -0
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
- package/common/styles/realtimeSimpleStyle.js +23 -0
- package/common/typedefs.d.ts +183 -0
- package/common/typedefs.d.ts.map +1 -0
- package/{src/common → common}/typedefs.js +1 -1
- 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 +11 -0
- package/common/utils/createCanvas.d.ts.map +1 -0
- package/common/utils/createCanvas.js +28 -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 +13 -0
- package/common/utils/debounceDeparturesMessages.d.ts.map +1 -0
- package/common/utils/debounceDeparturesMessages.js +28 -0
- package/common/utils/debounceWebsocketMessages.d.ts +12 -0
- package/common/utils/debounceWebsocketMessages.d.ts.map +1 -0
- package/common/utils/debounceWebsocketMessages.js +30 -0
- package/common/utils/getLayersAsFlatArray.d.ts +4 -0
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
- package/common/utils/getLayersAsFlatArray.js +16 -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 +8 -0
- package/common/utils/getMapboxRender.d.ts.map +1 -0
- package/common/utils/getMapboxRender.js +88 -0
- package/common/utils/getMaplibreRender.d.ts +9 -0
- package/common/utils/getMaplibreRender.d.ts.map +1 -0
- package/common/utils/getMaplibreRender.js +40 -0
- package/{src/common/utils/getRealtimeModeSuffix.ts → common/utils/getRealtimeModeSuffix.d.ts} +2 -4
- 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 +72 -0
- package/common/utils/index.d.ts +18 -0
- package/common/utils/index.d.ts.map +1 -0
- package/{src/common → common}/utils/index.js +2 -1
- package/common/utils/realtimeConfig.d.ts +53 -0
- package/common/utils/realtimeConfig.d.ts.map +1 -0
- package/common/utils/realtimeConfig.js +202 -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 +110 -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 +4 -0
- package/common/utils/sortByDelay.d.ts.map +1 -0
- package/common/utils/sortByDelay.js +21 -0
- package/common/utils/timeUtils.d.ts +24 -0
- package/common/utils/timeUtils.d.ts.map +1 -0
- package/common/utils/timeUtils.js +39 -0
- package/iife.d.ts +3 -0
- package/iife.d.ts.map +1 -0
- package/{src/iife.js → iife.js} +1 -3
- 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/{src/mapbox/controls/CopyrightControl.ts → mapbox/controls/CopyrightControl.js} +21 -26
- package/mapbox/controls/index.d.ts +2 -0
- package/mapbox/controls/index.d.ts.map +1 -0
- package/mapbox/index.d.ts +6 -0
- package/mapbox/index.d.ts.map +1 -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 +270 -0
- package/mapbox/layers/index.d.ts +3 -0
- package/mapbox/layers/index.d.ts.map +1 -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/mbt.js +64817 -0
- package/mbt.js.map +7 -0
- package/mbt.min.js +1090 -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 +631 -0
- package/ol/controls/StopFinderControl.d.ts +30 -0
- package/ol/controls/StopFinderControl.d.ts.map +1 -0
- package/{src/ol/controls/StopFinderControl.ts → ol/controls/StopFinderControl.js} +7 -10
- package/ol/controls/index.d.ts +4 -0
- package/ol/controls/index.d.ts.map +1 -0
- package/ol/index.d.ts +6 -0
- package/ol/index.d.ts.map +1 -0
- package/ol/layers/Layer.d.ts +86 -0
- package/ol/layers/Layer.d.ts.map +1 -0
- package/ol/layers/Layer.js +174 -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 +128 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.js +362 -0
- package/{src/ol/layers/MaplibreLayer.ts → ol/layers/MaplibreLayer.d.ts} +10 -21
- package/ol/layers/MaplibreLayer.d.ts.map +1 -0
- package/ol/layers/MaplibreLayer.js +34 -0
- package/ol/layers/RealtimeLayer.d.ts +202 -0
- package/ol/layers/RealtimeLayer.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.js +332 -0
- package/ol/layers/RoutingLayer.d.ts +35 -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/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/package.json +1 -1
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/{src/setupTests.js → setupTests.js} +7 -12
- package/.esdoc.js +0 -18
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -25
- package/.fixpackrc +0 -20
- package/.github/workflows/build.yml +0 -16
- package/.github/workflows/conventional-pr-title.yml +0 -16
- package/.github/workflows/cypress.yml +0 -101
- package/.github/workflows/test.yml +0 -17
- 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/.lintstagedrc.js +0 -10
- package/.nvmrc +0 -1
- package/.prettierrc.js +0 -5
- package/.stylelintrc.js +0 -4
- package/CHANGELOG.md +0 -132
- package/LICENSE +0 -21
- package/MIGRATION-V2.md +0 -248
- package/README.md +0 -42
- package/__mocks__/mapbox-gl.js +0 -81
- package/__mocks__/maplibre-gl.js +0 -81
- package/babel.config.js +0 -9
- package/commitlint.config.js +0 -1
- package/cypress/e2e/examples/api.cy.js +0 -7
- package/cypress/e2e/examples/examples.cy.js +0 -7
- package/cypress/e2e/examples/navigation.cy.js +0 -29
- package/cypress/fixtures/example.json +0 -5
- package/cypress/plugins/index.js +0 -21
- package/cypress/support/commands.js +0 -25
- package/cypress/support/e2e.js +0 -20
- package/cypress.config.ts +0 -15
- 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/dependabot.yml +0 -15
- package/doc/.eslintrc.json +0 -1
- package/doc/README.md +0 -34
- package/doc/next.config.js +0 -16
- package/doc/package.json +0 -41
- package/doc/pages/404.js +0 -5
- package/doc/pages/_app.js +0 -61
- package/doc/pages/_document.js +0 -64
- package/doc/pages/doc/[...slug].js +0 -23
- package/doc/pages/doc.js +0 -23
- package/doc/pages/example/[example].js +0 -52
- package/doc/pages/examples.js +0 -34
- package/doc/pages/index.js +0 -25
- package/doc/public/README.md +0 -15
- 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 +0 -93
- package/doc/public/static/examples/assets/tralis-live-map/index.js +0 -11
- package/doc/public/static/examples/assets/tralis-live-map/s1kreis.svg +0 -105
- package/doc/public/static/examples/assets/tralis-live-map/s20kreis.svg +0 -101
- package/doc/public/static/examples/assets/tralis-live-map/s2kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s3kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s4kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s6kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s7kreis.svg +0 -95
- package/doc/public/static/examples/assets/tralis-live-map/s8kreis.svg +0 -93
- package/doc/public/static/examples/assets/tralis-live-map/unknown.svg +0 -107
- package/doc/public/static/examples/layers.html +0 -11
- package/doc/public/static/examples/layers.js +0 -97
- package/doc/public/static/examples/mb-copyright.html +0 -26
- package/doc/public/static/examples/mb-copyright.js +0 -37
- package/doc/public/static/examples/mb-tracker.html +0 -1
- package/doc/public/static/examples/mb-tracker.js +0 -40
- package/doc/public/static/examples/mb-tracker.md +0 -1
- package/doc/public/static/examples/mb-tralis.html +0 -1
- package/doc/public/static/examples/mb-tralis.js +0 -34
- package/doc/public/static/examples/ol-copyright.html +0 -26
- package/doc/public/static/examples/ol-copyright.js +0 -43
- package/doc/public/static/examples/ol-mapbox-layer.html +0 -1
- package/doc/public/static/examples/ol-mapbox-layer.js +0 -28
- package/doc/public/static/examples/ol-mapbox-style-layer.html +0 -12
- package/doc/public/static/examples/ol-mapbox-style-layer.js +0 -48
- package/doc/public/static/examples/ol-query.html +0 -32
- package/doc/public/static/examples/ol-query.js +0 -83
- package/doc/public/static/examples/ol-routing.html +0 -26
- package/doc/public/static/examples/ol-routing.js +0 -65
- package/doc/public/static/examples/ol-routing.md +0 -1
- package/doc/public/static/examples/ol-stop-finder.html +0 -15
- package/doc/public/static/examples/ol-stop-finder.js +0 -35
- package/doc/public/static/examples/ol-stop-finder.md +0 -1
- package/doc/public/static/examples/ol-tracker.html +0 -1
- package/doc/public/static/examples/ol-tracker.js +0 -41
- package/doc/public/static/examples/ol-tracker.md +0 -1
- package/doc/public/static/examples/ol-tralis.html +0 -5
- package/doc/public/static/examples/ol-tralis.js +0 -62
- package/doc/public/static/examples/tralis-live-map.html +0 -1
- package/doc/public/static/examples/tralis-live-map.js +0 -67
- package/doc/public/static/examples/tralis-live-map.md +0 -3
- 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 +0 -4
- package/doc/src/components/CodeSandboxButton.js +0 -102
- package/doc/src/components/Documentation.js +0 -42
- package/doc/src/components/Esdoc/Anchor.js +0 -57
- package/doc/src/components/Esdoc/ClassDoc.js +0 -272
- package/doc/src/components/Esdoc/DeprecatedHTML.js +0 -16
- package/doc/src/components/Esdoc/DetailDocs.js +0 -279
- package/doc/src/components/Esdoc/DetailHTML.js +0 -33
- package/doc/src/components/Esdoc/DirectSubclassHTML.js +0 -30
- package/doc/src/components/Esdoc/DocBuilderUtils.js +0 -697
- package/doc/src/components/Esdoc/DocLinkHTML.js +0 -63
- package/doc/src/components/Esdoc/DocsLinkHTML.js +0 -38
- package/doc/src/components/Esdoc/Esdoc.js +0 -63
- package/doc/src/components/Esdoc/EsdocContent.js +0 -56
- package/doc/src/components/Esdoc/EsdocNavigation.js +0 -13
- package/doc/src/components/Esdoc/EsdocSearch.js +0 -78
- package/doc/src/components/Esdoc/ExperimentalHTML.js +0 -17
- package/doc/src/components/Esdoc/ExtendsChainHTML.js +0 -32
- package/doc/src/components/Esdoc/FileDocLinkHTML.js +0 -62
- package/doc/src/components/Esdoc/IdentifiersDoc.js +0 -113
- package/doc/src/components/Esdoc/IndirectSubclassHTML.js +0 -30
- package/doc/src/components/Esdoc/InheritedSummaryDoc.js +0 -70
- package/doc/src/components/Esdoc/InheritedSummaryHTML.js +0 -38
- package/doc/src/components/Esdoc/MixinClassesHTML.js +0 -29
- package/doc/src/components/Esdoc/NavDoc.js +0 -112
- package/doc/src/components/Esdoc/OverrideMethod.js +0 -44
- package/doc/src/components/Esdoc/OverrideMethodDescription.js +0 -35
- package/doc/src/components/Esdoc/Properties.js +0 -89
- package/doc/src/components/Esdoc/README.md +0 -45
- package/doc/src/components/Esdoc/SignatureHTML.js +0 -123
- package/doc/src/components/Esdoc/SingleDoc.js +0 -31
- package/doc/src/components/Esdoc/SummaryDoc.js +0 -160
- package/doc/src/components/Esdoc/SummaryHTML.js +0 -96
- package/doc/src/components/Esdoc/TypeDocLinkHTML.js +0 -251
- package/doc/src/components/Esdoc/index.js +0 -7
- package/doc/src/components/Esdoc/taffydb.js +0 -2070
- package/doc/src/components/Example.js +0 -200
- package/doc/src/components/ExampleCard.js +0 -126
- package/doc/src/components/Examples.js +0 -78
- package/doc/src/components/Home.js +0 -121
- package/doc/src/components/TrackerExample.js +0 -39
- package/doc/src/examples.js +0 -117
- package/doc/styles/App.scss +0 -53
- package/doc/styles/identifiers.css +0 -38
- package/doc/styles/search.css +0 -76
- package/doc/styles/style.css +0 -603
- 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 -93
- package/esdoc/plugins/optional-chaining-plugin/Plugin.js +0 -8
- package/global-setup.js +0 -3
- package/jest.config.js +0 -24
- package/pull_request_template.md +0 -17
- package/scripts/read-pkg-json.js +0 -22
- package/src/api/RealtimeAPI.test.js +0 -144
- package/src/api/RealtimeAPI.ts +0 -712
- package/src/api/RoutingAPI.test.js +0 -41
- package/src/api/RoutingAPI.ts +0 -47
- package/src/api/StopsAPI.test.js +0 -34
- package/src/api/StopsAPI.ts +0 -45
- package/src/common/api/HttpAPI.test.js +0 -68
- package/src/common/api/HttpAPI.ts +0 -77
- package/src/common/api/WebSocketAPI.test.js +0 -421
- package/src/common/api/WebSocketAPI.ts +0 -515
- package/src/common/controls/ControlCommon.test.js +0 -106
- package/src/common/controls/ControlCommon.ts +0 -194
- package/src/common/controls/CopyrightControlCommon.ts +0 -41
- package/src/common/controls/StopFinderControlCommon.ts +0 -192
- package/src/common/layers/LayerCommon.test.js +0 -158
- package/src/common/layers/LayerCommon.ts +0 -321
- package/src/common/mixins/RealtimeLayerMixin.ts +0 -1168
- package/src/common/mixins/UserInteractionsLayerMixin.test.js +0 -227
- package/src/common/mixins/UserInteractionsLayerMixin.ts +0 -352
- package/src/common/styles/realtimeDefaultStyle.ts +0 -436
- package/src/common/styles/realtimeDelayStyle.ts +0 -27
- package/src/common/styles/realtimeHeadingStyle.ts +0 -138
- package/src/common/styles/realtimeSimpleStyle.ts +0 -25
- package/src/common/utils/compareDepartures.ts +0 -46
- package/src/common/utils/createCanvas.ts +0 -33
- package/src/common/utils/createRealtimeFilters.test.js +0 -100
- package/src/common/utils/createRealtimeFilters.ts +0 -96
- package/src/common/utils/debounceDeparturesMessages.ts +0 -52
- package/src/common/utils/debounceWebsocketMessages.ts +0 -47
- package/src/common/utils/getLayersAsFlatArray.ts +0 -17
- package/src/common/utils/getMapboxMapCopyrights.test.js +0 -47
- package/src/common/utils/getMapboxMapCopyrights.ts +0 -52
- package/src/common/utils/getMapboxRender.ts +0 -104
- package/src/common/utils/getMaplibreRender.ts +0 -54
- package/src/common/utils/getUrlWithParams.ts +0 -21
- package/src/common/utils/getVehiclePosition.ts +0 -92
- package/src/common/utils/realtimeConfig.test.js +0 -57
- package/src/common/utils/realtimeConfig.ts +0 -228
- package/src/common/utils/removeDuplicate.test.js +0 -22
- package/src/common/utils/removeDuplicate.ts +0 -22
- package/src/common/utils/renderTrajectories.ts +0 -194
- package/src/common/utils/sortAndFilterDepartures.ts +0 -78
- package/src/common/utils/sortByDelay.ts +0 -29
- package/src/common/utils/timeUtils.test.js +0 -16
- package/src/common/utils/timeUtils.ts +0 -45
- package/src/index.js +0 -10
- package/src/mapbox/layers/Layer.test.js +0 -217
- package/src/mapbox/layers/Layer.ts +0 -144
- package/src/mapbox/layers/RealtimeLayer.test.js +0 -13
- package/src/mapbox/layers/RealtimeLayer.ts +0 -350
- package/src/mapbox/utils/getMercatorResolution.ts +0 -21
- package/src/mapbox/utils/getSourceCoordinates.ts +0 -34
- package/src/ol/README.md +0 -0
- package/src/ol/controls/CopyrightControl.test.js +0 -211
- package/src/ol/controls/CopyrightControl.ts +0 -82
- package/src/ol/controls/RoutingControl.test.js +0 -205
- package/src/ol/controls/RoutingControl.ts +0 -869
- 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/layers/Layer.test.js +0 -212
- package/src/ol/layers/Layer.ts +0 -252
- package/src/ol/layers/MapGlLayer.ts +0 -294
- package/src/ol/layers/MapboxLayer.test.js +0 -190
- package/src/ol/layers/MapboxLayer.ts +0 -136
- package/src/ol/layers/MapboxStyleLayer.test.js +0 -258
- package/src/ol/layers/MapboxStyleLayer.ts +0 -466
- package/src/ol/layers/RealtimeLayer.test.js +0 -84
- package/src/ol/layers/RealtimeLayer.ts +0 -465
- package/src/ol/layers/RoutingLayer.test.js +0 -48
- package/src/ol/layers/RoutingLayer.ts +0 -113
- package/src/ol/layers/VectorLayer.test.js +0 -87
- package/src/ol/layers/VectorLayer.ts +0 -48
- package/src/ol/layers/WMSLayer.test.js +0 -65
- package/src/ol/layers/WMSLayer.ts +0 -114
- package/src/ol/styles/fullTrajectoryDelayStyle.ts +0 -37
- package/src/ol/styles/fullTrajectoryStyle.ts +0 -56
- package/tsconfig.json +0 -23
- /package/{src/api → api}/index.js +0 -0
- /package/{src/common → common}/index.js +0 -0
- /package/{src/common → common}/styles/index.js +0 -0
- /package/{src/mapbox → mapbox}/controls/index.js +0 -0
- /package/{src/mapbox → mapbox}/index.js +0 -0
- /package/{src/mapbox → mapbox}/layers/index.js +0 -0
- /package/{src/mapbox → mapbox}/utils/index.js +0 -0
- /package/{src/ol → ol}/controls/index.js +0 -0
- /package/{src/ol → ol}/index.js +0 -0
- /package/{src/ol → ol}/layers/index.js +0 -0
- /package/{src/ol → ol}/styles/index.js +0 -0
- /package/{src/types → types}/common.d.ts +0 -0
- /package/{src/types → types}/index.d.ts +0 -0
- /package/{src/types → types}/realtime.d.ts +0 -0
- /package/{src/types → types}/routing.d.ts +0 -0
- /package/{src/types → types}/stops.d.ts +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import GeoJSON from 'ol/format/GeoJSON';
|
|
2
|
+
import Feature, { FeatureLike } from 'ol/Feature';
|
|
3
|
+
import { MapEvent } from 'ol';
|
|
4
|
+
import { Coordinate } from 'ol/coordinate';
|
|
5
|
+
import { ObjectEvent } from 'ol/Object';
|
|
6
|
+
import Layer from './Layer';
|
|
7
|
+
import { RealtimeLayerMixinOptions } from '../../common/mixins/RealtimeLayerMixin';
|
|
8
|
+
import { AnyMap, LayerGetFeatureInfoResponse, RealtimeFullTrajectory, RealtimeTrainId, ViewState } from '../../types';
|
|
9
|
+
import { RealtimeTrajectory } from '../../api/typedefs';
|
|
10
|
+
import { WebSocketAPIMessageEventData } from '../../common/api/WebSocketAPI';
|
|
11
|
+
export type OlRealtimeLayerOptions = RealtimeLayerMixinOptions & {
|
|
12
|
+
fullTrajectoryStyle?: (feature: FeatureLike, resolution: number, options: any) => void;
|
|
13
|
+
allowRenderWhenAnimating?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const RealtimeLayer_base: {
|
|
16
|
+
new (options: RealtimeLayerMixinOptions): {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
debug: boolean;
|
|
19
|
+
trajectories?: {
|
|
20
|
+
[key: string]: GeoJSONFeature;
|
|
21
|
+
} | undefined;
|
|
22
|
+
canvas?: import("../../types").AnyCanvas | undefined;
|
|
23
|
+
mode: import("../../types").RealtimeMode;
|
|
24
|
+
api: import("..").RealtimeAPI;
|
|
25
|
+
tenant: string;
|
|
26
|
+
bboxParameters?: {
|
|
27
|
+
[index: string]: string | number | boolean | string[] | number[] | boolean[];
|
|
28
|
+
} | undefined;
|
|
29
|
+
time?: Date | undefined;
|
|
30
|
+
live?: boolean | undefined;
|
|
31
|
+
speed?: number | undefined;
|
|
32
|
+
filter?: Function | undefined;
|
|
33
|
+
sort?: Function | undefined;
|
|
34
|
+
style?: import("../../types").RealtimeStyleFunction | undefined;
|
|
35
|
+
styleOptions?: import("../../types").RealtimeStyleOptions | undefined;
|
|
36
|
+
pixelRatio?: number | undefined;
|
|
37
|
+
minZoomInterpolation: number;
|
|
38
|
+
isUpdateBboxOnMoveEnd: boolean;
|
|
39
|
+
hoverVehicleId?: string | undefined;
|
|
40
|
+
selectedVehicleId?: string | undefined;
|
|
41
|
+
renderState?: import("../../types").RealtimeRenderState | undefined;
|
|
42
|
+
useRequestAnimationFrame?: boolean | undefined;
|
|
43
|
+
useDebounce?: boolean | undefined;
|
|
44
|
+
useThrottle?: boolean | undefined;
|
|
45
|
+
mots?: import("../../types").RealtimeMot[] | undefined;
|
|
46
|
+
motsByZoom: import("../../types").RealtimeMot[][];
|
|
47
|
+
generalizationLevel?: import("../../types").RealtimeGeneralizationLevel | undefined;
|
|
48
|
+
/** @private */
|
|
49
|
+
generalizationLevelByZoom: import("../../types").RealtimeGeneralizationLevel[];
|
|
50
|
+
renderTimeIntervalByZoom: number[];
|
|
51
|
+
format: GeoJSON<typeof Feature>;
|
|
52
|
+
requestId?: number | undefined;
|
|
53
|
+
updateTimeInterval?: number | undefined;
|
|
54
|
+
updateTimeDelay?: number | undefined;
|
|
55
|
+
visibilityRef: import("ol/events").EventsKey;
|
|
56
|
+
selectedVehicle: GeoJSONFeature;
|
|
57
|
+
getMotsByZoom: (zoom: number) => import("../../types").RealtimeMot[];
|
|
58
|
+
getGeneralizationLevelByZoom: (zoom: number) => import("../../types").RealtimeGeneralizationLevel;
|
|
59
|
+
getRenderTimeIntervalByZoom: (zoom: number) => number;
|
|
60
|
+
throttleRenderTrajectories: (viewState: ViewState, noInterpolate?: boolean | undefined) => void;
|
|
61
|
+
debounceRenderTrajectories: (viewState: ViewState, noInterpolate?: boolean | undefined) => void;
|
|
62
|
+
onStart?: ((realtimeLayer: any) => void) | undefined;
|
|
63
|
+
onStop?: ((realtimeLayer: any) => void) | undefined;
|
|
64
|
+
defineProperties(options: RealtimeLayerMixinOptions): void;
|
|
65
|
+
attachToMap(map: any): void;
|
|
66
|
+
detachFromMap(): void;
|
|
67
|
+
start(): void;
|
|
68
|
+
startUpdateTime(): void;
|
|
69
|
+
stop(): void;
|
|
70
|
+
stopUpdateTime(): void;
|
|
71
|
+
renderTrajectoriesInternal(viewState: ViewState, noInterpolate?: boolean): boolean;
|
|
72
|
+
renderTrajectories(viewState: ViewState | undefined, noInterpolate: boolean | undefined): void;
|
|
73
|
+
setBbox(extent: [number, number, number, number], zoom: number): void;
|
|
74
|
+
getRefreshTimeInMs(zoom?: number | undefined): number;
|
|
75
|
+
getVehicle(filterFc: Function): GeoJSONFeature[];
|
|
76
|
+
getFeatureInfoAtCoordinate(coordinate: Coordinate, options: import("../../types").LayerGetFeatureInfoOptions): Promise<LayerGetFeatureInfoResponse>;
|
|
77
|
+
getTrajectoryInfos(id: string): Promise<{
|
|
78
|
+
stopSequence: WebSocketAPIMessageEventData<RealtimeFullTrajectory> | WebSocketAPIMessageEventData<GeoJSONFeature[]>;
|
|
79
|
+
fullTrajectory: WebSocketAPIMessageEventData<RealtimeFullTrajectory> | WebSocketAPIMessageEventData<GeoJSONFeature[]>;
|
|
80
|
+
}>;
|
|
81
|
+
purgeOutOfDateTrajectories(): void;
|
|
82
|
+
purgeTrajectory(trajectory: GeoJSONFeature, extent: [number, number, number, number], zoom: number): boolean;
|
|
83
|
+
addTrajectory(trajectory: GeoJSONFeature): void;
|
|
84
|
+
removeTrajectory(trajectoryOrId: any): void;
|
|
85
|
+
onZoomEnd(): void;
|
|
86
|
+
onDocumentVisibilityChange(): void;
|
|
87
|
+
onTrajectoryMessage(data: WebSocketAPIMessageEventData<GeoJSONFeature>): void;
|
|
88
|
+
onDeleteTrajectoryMessage(data: WebSocketAPIMessageEventData<string>): void;
|
|
89
|
+
onFeatureHover(features: Feature<import("ol/geom").Geometry>[], layer: import("../../types").AnyRealtimeLayer, coordinate: Coordinate): void;
|
|
90
|
+
onFeatureClick(features: Feature<import("ol/geom").Geometry>[], layer: import("../../types").AnyRealtimeLayer, coordinate: Coordinate): void;
|
|
91
|
+
};
|
|
92
|
+
} & typeof Layer;
|
|
93
|
+
/**
|
|
94
|
+
* Responsible for loading and display data from a Realtime service.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* import { RealtimeLayer } from 'mobility-toolbox-js/ol';
|
|
98
|
+
*
|
|
99
|
+
* const layer = new RealtimeLayer({
|
|
100
|
+
* url: [yourUrl],
|
|
101
|
+
* apiKey: [yourApiKey],
|
|
102
|
+
* });
|
|
103
|
+
*
|
|
104
|
+
*
|
|
105
|
+
* @see <a href="/api/class/src/api/RealtimeAPI%20js~RealtimeAPI%20html">RealtimeAPI</a>
|
|
106
|
+
*
|
|
107
|
+
* @extends {Layer}
|
|
108
|
+
* @implements {UserInteractionsLayerInterface}
|
|
109
|
+
* @implements {RealtimeLayerInterface}
|
|
110
|
+
*/
|
|
111
|
+
declare class RealtimeLayer extends RealtimeLayer_base {
|
|
112
|
+
allowRenderWhenAnimating?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Constructor.
|
|
115
|
+
*
|
|
116
|
+
* @param {Object} options
|
|
117
|
+
* @private
|
|
118
|
+
*/
|
|
119
|
+
constructor(options: OlRealtimeLayerOptions);
|
|
120
|
+
attachToMap(map: AnyMap): void;
|
|
121
|
+
/**
|
|
122
|
+
* Destroy the container of the tracker.
|
|
123
|
+
*/
|
|
124
|
+
detachFromMap(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Detect in the canvas if there is data to query at a specific coordinate.
|
|
127
|
+
* @param {ol/coordinate~Coordinate} coordinate The coordinate to test
|
|
128
|
+
* @returns
|
|
129
|
+
*/
|
|
130
|
+
hasFeatureInfoAtCoordinate(coordinate: Coordinate): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Render the trajectories using current map's size, resolution and rotation.
|
|
133
|
+
* @param {boolean} noInterpolate if true, renders the vehicles without interpolating theirs positions.
|
|
134
|
+
* @overrides
|
|
135
|
+
*/
|
|
136
|
+
renderTrajectories(noInterpolate: boolean): void;
|
|
137
|
+
/**
|
|
138
|
+
* Launch renderTrajectories. it avoids duplicating code in renderTrajectories methhod.
|
|
139
|
+
* @private
|
|
140
|
+
* @override
|
|
141
|
+
*/
|
|
142
|
+
renderTrajectoriesInternal(viewState: ViewState, noInterpolate: boolean): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Return the delay in ms before the next rendering.
|
|
145
|
+
*/
|
|
146
|
+
getRefreshTimeInMs(): number;
|
|
147
|
+
getFeatureInfoAtCoordinate(coordinate: Coordinate, options?: {}): Promise<LayerGetFeatureInfoResponse>;
|
|
148
|
+
/**
|
|
149
|
+
* On move end we update the websocket with the new bbox.
|
|
150
|
+
*
|
|
151
|
+
* @private
|
|
152
|
+
* @override
|
|
153
|
+
*/
|
|
154
|
+
onMoveEnd(evt: MapEvent | ObjectEvent): void;
|
|
155
|
+
/**
|
|
156
|
+
* Function called on moveend event only when the zoom has changed.
|
|
157
|
+
*
|
|
158
|
+
* @param {ol/MapEvent~MapEvent} evt Moveend event.
|
|
159
|
+
* @private
|
|
160
|
+
* @override
|
|
161
|
+
*/
|
|
162
|
+
onZoomEnd(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Update the cursor style when hovering a vehicle.
|
|
165
|
+
*
|
|
166
|
+
* @private
|
|
167
|
+
* @override
|
|
168
|
+
*/
|
|
169
|
+
onFeatureHover(features: Feature[], layer: RealtimeLayer, coordinate: Coordinate): void;
|
|
170
|
+
/**
|
|
171
|
+
* Display the complete trajectory of the vehicle.
|
|
172
|
+
*
|
|
173
|
+
* @private
|
|
174
|
+
* @override
|
|
175
|
+
*/
|
|
176
|
+
onFeatureClick(features: Feature[], layer: RealtimeLayer, coordinate: Coordinate): void;
|
|
177
|
+
/**
|
|
178
|
+
* Remove the trajectory form the list if necessary.
|
|
179
|
+
*
|
|
180
|
+
* @private
|
|
181
|
+
*/
|
|
182
|
+
purgeTrajectory(trajectory: RealtimeTrajectory, extent: [number, number, number, number], zoom: number): boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Send the current bbox to the websocket
|
|
185
|
+
*
|
|
186
|
+
* @private
|
|
187
|
+
*/
|
|
188
|
+
setBbox(extent?: [number, number, number, number], zoom?: number): void;
|
|
189
|
+
/**
|
|
190
|
+
* Highlight the trajectory of journey.
|
|
191
|
+
* @private
|
|
192
|
+
*/
|
|
193
|
+
highlightTrajectory(id: RealtimeTrainId): Promise<Feature[] | undefined>;
|
|
194
|
+
/**
|
|
195
|
+
* Create a copy of the RealtimeLayer.
|
|
196
|
+
* @param {Object} newOptions Options to override
|
|
197
|
+
* @return {RealtimeLayer} A RealtimeLayer
|
|
198
|
+
*/
|
|
199
|
+
clone(newOptions: OlRealtimeLayerOptions): RealtimeLayer;
|
|
200
|
+
}
|
|
201
|
+
export default RealtimeLayer;
|
|
202
|
+
//# sourceMappingURL=RealtimeLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RealtimeLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/RealtimeLayer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAKxC,OAAO,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAc,EACZ,yBAAyB,EAC1B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,2BAA2B,EAC3B,sBAAsB,EACtB,eAAe,EACf,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAK7E,MAAM,MAAM,sBAAsB,GAAG,yBAAyB,GAAG;IAC/D,mBAAmB,CAAC,EAAE,CACpB,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,GAAG,KACT,IAAI,CAAC;IACV,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2HE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAzHnB;;;;;;;;;;;;;;;;;GAiBG;AAEH,cAAM,aAAc,SAAQ,kBAAY;IACtC,wBAAwB,CAAC,EAAE,OAAO,CAAS;IAE3C;;;;;OAKG;gBACS,OAAO,EAAE,sBAAsB;IAwG3C,WAAW,CAAC,GAAG,EAAE,MAAM;IA4BvB;;OAEG;IACH,aAAa;IAKb;;;;OAIG;IACH,0BAA0B,CAAC,UAAU,EAAE,UAAU;IAgBjD;;;;OAIG;IAEH,kBAAkB,CAAC,aAAa,EAAE,OAAO;IA2BzC;;;;OAIG;IACH,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO;IA2BvE;;OAEG;IACH,kBAAkB;IAIlB,0BAA0B,CACxB,UAAU,EAAE,UAAU,EACtB,OAAO,KAAK,GACX,OAAO,CAAC,2BAA2B,CAAC;IAgBvC;;;;;OAKG;IAEH,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW;IAQrC;;;;;;OAMG;IAEH,SAAS;IAYT;;;;;OAKG;IACH,cAAc,CACZ,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU;IAQxB;;;;;OAKG;IACH,cAAc,CACZ,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU;IAWxB;;;;OAIG;IACH,eAAe,CACb,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACxC,IAAI,EAAE,MAAM;IAed;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM;IAOhE;;;OAGG;IACH,mBAAmB,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC;IA0BxE;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,sBAAsB;CAGzC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import GeoJSON from 'ol/format/GeoJSON';
|
|
2
|
+
import { Layer as OLLayer, Group, Vector as VectorLayer } from 'ol/layer';
|
|
3
|
+
import Source from 'ol/source/Source';
|
|
4
|
+
import { composeCssTransform } from 'ol/transform';
|
|
5
|
+
import { Vector as VectorSource } from 'ol/source';
|
|
6
|
+
import debounce from 'lodash.debounce';
|
|
7
|
+
import Layer from './Layer';
|
|
8
|
+
import mixin from '../../common/mixins/RealtimeLayerMixin';
|
|
9
|
+
import { fullTrajectoryStyle } from '../styles';
|
|
10
|
+
/** @private */
|
|
11
|
+
const format = new GeoJSON();
|
|
12
|
+
/**
|
|
13
|
+
* Responsible for loading and display data from a Realtime service.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { RealtimeLayer } from 'mobility-toolbox-js/ol';
|
|
17
|
+
*
|
|
18
|
+
* const layer = new RealtimeLayer({
|
|
19
|
+
* url: [yourUrl],
|
|
20
|
+
* apiKey: [yourApiKey],
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* @see <a href="/api/class/src/api/RealtimeAPI%20js~RealtimeAPI%20html">RealtimeAPI</a>
|
|
25
|
+
*
|
|
26
|
+
* @extends {Layer}
|
|
27
|
+
* @implements {UserInteractionsLayerInterface}
|
|
28
|
+
* @implements {RealtimeLayerInterface}
|
|
29
|
+
*/
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
class RealtimeLayer extends mixin(Layer) {
|
|
32
|
+
/**
|
|
33
|
+
* Constructor.
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} options
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
constructor(options) {
|
|
39
|
+
// We use a group to be able to add custom vector layer in extended class.
|
|
40
|
+
// For example TrajservLayer use a vectorLayer to display the complete trajectory.
|
|
41
|
+
super(Object.assign({}, options));
|
|
42
|
+
this.allowRenderWhenAnimating = false;
|
|
43
|
+
this.allowRenderWhenAnimating = !!options.allowRenderWhenAnimating;
|
|
44
|
+
/** @private */
|
|
45
|
+
this.olLayer =
|
|
46
|
+
options.olLayer ||
|
|
47
|
+
new Group({
|
|
48
|
+
layers: [
|
|
49
|
+
new VectorLayer({
|
|
50
|
+
updateWhileAnimating: true,
|
|
51
|
+
updateWhileInteracting: true,
|
|
52
|
+
source: new VectorSource({ features: [] }),
|
|
53
|
+
style: (feature, resolution) => {
|
|
54
|
+
return (options.fullTrajectoryStyle || fullTrajectoryStyle)(feature, resolution, this.styleOptions);
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
new OLLayer({
|
|
58
|
+
source: new Source({}),
|
|
59
|
+
render: (frameState) => {
|
|
60
|
+
var _a, _b, _c;
|
|
61
|
+
if (!this.container) {
|
|
62
|
+
this.container = document.createElement('div');
|
|
63
|
+
this.container.style.position = 'absolute';
|
|
64
|
+
this.container.style.width = '100%';
|
|
65
|
+
this.container.style.height = '100%';
|
|
66
|
+
this.transformContainer = document.createElement('div');
|
|
67
|
+
this.transformContainer.style.position = 'absolute';
|
|
68
|
+
this.transformContainer.style.width = '100%';
|
|
69
|
+
this.transformContainer.style.height = '100%';
|
|
70
|
+
this.container.appendChild(this.transformContainer);
|
|
71
|
+
if (this.canvas) {
|
|
72
|
+
this.canvas.style.position =
|
|
73
|
+
'absolute';
|
|
74
|
+
this.canvas.style.top = '0';
|
|
75
|
+
this.canvas.style.left = '0';
|
|
76
|
+
this.canvas.style.transformOrigin =
|
|
77
|
+
'top left';
|
|
78
|
+
this.transformContainer.appendChild(this.canvas);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (this.renderedViewState) {
|
|
82
|
+
const { center, resolution, rotation } = frameState.viewState;
|
|
83
|
+
const { center: renderedCenter, resolution: renderedResolution, rotation: renderedRotation, } = this.renderedViewState;
|
|
84
|
+
if (renderedResolution / resolution >= 3) {
|
|
85
|
+
// Avoid having really big points when zooming fast.
|
|
86
|
+
const context = (_a = this.canvas) === null || _a === void 0 ? void 0 : _a.getContext('2d');
|
|
87
|
+
context === null || context === void 0 ? void 0 : context.clearRect(0, 0, (_b = this.canvas) === null || _b === void 0 ? void 0 : _b.width, (_c = this.canvas) === null || _c === void 0 ? void 0 : _c.height);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const pixelCenterRendered = this.map.getPixelFromCoordinate(renderedCenter);
|
|
91
|
+
const pixelCenter = this.map.getPixelFromCoordinate(center);
|
|
92
|
+
this.transformContainer.style.transform = composeCssTransform(pixelCenterRendered[0] - pixelCenter[0], pixelCenterRendered[1] - pixelCenter[1], renderedResolution / resolution, renderedResolution / resolution, rotation - renderedRotation, 0, 0);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return this.container;
|
|
96
|
+
},
|
|
97
|
+
}),
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
// We store the layer used to highlight the full Trajectory
|
|
101
|
+
this.vectorLayer = this.olLayer.getLayers().item(0);
|
|
102
|
+
// Options the last render run did happen. If something changes
|
|
103
|
+
// we have to render again
|
|
104
|
+
/** @private */
|
|
105
|
+
this.renderState = {
|
|
106
|
+
center: [0, 0],
|
|
107
|
+
zoom: undefined,
|
|
108
|
+
rotation: 0,
|
|
109
|
+
};
|
|
110
|
+
this.onZoomEndDebounced = debounce(this.onZoomEnd, 100);
|
|
111
|
+
this.onMoveEndDebounced = debounce(this.onMoveEnd, 100);
|
|
112
|
+
}
|
|
113
|
+
attachToMap(map) {
|
|
114
|
+
super.attachToMap(map);
|
|
115
|
+
if (this.map) {
|
|
116
|
+
this.olListenersKeys.push(...this.map.on(['moveend', 'change:target'], (evt) => {
|
|
117
|
+
const view = (evt.map || evt.target).getView();
|
|
118
|
+
if (view.getAnimating() || view.getInteracting()) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const zoom = view.getZoom();
|
|
122
|
+
// Update the interval between render updates
|
|
123
|
+
if (this.currentZoom !== zoom) {
|
|
124
|
+
this.onZoomEndDebounced(evt);
|
|
125
|
+
}
|
|
126
|
+
this.currentZoom = zoom;
|
|
127
|
+
this.onMoveEndDebounced(evt);
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Destroy the container of the tracker.
|
|
133
|
+
*/
|
|
134
|
+
detachFromMap() {
|
|
135
|
+
super.detachFromMap();
|
|
136
|
+
this.container = null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Detect in the canvas if there is data to query at a specific coordinate.
|
|
140
|
+
* @param {ol/coordinate~Coordinate} coordinate The coordinate to test
|
|
141
|
+
* @returns
|
|
142
|
+
*/
|
|
143
|
+
hasFeatureInfoAtCoordinate(coordinate) {
|
|
144
|
+
if (this.map && this.canvas) {
|
|
145
|
+
const context = this.canvas.getContext('2d', {
|
|
146
|
+
willReadFrequently: true,
|
|
147
|
+
});
|
|
148
|
+
const pixel = this.map.getPixelFromCoordinate(coordinate);
|
|
149
|
+
return !!(context === null || context === void 0 ? void 0 : context.getImageData(pixel[0] * (this.pixelRatio || 1), pixel[1] * (this.pixelRatio || 1), 1, 1).data[3]);
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Render the trajectories using current map's size, resolution and rotation.
|
|
155
|
+
* @param {boolean} noInterpolate if true, renders the vehicles without interpolating theirs positions.
|
|
156
|
+
* @overrides
|
|
157
|
+
*/
|
|
158
|
+
// @ts-ignore
|
|
159
|
+
renderTrajectories(noInterpolate) {
|
|
160
|
+
if (!this.map) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const view = this.map.getView();
|
|
164
|
+
// it could happen that the view is set but without center yet,
|
|
165
|
+
// so the calcualteExtent will trigger an error.
|
|
166
|
+
if (!view.getCenter()) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
super.renderTrajectories({
|
|
170
|
+
size: this.map.getSize(),
|
|
171
|
+
center: view.getCenter(),
|
|
172
|
+
extent: view.calculateExtent(),
|
|
173
|
+
resolution: view.getResolution(),
|
|
174
|
+
rotation: view.getRotation(),
|
|
175
|
+
zoom: view.getZoom(),
|
|
176
|
+
pixelRatio: this.pixelRatio,
|
|
177
|
+
}, noInterpolate);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Launch renderTrajectories. it avoids duplicating code in renderTrajectories methhod.
|
|
181
|
+
* @private
|
|
182
|
+
* @override
|
|
183
|
+
*/
|
|
184
|
+
renderTrajectoriesInternal(viewState, noInterpolate) {
|
|
185
|
+
if (!this.map) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
let isRendered = false;
|
|
189
|
+
const blockRendering = this.allowRenderWhenAnimating
|
|
190
|
+
? false
|
|
191
|
+
: this.map.getView().getAnimating() ||
|
|
192
|
+
this.map.getView().getInteracting();
|
|
193
|
+
// Don't render the map when the map is animating or interacting.
|
|
194
|
+
isRendered = blockRendering
|
|
195
|
+
? false
|
|
196
|
+
: super.renderTrajectoriesInternal(viewState, noInterpolate);
|
|
197
|
+
// We update the current render state.
|
|
198
|
+
if (isRendered) {
|
|
199
|
+
this.renderedViewState = Object.assign({}, viewState);
|
|
200
|
+
if (this.transformContainer) {
|
|
201
|
+
this.transformContainer.style.transform = '';
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return isRendered;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Return the delay in ms before the next rendering.
|
|
208
|
+
*/
|
|
209
|
+
getRefreshTimeInMs() {
|
|
210
|
+
return super.getRefreshTimeInMs(this.map.getView().getZoom());
|
|
211
|
+
}
|
|
212
|
+
getFeatureInfoAtCoordinate(coordinate, options = {}) {
|
|
213
|
+
if (!this.map || !this.map.getView()) {
|
|
214
|
+
return Promise.resolve({
|
|
215
|
+
layer: this,
|
|
216
|
+
features: [],
|
|
217
|
+
coordinate,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
const resolution = this.map.getView().getResolution();
|
|
221
|
+
return super.getFeatureInfoAtCoordinate(coordinate, Object.assign({ resolution }, options));
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* On move end we update the websocket with the new bbox.
|
|
225
|
+
*
|
|
226
|
+
* @private
|
|
227
|
+
* @override
|
|
228
|
+
*/
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
230
|
+
onMoveEnd(evt) {
|
|
231
|
+
if (!this.isUpdateBboxOnMoveEnd || !this.visible) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
this.setBbox();
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Function called on moveend event only when the zoom has changed.
|
|
238
|
+
*
|
|
239
|
+
* @param {ol/MapEvent~MapEvent} evt Moveend event.
|
|
240
|
+
* @private
|
|
241
|
+
* @override
|
|
242
|
+
*/
|
|
243
|
+
// eslint-disable-next-line no-unused-vars
|
|
244
|
+
onZoomEnd() {
|
|
245
|
+
super.onZoomEnd();
|
|
246
|
+
if (!this.isUpdateBboxOnMoveEnd || !this.visible) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (this.userClickInteractions && this.selectedVehicleId) {
|
|
250
|
+
this.highlightTrajectory(this.selectedVehicleId);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Update the cursor style when hovering a vehicle.
|
|
255
|
+
*
|
|
256
|
+
* @private
|
|
257
|
+
* @override
|
|
258
|
+
*/
|
|
259
|
+
onFeatureHover(features, layer, coordinate) {
|
|
260
|
+
super.onFeatureHover(features, layer, coordinate);
|
|
261
|
+
this.map.getTargetElement().style.cursor = features.length
|
|
262
|
+
? 'pointer'
|
|
263
|
+
: 'auto';
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Display the complete trajectory of the vehicle.
|
|
267
|
+
*
|
|
268
|
+
* @private
|
|
269
|
+
* @override
|
|
270
|
+
*/
|
|
271
|
+
onFeatureClick(features, layer, coordinate) {
|
|
272
|
+
super.onFeatureClick(features, layer, coordinate);
|
|
273
|
+
if (!features.length && this.vectorLayer) {
|
|
274
|
+
this.vectorLayer.getSource().clear();
|
|
275
|
+
}
|
|
276
|
+
if (this.selectedVehicleId) {
|
|
277
|
+
this.highlightTrajectory(this.selectedVehicleId);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Remove the trajectory form the list if necessary.
|
|
282
|
+
*
|
|
283
|
+
* @private
|
|
284
|
+
*/
|
|
285
|
+
purgeTrajectory(trajectory, extent, zoom) {
|
|
286
|
+
const center = this.map.getView().getCenter();
|
|
287
|
+
if (!extent && !center) {
|
|
288
|
+
// In that case the view is not zoomed yet so we can't calculate the extent of the map,
|
|
289
|
+
// it will trigger a js error on calculateExtent function.
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
return super.purgeTrajectory(trajectory, extent || this.map.getView().calculateExtent(), zoom || this.map.getView().getZoom());
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Send the current bbox to the websocket
|
|
296
|
+
*
|
|
297
|
+
* @private
|
|
298
|
+
*/
|
|
299
|
+
setBbox(extent, zoom) {
|
|
300
|
+
super.setBbox(extent || this.map.getView().calculateExtent(), zoom || this.map.getView().getZoom());
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Highlight the trajectory of journey.
|
|
304
|
+
* @private
|
|
305
|
+
*/
|
|
306
|
+
highlightTrajectory(id) {
|
|
307
|
+
var _a, _b;
|
|
308
|
+
return this.api
|
|
309
|
+
.getFullTrajectory(id, this.mode, this.getGeneralizationLevelByZoom(Math.floor(((_b = (_a = this.map) === null || _a === void 0 ? void 0 : _a.getView()) === null || _b === void 0 ? void 0 : _b.getZoom()) || 0)))
|
|
310
|
+
.then((data) => {
|
|
311
|
+
const fullTrajectory = data.content;
|
|
312
|
+
this.vectorLayer.getSource().clear();
|
|
313
|
+
if (!fullTrajectory ||
|
|
314
|
+
!fullTrajectory.features ||
|
|
315
|
+
!fullTrajectory.features.length) {
|
|
316
|
+
return undefined;
|
|
317
|
+
}
|
|
318
|
+
const features = format.readFeatures(fullTrajectory);
|
|
319
|
+
this.vectorLayer.getSource().addFeatures(features);
|
|
320
|
+
return features;
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Create a copy of the RealtimeLayer.
|
|
325
|
+
* @param {Object} newOptions Options to override
|
|
326
|
+
* @return {RealtimeLayer} A RealtimeLayer
|
|
327
|
+
*/
|
|
328
|
+
clone(newOptions) {
|
|
329
|
+
return new RealtimeLayer(Object.assign(Object.assign({}, this.options), newOptions));
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
export default RealtimeLayer;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Vector as VectorSource } from 'ol/source';
|
|
2
|
+
import { Vector } from 'ol/layer';
|
|
3
|
+
import type { StyleLike } from 'ol/style/Style';
|
|
4
|
+
import { Geometry } from 'ol/geom';
|
|
5
|
+
import Feature from 'ol/Feature';
|
|
6
|
+
import Layer from './Layer';
|
|
7
|
+
import type { OlLayerOptions } from './Layer';
|
|
8
|
+
export type OlRoutingLayerOptions = OlLayerOptions & {
|
|
9
|
+
olLayer?: Vector<VectorSource<Feature<Geometry>>>;
|
|
10
|
+
style?: StyleLike;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A class use to display vector data.
|
|
14
|
+
*
|
|
15
|
+
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
16
|
+
* @extends {Layer}
|
|
17
|
+
*/
|
|
18
|
+
declare class RoutingLayer extends Layer {
|
|
19
|
+
olLayer?: Vector<VectorSource<Feature<Geometry>>>;
|
|
20
|
+
options: OlRoutingLayerOptions;
|
|
21
|
+
/**
|
|
22
|
+
* Constructor.
|
|
23
|
+
* @param {Object} [options]
|
|
24
|
+
* @param {ol/style/Style~StyleLike} [options.style] Style to be used for routes, uses (ol/StyleLike) [https://openlayers.org/en/latest/apidoc/module-ol_style_Style.html#~StyleLike] instances
|
|
25
|
+
*/
|
|
26
|
+
constructor(options: OlRoutingLayerOptions);
|
|
27
|
+
/**
|
|
28
|
+
* Create a copy of the RoutingLayer.
|
|
29
|
+
* @param {Object} newOptions Options to override
|
|
30
|
+
* @return {RoutingLayer} A RoutingLayer
|
|
31
|
+
*/
|
|
32
|
+
clone(newOptions: OlRoutingLayerOptions): RoutingLayer;
|
|
33
|
+
}
|
|
34
|
+
export default RoutingLayer;
|
|
35
|
+
//# sourceMappingURL=RoutingLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoutingLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/RoutingLayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AA8DF;;;;;GAKG;AACH,cAAM,YAAa,SAAQ,KAAK;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAElD,OAAO,EAAE,qBAAqB,CAAM;IAEpC;;;;OAIG;gBACS,OAAO,EAAE,qBAAqB;IAW1C;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,qBAAqB;CAGxC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Circle, Fill, Stroke, Style } from 'ol/style';
|
|
2
|
+
import { Vector as VectorSource } from 'ol/source';
|
|
3
|
+
import { Vector } from 'ol/layer';
|
|
4
|
+
import Layer from './Layer';
|
|
5
|
+
/** @private */
|
|
6
|
+
const circleStyle = new Circle({
|
|
7
|
+
radius: 6,
|
|
8
|
+
fill: new Fill({
|
|
9
|
+
color: [255, 0, 0, 1],
|
|
10
|
+
}),
|
|
11
|
+
stroke: new Stroke({
|
|
12
|
+
color: [0, 0, 0, 1],
|
|
13
|
+
width: 1,
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
/** @private */
|
|
17
|
+
const blackBorder = new Style({
|
|
18
|
+
stroke: new Stroke({
|
|
19
|
+
color: [0, 0, 0, 1],
|
|
20
|
+
width: 5,
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
/** @private */
|
|
24
|
+
const redLine = new Style({
|
|
25
|
+
image: circleStyle,
|
|
26
|
+
stroke: new Stroke({
|
|
27
|
+
color: [255, 0, 0, 1],
|
|
28
|
+
width: 3,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
/** @private */
|
|
32
|
+
const dashedRedLine = new Style({
|
|
33
|
+
image: circleStyle,
|
|
34
|
+
stroke: new Stroke({
|
|
35
|
+
color: [255, 0, 0, 1],
|
|
36
|
+
width: 3,
|
|
37
|
+
lineDash: [1, 10],
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
/** @private */
|
|
41
|
+
const defaultStyleFunction = (feature, resolution) => {
|
|
42
|
+
const minResolution = feature.get('minResolution');
|
|
43
|
+
const maxResolution = feature.get('maxResolution');
|
|
44
|
+
const inRange = resolution <= minResolution && resolution > maxResolution;
|
|
45
|
+
if (minResolution && maxResolution && !inRange) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const mot = feature.get('mot');
|
|
49
|
+
if (mot !== 'foot') {
|
|
50
|
+
return [blackBorder, redLine];
|
|
51
|
+
}
|
|
52
|
+
return [dashedRedLine];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* A class use to display vector data.
|
|
56
|
+
*
|
|
57
|
+
* @classproperty {ol/Map~Map} map - The map where the layer is displayed.
|
|
58
|
+
* @extends {Layer}
|
|
59
|
+
*/
|
|
60
|
+
class RoutingLayer extends Layer {
|
|
61
|
+
/**
|
|
62
|
+
* Constructor.
|
|
63
|
+
* @param {Object} [options]
|
|
64
|
+
* @param {ol/style/Style~StyleLike} [options.style] Style to be used for routes, uses (ol/StyleLike) [https://openlayers.org/en/latest/apidoc/module-ol_style_Style.html#~StyleLike] instances
|
|
65
|
+
*/
|
|
66
|
+
constructor(options) {
|
|
67
|
+
super(options);
|
|
68
|
+
this.options = {};
|
|
69
|
+
this.olLayer =
|
|
70
|
+
options.olLayer ||
|
|
71
|
+
new Vector({
|
|
72
|
+
source: new VectorSource(),
|
|
73
|
+
style: options.style || defaultStyleFunction,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create a copy of the RoutingLayer.
|
|
78
|
+
* @param {Object} newOptions Options to override
|
|
79
|
+
* @return {RoutingLayer} A RoutingLayer
|
|
80
|
+
*/
|
|
81
|
+
clone(newOptions) {
|
|
82
|
+
return new RoutingLayer(Object.assign(Object.assign({}, this.options), newOptions));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export default RoutingLayer;
|