@geops/rvf-mobility-web-component 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.fixpackrc +21 -0
- package/.husky/commit-msg +1 -0
- package/.husky/post-checkout +1 -0
- package/.husky/post-merge +1 -0
- package/.husky/post-rebase +1 -0
- package/.husky/pre-commit +1 -0
- package/.lintstagedrc.js +12 -0
- package/.nvmrc +1 -0
- package/.prettierrc.js +1 -0
- package/CHANGELOG.md +183 -0
- package/Logo.svg +10 -0
- package/README.md +179 -0
- package/__mocks__/dataurl.js +11 -0
- package/__mocks__/mapbox-gl.js +19 -0
- package/commitlint.config.cjs +1 -0
- package/doc/.eslintrc.json +3 -0
- package/doc/.fixpackrc +21 -0
- package/doc/.prettierrc +1 -0
- package/doc/README.md +14 -0
- package/doc/declarations.d.ts +6 -0
- package/doc/next.config.mjs +4 -0
- package/doc/package.json +43 -0
- package/doc/postcss.config.mjs +8 -0
- package/doc/public/README.md +1 -0
- package/doc/src/app/components/GeopsAPIKeyLink.tsx +6 -0
- package/doc/src/app/components/GeopsAPIsLink.tsx +6 -0
- package/doc/src/app/components/GeopsMapsAPILink.tsx +8 -0
- package/doc/src/app/components/GeopsMobility.tsx +9 -0
- package/doc/src/app/components/GeopsMobilityDoc.tsx +231 -0
- package/doc/src/app/components/GeopsMobilitySearch.tsx +10 -0
- package/doc/src/app/components/GeopsMobilitySearchDoc.tsx +129 -0
- package/doc/src/app/components/GeopsRealtimeAPILink.tsx +10 -0
- package/doc/src/app/components/GeopsStopsAPILink.tsx +8 -0
- package/doc/src/app/components/Link.tsx +9 -0
- package/doc/src/app/components/WebComponentDoc.tsx +296 -0
- package/doc/src/app/favicon.ico +0 -0
- package/doc/src/app/geops-mobility/page.tsx +6 -0
- package/doc/src/app/geops-mobility-search/page.tsx +7 -0
- package/doc/src/app/globals.css +38 -0
- package/doc/src/app/hooks/useAttrFromUrlParams.ts +21 -0
- package/doc/src/app/hooks/useIsFullScreen.ts +14 -0
- package/doc/src/app/hooks/usePublicKey.ts +21 -0
- package/doc/src/app/layout.tsx +51 -0
- package/doc/src/app/page.tsx +86 -0
- package/doc/src/geops-ui.ts +3 -0
- package/doc/tailwind.config.ts +20 -0
- package/doc/tsconfig.json +40 -0
- package/eslint.config.mjs +40 -0
- package/favicon.ico +0 -0
- package/global.d.ts +4 -0
- package/iframe.html +34 -0
- package/index.html +276 -0
- package/index.js +2162 -0
- package/input.css +34 -0
- package/jest-setup.js +4 -0
- package/jest.config.js +17 -0
- package/package.json +80 -0
- package/scripts/build.mjs +16 -0
- package/scripts/dev.mjs +26 -0
- package/search.html +144 -0
- package/src/BaseLayer/BaseLayer.tsx +36 -0
- package/src/BaseLayer/index.tsx +1 -0
- package/src/Copyright/Copyright.tsx +54 -0
- package/src/Copyright/index.css +3 -0
- package/src/Copyright/index.tsx +1 -0
- package/src/DebugDeparture/DebugDeparture.tsx +116 -0
- package/src/DebugDeparture/index.tsx +1 -0
- package/src/DebugStop/DebugStop.tsx +47 -0
- package/src/DebugStop/index.tsx +1 -0
- package/src/Departure/Departure.tsx +55 -0
- package/src/Departure/index.tsx +1 -0
- package/src/GeolocationButton/GeolocationButton.tsx +81 -0
- package/src/GeolocationButton/index.tsx +1 -0
- package/src/Map/Map.tsx +89 -0
- package/src/Map/index.tsx +1 -0
- package/src/MobilityMap/MobilityMap.tsx +259 -0
- package/src/MobilityMap/index.css +13 -0
- package/src/MobilityMap/index.tsx +1 -0
- package/src/NotificationLayer/NotificationLayer.tsx +156 -0
- package/src/NotificationLayer/index.tsx +1 -0
- package/src/NotificationLayer/notificationUtils.ts +191 -0
- package/src/Overlay/Overlay.tsx +57 -0
- package/src/Overlay/index.tsx +1 -0
- package/src/RealtimeLayer/RealtimeLayer.tsx +230 -0
- package/src/RealtimeLayer/index.tsx +1 -0
- package/src/RouteDestination/RouteDestination.test.tsx +13 -0
- package/src/RouteDestination/RouteDestination.tsx +15 -0
- package/src/RouteDestination/index.tsx +1 -0
- package/src/RouteIcon/RouteIcon.tsx +66 -0
- package/src/RouteIcon/index.tsx +1 -0
- package/src/RouteIdentifier/RouteIdentifer.tsx +35 -0
- package/src/RouteIdentifier/index.tsx +1 -0
- package/src/RouteInfos/RouteInfos.tsx +22 -0
- package/src/RouteInfos/index.tsx +1 -0
- package/src/RouteSchedule/RouteSchedule.tsx +69 -0
- package/src/RouteSchedule/firstStation.png +0 -0
- package/src/RouteSchedule/index.tsx +1 -0
- package/src/RouteSchedule/lastStation.png +0 -0
- package/src/RouteSchedule/line.png +0 -0
- package/src/RouteSchedule/station.png +0 -0
- package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +44 -0
- package/src/RouteScheduleFooter/index.tsx +1 -0
- package/src/RouteScheduleHeader/RouteScheduleHeader.tsx +58 -0
- package/src/RouteScheduleHeader/index.tsx +1 -0
- package/src/RouteStop/RouteStop.tsx +121 -0
- package/src/RouteStop/index.tsx +1 -0
- package/src/RouteStopDelay/RouteStopDelay.tsx +36 -0
- package/src/RouteStopDelay/index.tsx +1 -0
- package/src/RouteStopName/RouteStopName.tsx +24 -0
- package/src/RouteStopName/index.tsx +1 -0
- package/src/RouteStopPlatform/RouteStopPlatform.tsx +29 -0
- package/src/RouteStopPlatform/index.tsx +1 -0
- package/src/RouteStopProgress/RouteStopProgress.tsx +101 -0
- package/src/RouteStopProgress/index.tsx +1 -0
- package/src/RouteStopServices/RouteStopServices.tsx +26 -0
- package/src/RouteStopServices/index.tsx +1 -0
- package/src/RouteStopStation/RouteStopStation.tsx +32 -0
- package/src/RouteStopStation/index.tsx +1 -0
- package/src/RouteStopTime/RouteStopTime.tsx +34 -0
- package/src/RouteStopTime/index.tsx +1 -0
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +245 -0
- package/src/RvfMobilityMap/index.css +13 -0
- package/src/RvfMobilityMap/index.tsx +1 -0
- package/src/ScaleLine/ScaleLine.tsx +51 -0
- package/src/ScaleLine/index.css +6 -0
- package/src/ScaleLine/index.tsx +1 -0
- package/src/ScrollableHandler/ScrollableHandler.tsx +65 -0
- package/src/ScrollableHandler/index.tsx +1 -0
- package/src/Search/Search.tsx +18 -0
- package/src/Search/index.tsx +1 -0
- package/src/SingleClickListener/SingleClickListener.tsx +103 -0
- package/src/SingleClickListener/index.tsx +1 -0
- package/src/Station/Station.tsx +68 -0
- package/src/Station/index.tsx +1 -0
- package/src/StationHeader/StationHeader.tsx +32 -0
- package/src/StationHeader/index.tsx +1 -0
- package/src/StationName/StationName.tsx +21 -0
- package/src/StationName/index.tsx +1 -0
- package/src/StationServices/StationServices.tsx +80 -0
- package/src/StationServices/index.tsx +1 -0
- package/src/StationsLayer/StationsLayer.tsx +41 -0
- package/src/StationsLayer/index.tsx +1 -0
- package/src/StopsSearch/StopsSearch.tsx +254 -0
- package/src/StopsSearch/index.tsx +1 -0
- package/src/icons/Airport/Airport.tsx +17 -0
- package/src/icons/Airport/airport-14-svgrepo-com.svg +41 -0
- package/src/icons/Airport/index.tsx +1 -0
- package/src/icons/BarAndRestaurants/BarAndRestaurants.tsx +17 -0
- package/src/icons/BarAndRestaurants/food-restaurant-svgrepo-com.svg +12 -0
- package/src/icons/BarAndRestaurants/index.tsx +1 -0
- package/src/icons/Bathroom/Bathroom.tsx +59 -0
- package/src/icons/Bathroom/bathroom-restroom-svgrepo-com.svg +38 -0
- package/src/icons/Bathroom/index.tsx +1 -0
- package/src/icons/BikeStorage/BikeStorage.tsx +17 -0
- package/src/icons/BikeStorage/index.tsx +1 -0
- package/src/icons/BikeStorage/parking-bicycle-14-svgrepo-com.svg +41 -0
- package/src/icons/Elevator/Elevator.tsx +16 -0
- package/src/icons/Elevator/elevator-svgrepo-com.svg +2 -0
- package/src/icons/Elevator/index.tsx +1 -0
- package/src/icons/Police/Police.tsx +20 -0
- package/src/icons/Police/index.tsx +1 -0
- package/src/icons/Police/polizia.png +0 -0
- package/src/icons/README.md +52 -0
- package/src/icons/WaitingAreas/WaitingAreas.tsx +16 -0
- package/src/icons/WaitingAreas/highway-rest-area-svgrepo-com.svg +5 -0
- package/src/icons/WaitingAreas/index.tsx +1 -0
- package/src/icons/WaitingAreas/wheelchair-svgrepo-com.svg +2 -0
- package/src/icons/WheelChair/WheelChair.tsx +16 -0
- package/src/icons/WheelChair/disabili.png +0 -0
- package/src/icons/WheelChair/index.tsx +1 -0
- package/src/icons/WheelChair/wheelchair-svgrepo-com.svg +2 -0
- package/src/index.tsx +50 -0
- package/src/utils/MobilityEvent.ts +21 -0
- package/src/utils/addSourceAndLayers.ts +62 -0
- package/src/utils/centerOnStation.ts +17 -0
- package/src/utils/centerOnVehicle.ts +50 -0
- package/src/utils/getBgColor.ts +3 -0
- package/src/utils/getDelayColor.test.ts +20 -0
- package/src/utils/getDelayColor.ts +23 -0
- package/src/utils/getDelayColorForVehicle.test.ts +28 -0
- package/src/utils/getDelayColorForVehicle.ts +25 -0
- package/src/utils/getDelayFontForVehicle.test.ts +7 -0
- package/src/utils/getDelayFontForVehicle.tsx +8 -0
- package/src/utils/getDelayString.test.ts +22 -0
- package/src/utils/getDelayString.ts +28 -0
- package/src/utils/getDelayTextForVehicle.test.ts +28 -0
- package/src/utils/getDelayTextForVehicle.ts +21 -0
- package/src/utils/getFullTrajectoryAndFit.ts +40 -0
- package/src/utils/getHoursAndMinutes.test.ts +14 -0
- package/src/utils/getHoursAndMinutes.ts +22 -0
- package/src/utils/getMainColorForVehicle.test.ts +27 -0
- package/src/utils/getMainColorForVehicle.ts +46 -0
- package/src/utils/getStopStatus.test.ts +104 -0
- package/src/utils/getStopStatus.ts +171 -0
- package/src/utils/getTextFontForVehicle.test.ts +7 -0
- package/src/utils/getTextFontForVehicle.tsx +9 -0
- package/src/utils/getTextForVehicle.test.ts +17 -0
- package/src/utils/getTextForVehicle.ts +19 -0
- package/src/utils/hooks/useDebug.tsx +11 -0
- package/src/utils/hooks/useDeparture.tsx +23 -0
- package/src/utils/hooks/useI18n.tsx +20 -0
- package/src/utils/hooks/useMapContext.tsx +74 -0
- package/src/utils/hooks/useParams.ts +5 -0
- package/src/utils/hooks/useRouteStop.tsx +33 -0
- package/src/utils/hooks/useStation.tsx +21 -0
- package/src/utils/hooks/useUpdatePermalink.tsx +33 -0
- package/src/utils/hooks/useZoom.tsx +32 -0
- package/src/utils/i18n.ts +16 -0
- package/src/utils/translations.ts +31 -0
- package/tailwind.config.mjs +56 -0
- package/testNotification.json +50653 -0
- package/tsconfig.json +12 -0
package/.fixpackrc
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sortToTop": [
|
|
3
|
+
"name",
|
|
4
|
+
"license",
|
|
5
|
+
"description",
|
|
6
|
+
"version",
|
|
7
|
+
"author",
|
|
8
|
+
"homepage",
|
|
9
|
+
"type",
|
|
10
|
+
"main",
|
|
11
|
+
"module",
|
|
12
|
+
"files",
|
|
13
|
+
"exports",
|
|
14
|
+
"proxy",
|
|
15
|
+
"dependencies",
|
|
16
|
+
"peerDependencies",
|
|
17
|
+
"devDependencies",
|
|
18
|
+
"resolutions",
|
|
19
|
+
"scripts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yarn commitlint --edit $1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yarn install --frozen-lockfile
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yarn install --frozen-lockfile
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yarn install --frozen-lockfile
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
HUSKY=0 npx lint-staged
|
package/.lintstagedrc.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
"(src|__mocks__)/**/*.(tsx|ts|js|jsx|cjs)": [
|
|
3
|
+
"eslint --fix",
|
|
4
|
+
"prettier --write",
|
|
5
|
+
"git add",
|
|
6
|
+
"yarn test --bail --passWithNoTests --findRelatedTests",
|
|
7
|
+
],
|
|
8
|
+
"package.json": ["fixpack", "git add"],
|
|
9
|
+
// "src/**/*.{css,scss}": ["stylelint --fix --allow-empty-input"],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default config;
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22
|
package/.prettierrc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### [0.1.8](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.7...v0.1.8) (2024-12-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add good fonts and some styles ([8158dbf](https://github.com/geops/rvf-mobility-web-component/commit/8158dbfb1f7e8c52a4e6151d3d17268705361cc0))
|
|
11
|
+
* add logo ([9ee5946](https://github.com/geops/rvf-mobility-web-component/commit/9ee5946042b99a658a49fd6077e6869f45abe00e))
|
|
12
|
+
* add missing files ([1f67031](https://github.com/geops/rvf-mobility-web-component/commit/1f67031d0087c64965a3ef17e3ee523f7b7c2539))
|
|
13
|
+
* add rvf favico ([b4fc9cc](https://github.com/geops/rvf-mobility-web-component/commit/b4fc9cc6172c4edb9535544d9afad5cecd84eeac))
|
|
14
|
+
* cop the mobility map content ([4a95eea](https://github.com/geops/rvf-mobility-web-component/commit/4a95eea599400106008eaea809e93bddacf59ce2))
|
|
15
|
+
* prepare config for node 23 ([fe7267e](https://github.com/geops/rvf-mobility-web-component/commit/fe7267ea3dfd043fc20c066290c374793b12f27f))
|
|
16
|
+
* use good style ([bbab2f7](https://github.com/geops/rvf-mobility-web-component/commit/bbab2f7f8f5ccefe651537d5c233630fad66ea30))
|
|
17
|
+
* use rvf extent ([55cbb5a](https://github.com/geops/rvf-mobility-web-component/commit/55cbb5a5731937e18ba98e0d345c1492f71ddf6a))
|
|
18
|
+
* usegood apikey ([bfa63bf](https://github.com/geops/rvf-mobility-web-component/commit/bfa63bf9f87178de329e84f2d433b0c0ada3fd47))
|
|
19
|
+
|
|
20
|
+
### [0.1.7](https://github.com/geops/mobility-web-component/compare/v0.1.5...v0.1.7) (2024-11-29)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* add new departure context ([e7c08f6](https://github.com/geops/mobility-web-component/commit/e7c08f6f1f53ba027ce791ee2872e45c9d1d71f2))
|
|
26
|
+
* add RouteStop context ([2347b71](https://github.com/geops/mobility-web-component/commit/2347b7154e7b185fb332aafeac3bae1e5de05525))
|
|
27
|
+
* add RouteStop context ([1498847](https://github.com/geops/mobility-web-component/commit/1498847dc652f1c1012160cd0ae6662c6a65e4d0))
|
|
28
|
+
* add search web component and documentation websiite ([#14](https://github.com/geops/mobility-web-component/issues/14)) ([ec2ca77](https://github.com/geops/mobility-web-component/commit/ec2ca775e6ec2621026721087fae76fb6f40d48c))
|
|
29
|
+
* add useDebug hook ([2eea01d](https://github.com/geops/mobility-web-component/commit/2eea01d203ad1b98e10a48cbb07cea0ff0a17b5e))
|
|
30
|
+
* make map more configurable ([#17](https://github.com/geops/mobility-web-component/issues/17)) ([84b6e4c](https://github.com/geops/mobility-web-component/commit/84b6e4c46665c5cc6e93810f0c415cba02671bf1))
|
|
31
|
+
* manage progress and boarding state ([cc23732](https://github.com/geops/mobility-web-component/commit/cc2373237bd152d6e53399befabe2d376d4f7e1d))
|
|
32
|
+
* **permalink:** update permalink on map move with XYZ ([9a1678b](https://github.com/geops/mobility-web-component/commit/9a1678b4595dab17afb711d1debca167302db5f4))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* add eslint perfectionist ([6b3e865](https://github.com/geops/mobility-web-component/commit/6b3e8655af167a86171bc1522885307b34181d12))
|
|
38
|
+
* add more eslint configs* ([87cb085](https://github.com/geops/mobility-web-component/commit/87cb0850928b654c948d49aaf8aae72b1461f711))
|
|
39
|
+
* add some eslint rules ([e7a568f](https://github.com/geops/mobility-web-component/commit/e7a568f346c8a3bb5be726af47b14b0ed12b3da1))
|
|
40
|
+
* add useI18n hook ([9558c7b](https://github.com/geops/mobility-web-component/commit/9558c7b2d4c0c67772ae8c667099d195202e6bb9))
|
|
41
|
+
* add useI18n hook ([80558a8](https://github.com/geops/mobility-web-component/commit/80558a8d98906d51c982a539166b6f3e20b2f594))
|
|
42
|
+
* add useI18n hook ([6e8dcbb](https://github.com/geops/mobility-web-component/commit/6e8dcbb54ccd791f05dbc8c2d4cab5cceea11704))
|
|
43
|
+
* aply greyout properly ([73c7a23](https://github.com/geops/mobility-web-component/commit/73c7a23ce686feffa70d9ab6aeeb8fb98d5c6142))
|
|
44
|
+
* apply greyout properly ([8cb761e](https://github.com/geops/mobility-web-component/commit/8cb761e1c5579dcd2fc249e8f91db51cda4dde51))
|
|
45
|
+
* detect stop with no delays as not realtime stop ([f0d9a3a](https://github.com/geops/mobility-web-component/commit/f0d9a3a396ccabf8fde41d63a99b50a0a9012fa7))
|
|
46
|
+
* fix station loading ([a01c2d5](https://github.com/geops/mobility-web-component/commit/a01c2d59ff2da40e3a1a44660127e82aa0eb833a))
|
|
47
|
+
* fix tialwind generation ([a1f14c3](https://github.com/geops/mobility-web-component/commit/a1f14c3509ecb6f1f235e4f85811803523a7cc28))
|
|
48
|
+
* improve css of debug info ([36a159f](https://github.com/geops/mobility-web-component/commit/36a159fe275399d9496517237cb8cb99bcc73fdc))
|
|
49
|
+
* improve css of debug info ([bfa8f22](https://github.com/geops/mobility-web-component/commit/bfa8f22ef62fbb80857ddd2c6bddd8173fa64166))
|
|
50
|
+
* improve css of debug info ([0ddcb6c](https://github.com/geops/mobility-web-component/commit/0ddcb6c9cc9caaebd20f79a700693cad3a0f700a))
|
|
51
|
+
* improve use of context ([3b60e2c](https://github.com/geops/mobility-web-component/commit/3b60e2cb91725dd7e55ea9e8de8152e1accbda25))
|
|
52
|
+
* improve use of context ([8d3308c](https://github.com/geops/mobility-web-component/commit/8d3308c73dfa9dfa751cb3e1d57afe9f2ffcb170))
|
|
53
|
+
* improve use of context ([ec4ab99](https://github.com/geops/mobility-web-component/commit/ec4ab99a6afc7cffc04b52bcf598d8a315b6e048))
|
|
54
|
+
* manage when no stop sequence are defined ([26daf3a](https://github.com/geops/mobility-web-component/commit/26daf3a026a5807f8127a15b512d043fc280bf1a))
|
|
55
|
+
* move translation in its own file ([69e2c3f](https://github.com/geops/mobility-web-component/commit/69e2c3f206c91afe7e48771f2b59a9d2e0ded285))
|
|
56
|
+
* **permalink:** add permalink attribute as to toggle use of permalink ([6f73323](https://github.com/geops/mobility-web-component/commit/6f733237e91458616b3e903c4bdd507f49646e6a))
|
|
57
|
+
* post queryparams and origin to window.top ([154b78b](https://github.com/geops/mobility-web-component/commit/154b78b6712c2b0bdc4ff14648ae16f222948d6b))
|
|
58
|
+
* remove only ([20b5233](https://github.com/geops/mobility-web-component/commit/20b523361348c8f365f19494b4b86f812a480a93))
|
|
59
|
+
* remove use of RealtimeDepartureExtended type ([85be4f6](https://github.com/geops/mobility-web-component/commit/85be4f6bbf9e53caff2ddb5bb5abcdd76bac47cc))
|
|
60
|
+
* remove useless useeffect deps ([885e69d](https://github.com/geops/mobility-web-component/commit/885e69dc1de9299ae3195ff0406334b0a1e1aced))
|
|
61
|
+
* remove uselss file an set a scrollbar height ([a36203c](https://github.com/geops/mobility-web-component/commit/a36203cc50ab99d2265e6af89efff8beea362334))
|
|
62
|
+
* update dependencies ([d7b7eef](https://github.com/geops/mobility-web-component/commit/d7b7eef33cb58031caa9257678d605e70346261c))
|
|
63
|
+
* update dependencies ([1d3bfd7](https://github.com/geops/mobility-web-component/commit/1d3bfd72a7507adb11dca95206986005fa9d0734))
|
|
64
|
+
* use node 22 ([55fdb87](https://github.com/geops/mobility-web-component/commit/55fdb87054dd65f6ca78afa1a42e9bb77444048e))
|
|
65
|
+
* use perfectionist alphabetical ([8fce42d](https://github.com/geops/mobility-web-component/commit/8fce42d9998761598858322236dddb300c31ac51))
|
|
66
|
+
|
|
67
|
+
### [0.1.6](https://github.com/geops/mobility-web-component/compare/v0.1.5...v0.1.6) (2024-11-29)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Features
|
|
71
|
+
|
|
72
|
+
* add new departure context ([e7c08f6](https://github.com/geops/mobility-web-component/commit/e7c08f6f1f53ba027ce791ee2872e45c9d1d71f2))
|
|
73
|
+
* add RouteStop context ([2347b71](https://github.com/geops/mobility-web-component/commit/2347b7154e7b185fb332aafeac3bae1e5de05525))
|
|
74
|
+
* add RouteStop context ([1498847](https://github.com/geops/mobility-web-component/commit/1498847dc652f1c1012160cd0ae6662c6a65e4d0))
|
|
75
|
+
* add search web component and documentation websiite ([#14](https://github.com/geops/mobility-web-component/issues/14)) ([ec2ca77](https://github.com/geops/mobility-web-component/commit/ec2ca775e6ec2621026721087fae76fb6f40d48c))
|
|
76
|
+
* add useDebug hook ([2eea01d](https://github.com/geops/mobility-web-component/commit/2eea01d203ad1b98e10a48cbb07cea0ff0a17b5e))
|
|
77
|
+
* make map more configurable ([#17](https://github.com/geops/mobility-web-component/issues/17)) ([84b6e4c](https://github.com/geops/mobility-web-component/commit/84b6e4c46665c5cc6e93810f0c415cba02671bf1))
|
|
78
|
+
* manage progress and boarding state ([cc23732](https://github.com/geops/mobility-web-component/commit/cc2373237bd152d6e53399befabe2d376d4f7e1d))
|
|
79
|
+
* **permalink:** update permalink on map move with XYZ ([9a1678b](https://github.com/geops/mobility-web-component/commit/9a1678b4595dab17afb711d1debca167302db5f4))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Bug Fixes
|
|
83
|
+
|
|
84
|
+
* add eslint perfectionist ([6b3e865](https://github.com/geops/mobility-web-component/commit/6b3e8655af167a86171bc1522885307b34181d12))
|
|
85
|
+
* add more eslint configs* ([87cb085](https://github.com/geops/mobility-web-component/commit/87cb0850928b654c948d49aaf8aae72b1461f711))
|
|
86
|
+
* add some eslint rules ([e7a568f](https://github.com/geops/mobility-web-component/commit/e7a568f346c8a3bb5be726af47b14b0ed12b3da1))
|
|
87
|
+
* add useI18n hook ([9558c7b](https://github.com/geops/mobility-web-component/commit/9558c7b2d4c0c67772ae8c667099d195202e6bb9))
|
|
88
|
+
* add useI18n hook ([80558a8](https://github.com/geops/mobility-web-component/commit/80558a8d98906d51c982a539166b6f3e20b2f594))
|
|
89
|
+
* add useI18n hook ([6e8dcbb](https://github.com/geops/mobility-web-component/commit/6e8dcbb54ccd791f05dbc8c2d4cab5cceea11704))
|
|
90
|
+
* aply greyout properly ([73c7a23](https://github.com/geops/mobility-web-component/commit/73c7a23ce686feffa70d9ab6aeeb8fb98d5c6142))
|
|
91
|
+
* apply greyout properly ([8cb761e](https://github.com/geops/mobility-web-component/commit/8cb761e1c5579dcd2fc249e8f91db51cda4dde51))
|
|
92
|
+
* detect stop with no delays as not realtime stop ([f0d9a3a](https://github.com/geops/mobility-web-component/commit/f0d9a3a396ccabf8fde41d63a99b50a0a9012fa7))
|
|
93
|
+
* fix station loading ([a01c2d5](https://github.com/geops/mobility-web-component/commit/a01c2d59ff2da40e3a1a44660127e82aa0eb833a))
|
|
94
|
+
* fix tialwind generation ([a1f14c3](https://github.com/geops/mobility-web-component/commit/a1f14c3509ecb6f1f235e4f85811803523a7cc28))
|
|
95
|
+
* improve css of debug info ([36a159f](https://github.com/geops/mobility-web-component/commit/36a159fe275399d9496517237cb8cb99bcc73fdc))
|
|
96
|
+
* improve css of debug info ([bfa8f22](https://github.com/geops/mobility-web-component/commit/bfa8f22ef62fbb80857ddd2c6bddd8173fa64166))
|
|
97
|
+
* improve css of debug info ([0ddcb6c](https://github.com/geops/mobility-web-component/commit/0ddcb6c9cc9caaebd20f79a700693cad3a0f700a))
|
|
98
|
+
* improve use of context ([3b60e2c](https://github.com/geops/mobility-web-component/commit/3b60e2cb91725dd7e55ea9e8de8152e1accbda25))
|
|
99
|
+
* improve use of context ([8d3308c](https://github.com/geops/mobility-web-component/commit/8d3308c73dfa9dfa751cb3e1d57afe9f2ffcb170))
|
|
100
|
+
* improve use of context ([ec4ab99](https://github.com/geops/mobility-web-component/commit/ec4ab99a6afc7cffc04b52bcf598d8a315b6e048))
|
|
101
|
+
* manage when no stop sequence are defined ([26daf3a](https://github.com/geops/mobility-web-component/commit/26daf3a026a5807f8127a15b512d043fc280bf1a))
|
|
102
|
+
* move translation in its own file ([69e2c3f](https://github.com/geops/mobility-web-component/commit/69e2c3f206c91afe7e48771f2b59a9d2e0ded285))
|
|
103
|
+
* **permalink:** add permalink attribute as to toggle use of permalink ([6f73323](https://github.com/geops/mobility-web-component/commit/6f733237e91458616b3e903c4bdd507f49646e6a))
|
|
104
|
+
* post queryparams and origin to window.top ([154b78b](https://github.com/geops/mobility-web-component/commit/154b78b6712c2b0bdc4ff14648ae16f222948d6b))
|
|
105
|
+
* remove only ([20b5233](https://github.com/geops/mobility-web-component/commit/20b523361348c8f365f19494b4b86f812a480a93))
|
|
106
|
+
* remove use of RealtimeDepartureExtended type ([85be4f6](https://github.com/geops/mobility-web-component/commit/85be4f6bbf9e53caff2ddb5bb5abcdd76bac47cc))
|
|
107
|
+
* remove useless useeffect deps ([885e69d](https://github.com/geops/mobility-web-component/commit/885e69dc1de9299ae3195ff0406334b0a1e1aced))
|
|
108
|
+
* remove uselss file an set a scrollbar height ([a36203c](https://github.com/geops/mobility-web-component/commit/a36203cc50ab99d2265e6af89efff8beea362334))
|
|
109
|
+
* update dependencies ([d7b7eef](https://github.com/geops/mobility-web-component/commit/d7b7eef33cb58031caa9257678d605e70346261c))
|
|
110
|
+
* update dependencies ([1d3bfd7](https://github.com/geops/mobility-web-component/commit/1d3bfd72a7507adb11dca95206986005fa9d0734))
|
|
111
|
+
* use node 22 ([55fdb87](https://github.com/geops/mobility-web-component/commit/55fdb87054dd65f6ca78afa1a42e9bb77444048e))
|
|
112
|
+
* use perfectionist alphabetical ([8fce42d](https://github.com/geops/mobility-web-component/commit/8fce42d9998761598858322236dddb300c31ac51))
|
|
113
|
+
|
|
114
|
+
### [0.1.5](https://github.com/geops/mobility-web-component/compare/v0.1.4...v0.1.5) (2023-12-20)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Features
|
|
118
|
+
|
|
119
|
+
* add airport icon ([336c398](https://github.com/geops/mobility-web-component/commit/336c39838edc9e6d40ee31bf94a87bad43e983ba))
|
|
120
|
+
* add icons ([3da1169](https://github.com/geops/mobility-web-component/commit/3da11694f45f4f720e74d8dcf1d08697df249116))
|
|
121
|
+
* add stations management ([573b1c4](https://github.com/geops/mobility-web-component/commit/573b1c4b8e522a0fce1d1178a26b00a466cbdffd))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Bug Fixes
|
|
125
|
+
|
|
126
|
+
* add DebugStop component for stop ([7be3e83](https://github.com/geops/mobility-web-component/commit/7be3e8358d84a437a0965cc2282c8d9e9d679bfb))
|
|
127
|
+
* add invertColor property to RouteScheduleStop ([1372a26](https://github.com/geops/mobility-web-component/commit/1372a26670226765eff32acb1fbd9587f779f635))
|
|
128
|
+
* add RouteDestination ([c2b64ec](https://github.com/geops/mobility-web-component/commit/c2b64ec63c914390b5beb0502e29d8b80893bbf4))
|
|
129
|
+
* add RouteIcon component ([dec1970](https://github.com/geops/mobility-web-component/commit/dec1970a297d6f125d73239fe28b81a099d7a8da))
|
|
130
|
+
* add RouteInfos component ([3391cb1](https://github.com/geops/mobility-web-component/commit/3391cb1594b6bda4500d40f0e131f16c386d2cb9))
|
|
131
|
+
* allow to overide styleOptions ([cdb1e0d](https://github.com/geops/mobility-web-component/commit/cdb1e0d95ca801e83514b96dff171fc05dabcf5e))
|
|
132
|
+
* display long name in route identifier component ([603d41b](https://github.com/geops/mobility-web-component/commit/603d41bbc65b80bf156f7756fbdaab604c0a10d0))
|
|
133
|
+
* don't use default click behavior of the realtime layer ([23f4025](https://github.com/geops/mobility-web-component/commit/23f402524ae88a9558c54acd2b9af80d0255e0d9))
|
|
134
|
+
* fix DebugStop update ([e168f8c](https://github.com/geops/mobility-web-component/commit/e168f8c7bcdef782aa6738e0b5bb7ce65f5c1ebb))
|
|
135
|
+
* fix max size of route stop ([cdbb995](https://github.com/geops/mobility-web-component/commit/cdbb995243c90e628ab403536f13c746bd055e91))
|
|
136
|
+
* hide delay if a stop is time based ([7664724](https://github.com/geops/mobility-web-component/commit/76647249553fcde0c0c30ce3d4a97552a4df205e))
|
|
137
|
+
* move platform in stop name ([2c8232c](https://github.com/geops/mobility-web-component/commit/2c8232cd4f8eee991f336ec8e9e02c3c789bab3b))
|
|
138
|
+
* move platform in stop name ([8fc0568](https://github.com/geops/mobility-web-component/commit/8fc0568b9d9933ad009b8afe9ddbdbb31cae20f8))
|
|
139
|
+
* prepare for override of RouteSchedule ([b4c0dc5](https://github.com/geops/mobility-web-component/commit/b4c0dc54d134b66b5f3fb07bbae705f8a0a489c5))
|
|
140
|
+
* put attributes value in context ([7171824](https://github.com/geops/mobility-web-component/commit/7171824fb675deada72c599178fd2194ba100ca5))
|
|
141
|
+
* re add defualt click on realtime layer ([be122c7](https://github.com/geops/mobility-web-component/commit/be122c722ead84a90cdb12a18a18deeb44999665))
|
|
142
|
+
* reduce the size of font of delay ([a4608c9](https://github.com/geops/mobility-web-component/commit/a4608c92a7a62bbf90a675d9e8e5e8ca83bc2e78))
|
|
143
|
+
* separate Copyright files ([1aaaf74](https://github.com/geops/mobility-web-component/commit/1aaaf74dfb77f41ddf033a7b269d94a55a8d1060))
|
|
144
|
+
* separate Copyright files ([bd08d59](https://github.com/geops/mobility-web-component/commit/bd08d59e6f19735c0df3202ef375dd36a60e9b68))
|
|
145
|
+
* split exports ([5ea89e3](https://github.com/geops/mobility-web-component/commit/5ea89e3c856f024b5559bead4d74292cc1b3d578))
|
|
146
|
+
* split route schedule in multiple component ([c7e1847](https://github.com/geops/mobility-web-component/commit/c7e1847d139232ecc7cb5c206348f14f9c888e9f))
|
|
147
|
+
* split route stop display in multiple components ([b3f0571](https://github.com/geops/mobility-web-component/commit/b3f057112ecbb19cb0a0b3859a77903bca1fcf46))
|
|
148
|
+
* update bbox properly when following a train ([0b20e1e](https://github.com/geops/mobility-web-component/commit/0b20e1e8a25f94a3ba65ec32f5527d2718ea414d))
|
|
149
|
+
* use font sans by default ([63f9efe](https://github.com/geops/mobility-web-component/commit/63f9efed9b6fd0295558f2332ab2a1cc485b7f24))
|
|
150
|
+
* use font serif by default ([e8f528c](https://github.com/geops/mobility-web-component/commit/e8f528cefe7fc8bb977281a852e312c669eb8fe5))
|
|
151
|
+
* use line property for RouteIcon ([756a29c](https://github.com/geops/mobility-web-component/commit/756a29c5028d0f1aeee25b3311a7a31dff29951e))
|
|
152
|
+
* use same delays colors and values in route schedule and in the map ([8169f47](https://github.com/geops/mobility-web-component/commit/8169f476c4367e8932602bb80ed0dfbaa539b28f))
|
|
153
|
+
|
|
154
|
+
### [0.1.4](https://github.com/geops/mobility-web-component/compare/v0.1.3...v0.1.4) (2023-11-07)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
### Bug Fixes
|
|
158
|
+
|
|
159
|
+
* fix drag of overlay on mobile ([adb3047](https://github.com/geops/mobility-web-component/commit/adb3047172e236b551f324a96c6a09d573cb95d6))
|
|
160
|
+
* fix useZoom hook ([ae87276](https://github.com/geops/mobility-web-component/commit/ae87276fc9ed5fddc4a160dd806e010c01a0ec60))
|
|
161
|
+
|
|
162
|
+
### [0.1.3](https://github.com/geops/mobility-web-component/compare/v0.1.2...v0.1.3) (2023-11-03)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### Bug Fixes
|
|
166
|
+
|
|
167
|
+
* add notifications from moco ([#1](https://github.com/geops/mobility-web-component/issues/1)) ([3ca46e6](https://github.com/geops/mobility-web-component/commit/3ca46e60559966b5583b7017792c5e0e5ab34ef2))
|
|
168
|
+
* fix attributes definition ([ac87d87](https://github.com/geops/mobility-web-component/commit/ac87d8729248a134ca93d43bd686e89485ac1ac1))
|
|
169
|
+
* hide delay when they are null in route schedule ([dfb3a6f](https://github.com/geops/mobility-web-component/commit/dfb3a6f83d7a21ec4f1e7051e043d5de3264c715))
|
|
170
|
+
|
|
171
|
+
### [0.1.2](https://github.com/geops/mobility-web-component/compare/v0.1.1...v0.1.2) (2023-10-20)
|
|
172
|
+
|
|
173
|
+
## [0.1.1](https://github.com/geops/mobility-web-component/compare/v0.1.0...v0.1.1) (2023-10-20)
|
|
174
|
+
|
|
175
|
+
### Features
|
|
176
|
+
|
|
177
|
+
* change web component name ([9927ded](https://github.com/geops/mobility-web-component/commit/9927ded9403705aff12edce9735a65c9c174fa88))
|
|
178
|
+
|
|
179
|
+
## 0.1.0 (2023-10-18)
|
|
180
|
+
|
|
181
|
+
### Features
|
|
182
|
+
|
|
183
|
+
* move package in geops scope ([996e777](https://github.com/geops/mobility-web-component/commit/996e77704c51cc85c4b35129e59423dfe58c560e))
|
package/Logo.svg
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="78px" height="32px" viewBox="0 0 78 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>RVF</title>
|
|
4
|
+
<g id="RVF" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<path d="M53.5525224,11.6021652 L34.6289809,0.682621541 C32.2085279,-0.720140988 29.1004462,0.105013441 27.6976837,2.55297158 C26.2949211,4.97342457 27.1200756,8.08150625 29.5680337,9.48426878 L40.8726494,16.0029888 L29.5680337,22.5217088 C27.1475807,23.9244713 26.2949211,27.032553 27.6976837,29.453006 C29.1004462,31.873459 32.2085279,32.7261185 34.6289809,31.323356 L53.5250173,20.4038124 C55.147821,19.4686374 56.082996,17.7358131 56.0554909,15.9754836 C56.0554909,14.2151542 55.147821,12.509835 53.5250173,11.5471549" id="Path" fill="#E3000B" fill-rule="nonzero"></path>
|
|
6
|
+
<path d="M51.1320694,13.059938 C50.306915,13.059938 49.564276,13.3899997 49.0416782,13.9125976 L35.206589,5.90859959 C35.2615993,5.66105326 35.3166096,5.38600179 35.3166096,5.13845546 C35.3166096,3.4881466 33.9963625,2.16789951 32.3460536,2.16789951 C30.6957448,2.16789951 29.3754977,3.4881466 29.3754977,5.13845546 C29.3754977,6.78876432 30.6957448,8.1090114 32.3460536,8.1090114 C33.9963625,8.1090114 33.8863419,7.77894963 34.4089397,7.25635183 L48.2715341,15.2878549 C48.2165238,15.5354013 48.1615135,15.7829476 48.1615135,16.0304939 C48.1615135,16.2780402 48.1890187,16.5530917 48.2715341,16.8006381 L34.4089397,24.8321412 C33.8863419,24.3095434 33.1437029,24.0069867 32.3460536,24.0069867 C30.6957448,24.0069867 29.3754977,25.3272338 29.3754977,26.9775427 C29.3754977,28.6278515 30.6957448,29.9480986 32.3460536,29.9480986 C33.9963625,29.9480986 35.3166096,28.6278515 35.3166096,26.9775427 C35.3166096,25.3272338 35.2891044,26.4274397 35.206589,26.1798934 L49.0691834,18.1483903 C49.5917812,18.6709881 50.3344202,19.0010499 51.1595746,19.0010499 C52.8098835,19.0010499 54.1301305,17.6808028 54.1301305,16.0304939 C54.1301305,14.3801851 52.8098835,13.059938 51.1595746,13.059938" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
|
7
|
+
<polygon id="Path" fill="#E3000B" fill-rule="nonzero" points="59.053552 1.09519876 59.053552 30.9382839 67.3601065 30.9382839 67.3601065 19.9087197 76.3542898 19.9087197 76.3542898 12.8398968 67.3601065 12.8398968 67.3601065 8.38406288 77.9770935 8.38406288 77.9770935 1.09519876"></polygon>
|
|
8
|
+
<path d="M14.7427591,11.0795673 C14.7427591,13.995113 13.8350893,14.5727211 11.359626,14.5727211 L8.30655458,14.5727211 L8.30655458,7.72393934 L11.4421414,7.72393934 C13.9176047,7.72393934 14.7427591,8.43907317 14.7427591,11.0520622 M23.4343858,10.7770107 C23.4343858,4.09325985 19.3911291,1.1227039 11.3871311,1.1227039 L0,1.1227039 L0,30.9382839 L8.30655458,30.9382839 L8.30655458,20.5688433 L11.3321208,20.5688433 L15.4853981,30.9382839 L25.1947152,30.9382839 L18.9235416,18.9185344 C21.7840769,17.7633182 23.4068806,14.737752 23.4068806,10.7770107" id="Shape" fill="#E3000B" fill-rule="nonzero"></path>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# rvf-mobility-web-component
|
|
2
|
+
|
|
3
|
+
This project contains a set of web components allowing to use easily the [geOps APIs](https://developer.geops.io/):
|
|
4
|
+
|
|
5
|
+
- [`<geops-mobility>`](#geops-mobility-web-component): a web component used to display a map using different [geOps APIs](https://developer.geops.io/).
|
|
6
|
+
- [`<geops-mobility-search>`](#geops-mobility-search-web-component): a search input to search stops using the [geOps Stops API](https://developer.geops.io/apis/stops).
|
|
7
|
+
|
|
8
|
+
## `<geops-mobility>` web component
|
|
9
|
+
|
|
10
|
+
A web component used to display a map using different [geOps APIs](https://developer.geops.io/).
|
|
11
|
+
|
|
12
|
+
The map displays realtime vehicles, and allow to click on them to display their schedule plan.
|
|
13
|
+
You can also display MOCO notifications.
|
|
14
|
+
|
|
15
|
+
### Demo
|
|
16
|
+
|
|
17
|
+
You can see the web component in action using the [demo app](https://mobility-web-component.geops.io/).
|
|
18
|
+
|
|
19
|
+
### Usage Example
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<html>
|
|
23
|
+
<body>
|
|
24
|
+
<script type="module" src="https://www.unpkg.com/@geops/mobility-web-component)"></script>
|
|
25
|
+
<geops-mobility apikey="YOUR_GEOPS_API_KEY" style="display: block;width: 400px;height: 800px;"></geops-mobility>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Attributes
|
|
31
|
+
|
|
32
|
+
Here an exhaustive list of the `<geops-mobility>` web component attributes available to customize easily the map.
|
|
33
|
+
|
|
34
|
+
- [`apikey="YOUR_API_KEY"`](https://mobility-web-component.geops.io/?apikey=YOUR_API_KEY): your [geOps API key](https://developer.geops.io/).
|
|
35
|
+
- [`baselayer="travic_v2"`](https://mobility-web-component.geops.io/?baselayer=travic_v2): the style's name from the [geOps Maps API](https://developer.geops.io/apis/maps) (base_dark_v2, base_bright_v2, ...). Default to `travic_v2`.
|
|
36
|
+
- [`center="831634,5933959"`](https://mobility-web-component.geops.io/?center=831634,5933959): the center of the map in EPSG:3857 coordinates. Default to `831634,5933959` (Bern).
|
|
37
|
+
- [`geolocation="false"`](https://mobility-web-component.geops.io/?geolocation=false): display the geolocation button or not (true or false). Default to true.
|
|
38
|
+
- [`mapsurl="https://maps.geops.io"`](https://mobility-web-component.geops.io/?mapsurl=https://maps.geops.io): the [geOps Maps API](https://developer.geops.io/apis/maps) url to use. Default to `https://maps.geops.io`.
|
|
39
|
+
- [`maxzoom="14"`](https://mobility-web-component.geops.io/?maxzoom=14): define the max zoom level of the map.
|
|
40
|
+
- [`minzoom="2"`](https://mobility-web-component.geops.io/?minzoom=2): define the min zoom level of the map.
|
|
41
|
+
- [`mots="rail,bus"`](https://mobility-web-component.geops.io/?mots=rail,bus): list of commas separated mots to display on the Realtime layer ( rail, bus, coach, foot, tram, subway, gondola, funicular, ferry, car).
|
|
42
|
+
- [`notification="false"`](https://mobility-web-component.geops.io/?notification=true): display the notification layer or not (true or false). Default to true.
|
|
43
|
+
- [`notificationat="2025-01-01T12:00:00Z"`](https://mobility-web-component.geops.io/?notificationat=2025-01-01T12:00:00Z): a ISO date string used to display active notification at this date in the notification layer.
|
|
44
|
+
- [`notificationbeforelayerid=`](https://mobility-web-component.geops.io/?notificationbeforelayerid=): the style layer's id before which the notification layer will be added. By default the layer will be added on top.
|
|
45
|
+
- [`notificationurl=`](https://mobility-web-component.geops.io/?notificationurl=): the MOCO notification url to get the notifications from.
|
|
46
|
+
- [`permalink="true"`](https://mobility-web-component.geops.io/?permalink=true): add automatically an `x`,`y` an `z` URL parameters to the URL to allow to share the current map view. Default to false.
|
|
47
|
+
- [`realtime="false"`](https://mobility-web-component.geops.io/?realtime=false): display the realtime layer or not (true or false). Default to true.
|
|
48
|
+
- [`realtimeurl="wss://api.geops.io/tracker-ws/v1/ws"`](https://mobility-web-component.geops.io/?realtimeurl=wss://api.geops.io/tracker-ws/v1/ws): the [geOps Realtime API](https://developer.geops.io/apis/realtime) url to use. Default to `wss://api.geops.io/tracker-ws/v1/ws`.
|
|
49
|
+
- [`search="false"`](https://mobility-web-component.geops.io/?search=false): display the search stops input or not (true or false). Default to true.
|
|
50
|
+
- [`stopsurl="https://api.geops.io/stops/v1/"`](https://mobility-web-component.geops.io/?stopsurl=https://api.geops.io/stops/v1/): the [geOps Stops API](https://developer.geops.io/apis/stops) url to use. Default to `https://api.geops.io/stops/v1/`.
|
|
51
|
+
- [`tenant="sbb"`](https://mobility-web-component.geops.io/?tenant=sbb): the tenant name to use to filter the Realtime vehicles available.
|
|
52
|
+
- [`zoom="13"`](https://mobility-web-component.geops.io/?zoom=13): the zoom level of the map. Default to 13.
|
|
53
|
+
|
|
54
|
+
### URL parameters
|
|
55
|
+
|
|
56
|
+
You can specify all the web component attributes as url parameters to the demo app to customize easily the map.
|
|
57
|
+
|
|
58
|
+
- [`/?apikey=YOUR_API_KEY`](https://mobility-web-component.geops.io/?apikey=YOUR_API_KEY)
|
|
59
|
+
- [`/?baselayer=travic_v2`](https://mobility-web-component.geops.io/?baselayer=travic_v2)
|
|
60
|
+
- [`/?center=831634,5933959`](https://mobility-web-component.geops.io/?center=831634,5933959)
|
|
61
|
+
- [`/?geolocation=false`](https://mobility-web-component.geops.io/?geolocation=false)
|
|
62
|
+
- [`/?mapsurl=https://maps.geops.io`](https://mobility-web-component.geops.io/?mapsurl=https://maps.geops.io)
|
|
63
|
+
- [`/?maxzoom=14`](https://mobility-web-component.geops.io/?maxzoom=14)
|
|
64
|
+
- [`/?minzoom=2`](https://mobility-web-component.geops.io/?minzoom=2)
|
|
65
|
+
- [`/?mots=rail,bus`](https://mobility-web-component.geops.io/?mots=rail,bus)
|
|
66
|
+
- [`/?notification=false`](https://mobility-web-component.geops.io/?notification=true)
|
|
67
|
+
- [`/?notificationat=2025-01-01T12:00:00Z`](https://mobility-web-component.geops.io/?notificationat=2025-01-01T12:00:00Z)
|
|
68
|
+
- [`/?notificationbeforelayerid=`](https://mobility-web-component.geops.io/?notificationbeforelayerid=)
|
|
69
|
+
- [`/?notificationurl=`](https://mobility-web-component.geops.io/?notificationurl=)
|
|
70
|
+
- [`/?permalink=true`](https://mobility-web-component.geops.io/?permalink=true)
|
|
71
|
+
- [`/?realtime=false`](https://mobility-web-component.geops.io/?realtime=false)
|
|
72
|
+
- [`/?realtimeurl=wss://api.geops.io/tracker-ws/v1/ws`](https://mobility-web-component.geops.io/?realtimeurl=wss://api.geops.io/tracker-ws/v1/ws)
|
|
73
|
+
- [`/?search=false`](https://mobility-web-component.geops.io/?search=false)
|
|
74
|
+
- [`/?stopsurl=https://api.geops.io/stops/v1/`](https://mobility-web-component.geops.io/?stopsurl=https://api.geops.io/stops/v1/)
|
|
75
|
+
- [`/?tenant=sbb`](https://mobility-web-component.geops.io/?tenant=sbb)
|
|
76
|
+
- [`/?zoom=13`](https://mobility-web-component.geops.io/?zoom=13)
|
|
77
|
+
|
|
78
|
+
Another url parameter is used to get a full screen map instead of the documentation:
|
|
79
|
+
|
|
80
|
+
- [`/?fullscreen=true`](https://mobility-web-component.geops.io/?fullscreen=true): display the web component in full screen mode.
|
|
81
|
+
|
|
82
|
+
## `<geops-mobility-search>` web component
|
|
83
|
+
|
|
84
|
+
A search input to search stops using the [geOps Stops API](https://developer.geops.io/apis/stops).
|
|
85
|
+
|
|
86
|
+
### Demo
|
|
87
|
+
|
|
88
|
+
You can see the web component in action using the [demo app](https://mobility-web-component.geops.io/search.html).
|
|
89
|
+
|
|
90
|
+
### Usage Example
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<html>
|
|
94
|
+
<body>
|
|
95
|
+
<script type="module" src="https://www.unpkg.com/@geops/mobility-web-component)"></script>
|
|
96
|
+
<geops-mobility-search
|
|
97
|
+
apikey="YOUR_GEOPS_API_KEY"
|
|
98
|
+
limit="5"
|
|
99
|
+
mots="rail,bus"
|
|
100
|
+
style="display: block;width: 800px;height: 800px;">
|
|
101
|
+
</geops-mobility>
|
|
102
|
+
</body>
|
|
103
|
+
</html>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Attributes
|
|
107
|
+
|
|
108
|
+
Every parameters of the [geOps Stops API](https://developer.geops.io/apis/stops) can be passed as a string attribute of the web component.
|
|
109
|
+
|
|
110
|
+
The list of parameters of the [geOps Stops API](https://developer.geops.io/apis/stops) can be found
|
|
111
|
+
[here](https://developer.geops.io/apis/stops#parameters).
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### URL parameters
|
|
115
|
+
|
|
116
|
+
All the web component attributes can be specified as url parameters to the demo app to customize easily the search.
|
|
117
|
+
|
|
118
|
+
Another url parameter is used to get a full screen map instead of the documentation:
|
|
119
|
+
|
|
120
|
+
- [`/?fullscreen=true`](https://mobility-web-component.geops.io/search.html?fullscreen=true): display the web component in full screen mode.
|
|
121
|
+
|
|
122
|
+
## Development
|
|
123
|
+
|
|
124
|
+
If you want only the basic HTML, faster development process.
|
|
125
|
+
```bash
|
|
126
|
+
corepack enable
|
|
127
|
+
yarn install
|
|
128
|
+
yarn start
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
If you want the documentation website:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
corepack enable
|
|
135
|
+
yarn install && cd doc && yarn install
|
|
136
|
+
yarn doc
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
## Deployment
|
|
141
|
+
|
|
142
|
+
The demo app is deployed automatically after a merge on master using Vercel, on
|
|
143
|
+
[https://mobility-web-component.geops.io/](https://mobility-web-component.geops.io/).
|
|
144
|
+
|
|
145
|
+
## Guidelines
|
|
146
|
+
|
|
147
|
+
- every new components must have a new folder `MyComponent` with an `index.tsx` that contains only an export and a `MyNewComponent.tsx` file. The reason is too simplifx the override in forked project.
|
|
148
|
+
|
|
149
|
+
## Client specific code
|
|
150
|
+
|
|
151
|
+
If a client, for example `trenord`, needs a `mobility-web-component` with custom functionnalities.
|
|
152
|
+
Never add custom client specific stuff in this repository, instead:
|
|
153
|
+
|
|
154
|
+
- create a fork from this repository, and call it `trenord-mobility-web-component`.
|
|
155
|
+
- change the package name in `package.json` to `@geops/trenord-mobility-web-component`.
|
|
156
|
+
- change the `README` and `index.html` titles.
|
|
157
|
+
- create a new `MobilityMap` component in `src/` called `TrenordMobilityMap`. In this component you can copy the content of `MobilityMap` or just use the `MobilityMap` component with default values. It depends of your use case.
|
|
158
|
+
- change the `MobilityMap` import to `TrenordMobilityMap` in `src/index.tsx`.
|
|
159
|
+
- create a new npm package on `npmjs.com` from this repository, and call it `@geops/trenord-mobility-web-component`.
|
|
160
|
+
- publish a beta version to test the publishing with `ỳarn publish:beta`
|
|
161
|
+
|
|
162
|
+
At this point you're ready to create custom code, some rules must be followed to facilitate the merge of upstream `mobility-web-component` repository:
|
|
163
|
+
|
|
164
|
+
- always create new components using the client name as prefix, like `TrenordRouteSchedule`, or put them in a client specific folder `src/trenord/RoutSchedule`.
|
|
165
|
+
- to use the overrided components just change the export in the `index.tsx` of the component to overrided.
|
|
166
|
+
- never modify the original components in the forked repository, do it in the upstream repository then merge it in the forked repository.
|
|
167
|
+
- never update dependencies in the forked repository, do it in the upstream repository then merge it in the forked repository.
|
|
168
|
+
- if you have a doubt, ask.
|
|
169
|
+
|
|
170
|
+
## Merge upstream repository
|
|
171
|
+
|
|
172
|
+
When you use a fork you can merge the upstream repository using:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
// Set up the upstream remote, to do only once
|
|
176
|
+
git remote add upstream git@github.com:geops/mobility-web-component.git
|
|
177
|
+
|
|
178
|
+
git fetch upstream && git merge upstream/main
|
|
179
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const emptyPng =
|
|
2
|
+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
process() {
|
|
6
|
+
// sourceText, sourcePath, options
|
|
7
|
+
return {
|
|
8
|
+
code: `module.exports = "${emptyPng}";`,
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { extends: ["@commitlint/config-conventional"] };
|
package/doc/.fixpackrc
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sortToTop": [
|
|
3
|
+
"name",
|
|
4
|
+
"license",
|
|
5
|
+
"description",
|
|
6
|
+
"version",
|
|
7
|
+
"author",
|
|
8
|
+
"homepage",
|
|
9
|
+
"type",
|
|
10
|
+
"main",
|
|
11
|
+
"module",
|
|
12
|
+
"files",
|
|
13
|
+
"exports",
|
|
14
|
+
"proxy",
|
|
15
|
+
"dependencies",
|
|
16
|
+
"peerDependencies",
|
|
17
|
+
"devDependencies",
|
|
18
|
+
"resolutions",
|
|
19
|
+
"scripts"
|
|
20
|
+
]
|
|
21
|
+
}
|
package/doc/.prettierrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/doc/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Documentation
|
|
2
|
+
|
|
3
|
+
This the documentation website using NextJS
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
First, run the development server:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn install
|
|
11
|
+
yarn dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
package/doc/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "doc",
|
|
3
|
+
"description": "Documentation for the Mobility Web Components",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@emotion/cache": "^11.13.5",
|
|
7
|
+
"@emotion/react": "^11.13.5",
|
|
8
|
+
"@emotion/styled": "^11.13.5",
|
|
9
|
+
"@geops/geops-ui": "^0.3.4",
|
|
10
|
+
"@mui/icons-material": "^6.1.9",
|
|
11
|
+
"@mui/material": "^6.1.9",
|
|
12
|
+
"@mui/material-nextjs": "^6.1.9",
|
|
13
|
+
"@mui/styles": "^6.1.9",
|
|
14
|
+
"next": "15.0.3",
|
|
15
|
+
"prismjs": "^1.29.0",
|
|
16
|
+
"react": "^18",
|
|
17
|
+
"react-dom": "^18",
|
|
18
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
19
|
+
"typeface-lato": "^1.1.13"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^22.10.1",
|
|
23
|
+
"@types/react": "^18.3.12",
|
|
24
|
+
"@types/react-dom": "^18",
|
|
25
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
26
|
+
"eslint": "^8",
|
|
27
|
+
"eslint-config-next": "15.0.3",
|
|
28
|
+
"eslint-config-prettier": "^9.1.0",
|
|
29
|
+
"generact": "^0.4.0",
|
|
30
|
+
"postcss": "^8.4.49",
|
|
31
|
+
"tailwindcss": "^3.4.15",
|
|
32
|
+
"typescript": "^5.7.2"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "next build",
|
|
36
|
+
"cp": "generact --root src/app/components",
|
|
37
|
+
"dev": "next dev",
|
|
38
|
+
"lint": "next lint",
|
|
39
|
+
"start": "next start",
|
|
40
|
+
"up": "yarn upgrade-interactive --latest"
|
|
41
|
+
},
|
|
42
|
+
"private": true
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Folder that contains all static files.
|