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
|
@@ -1,202 +0,0 @@
|
|
|
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("../../api/RealtimeAPI").default;
|
|
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").default>[], layer: import("../../types").AnyRealtimeLayer, coordinate: Coordinate): void;
|
|
90
|
-
onFeatureClick(features: Feature<import("ol/geom/Geometry").default>[], 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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,332 +0,0 @@
|
|
|
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;
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,85 +0,0 @@
|
|
|
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;
|