1 | /* |
2 | Copyright - 2017 2023 - wwwouaiebe - Contact: https://www.ouaie.be/ |
3 | |
4 | This program is free software; |
5 | you can redistribute it and/or modify it under the terms of the |
6 | GNU General Public License as published by the Free Software Foundation; |
7 | either version 3 of the License, or any later version. |
8 | |
9 | This program is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | GNU General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU General Public License |
15 | along with this program; if not, write to the Free Software |
16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
17 | */ |
18 | /* |
19 | Changes: |
20 | - v4.0.0: |
21 | - created from v3.6.0 |
22 | Doc reviewed 202208 |
23 | */ |
24 | |
25 | import { ICON_POSITION, INVALID_OBJ_ID, ZERO } from '../../main/Constants.js'; |
26 | |
27 | /* ------------------------------------------------------------------------------------------------------------------------- */ |
28 | /** |
29 | An object with data shared between the differents objects that are building the note ( TranslationRotationFinder, |
30 | ArrowAndTooltipFinder, StreetFinder and SvgBuilder ) |
31 | */ |
32 | /* ------------------------------------------------------------------------------------------------------------------------- */ |
33 | |
34 | class ComputeDataForMapIcon { |
35 | |
36 | /** |
37 | The constructor |
38 | */ |
39 | |
40 | constructor ( ) { |
41 | Object.seal ( this ); |
42 | } |
43 | |
44 | /** |
45 | The objId of the nearest itinerary point |
46 | @type {Number} |
47 | */ |
48 | |
49 | nearestItineraryPointObjId = INVALID_OBJ_ID; |
50 | |
51 | /** |
52 | the route for witch the note will be created |
53 | @type {Route} |
54 | */ |
55 | |
56 | route = null; |
57 | |
58 | /** |
59 | The position on the Route. Must be a property of the ICON_POSITION enum |
60 | @type {Number} |
61 | */ |
62 | |
63 | positionOnRoute = ICON_POSITION.onRoute; |
64 | |
65 | /** |
66 | The direction to follow ( = the angle of the outgoing street after the rotation of the svg icon ) |
67 | @type {String} |
68 | */ |
69 | |
70 | direction = null; |
71 | |
72 | /** |
73 | The arrow to display in the address |
74 | @type {String} |
75 | */ |
76 | |
77 | directionArrow = ' '; |
78 | |
79 | /** |
80 | The rcnRef number for bike ( when a bike network exists near the note position ) |
81 | @type {String} |
82 | */ |
83 | |
84 | rcnRef = ''; |
85 | |
86 | /** |
87 | The rotation of the svg icon needed to have the incoming street oriented from the bottom of the icon |
88 | @type {Number} |
89 | */ |
90 | |
91 | rotation = ZERO; |
92 | |
93 | /** |
94 | The translation needed to have the note position at the center of the svg icon ( = the translation in |
95 | pixel from the map origin.) |
96 | @type {Array.<Number>} |
97 | */ |
98 | |
99 | translation = [ ZERO, ZERO ]; |
100 | } |
101 | |
102 | export default ComputeDataForMapIcon; |
103 | |
104 | /* --- End of file --------------------------------------------------------------------------------------------------------- */ |
105 |