@@ -62,7 +62,6 @@ type MapProps = {
62
62
pathProperties ?: ManageTrainSchedulePathProperties ;
63
63
pathGeometry ?: NonNullable < PathProperties [ 'geometry' ] > ;
64
64
setMapCanvas ?: ( mapCanvas : string ) => void ;
65
- isReadOnly ?: boolean ;
66
65
hideAttribution ?: boolean ;
67
66
hideItinerary ?: boolean ;
68
67
preventPointSelection ?: boolean ;
@@ -76,7 +75,6 @@ const Map = ({
76
75
pathProperties,
77
76
pathGeometry : geometry ,
78
77
setMapCanvas,
79
- isReadOnly = false ,
80
78
hideAttribution = false ,
81
79
hideItinerary = false ,
82
80
preventPointSelection = false ,
@@ -100,15 +98,15 @@ const Map = ({
100
98
) ;
101
99
102
100
const mapViewport = useMemo ( ( ) => {
103
- if ( isReadOnly && pathGeometry ) {
101
+ if ( pathGeometry ) {
104
102
return computeBBoxViewport ( bbox ( pathGeometry ) , viewport , {
105
103
width : mapContainer ?. clientWidth ,
106
104
height : mapContainer ?. clientHeight ,
107
105
padding : 60 ,
108
106
} ) ;
109
107
}
110
108
return viewport ;
111
- } , [ isReadOnly , pathGeometry , viewport , mapContainer ] ) ;
109
+ } , [ pathGeometry , viewport , mapContainer ] ) ;
112
110
113
111
const [ mapIsLoaded , setMapIsLoaded ] = useState ( false ) ;
114
112
@@ -244,41 +242,33 @@ const Map = ({
244
242
245
243
return (
246
244
< >
247
- { ! isReadOnly && (
248
- < MapButtons
249
- map = { mapRef . current ?? undefined }
250
- resetPitchBearing = { resetPitchBearing }
251
- closeFeatureInfoClickPopup = { closeFeatureInfoClickPopup }
252
- bearing = { mapViewport . bearing }
253
- withMapKeyButton
254
- viewPort = { mapViewport }
255
- isNewButtons
256
- />
257
- ) }
245
+ < MapButtons
246
+ map = { mapRef . current ?? undefined }
247
+ resetPitchBearing = { resetPitchBearing }
248
+ closeFeatureInfoClickPopup = { closeFeatureInfoClickPopup }
249
+ bearing = { mapViewport . bearing }
250
+ withMapKeyButton
251
+ viewPort = { mapViewport }
252
+ isNewButtons
253
+ />
258
254
< ReactMapGL
259
- dragPan = { false }
260
- scrollZoom = { false }
255
+ id = { mapId }
261
256
ref = { mapRef }
262
257
{ ...mapViewport }
263
258
style = { { width : '100%' , height : '100%' } }
264
- cursor = { isReadOnly || preventPointSelection ? 'default' : 'pointer' }
259
+ cursor = { preventPointSelection ? 'default' : 'pointer' }
265
260
mapStyle = { mapBlankStyle }
266
261
attributionControl = { false } // Defined below
267
- { ...( ! isReadOnly && {
268
- dragPan : true ,
269
- scrollZoom : true ,
270
- onMove : ( e ) => updateViewportChange ( e . viewState ) ,
271
- onMouseMove : onMoveGetFeature ,
272
- onClick : onFeatureClick ,
273
- onResize : ( e ) => {
274
- updateViewportChange ( {
275
- width : e . target . getContainer ( ) . offsetWidth ,
276
- height : e . target . getContainer ( ) . offsetHeight ,
277
- } ) ;
278
- } ,
279
- } ) }
262
+ onMove = { ( e ) => updateViewportChange ( e . viewState ) }
263
+ onMouseMove = { onMoveGetFeature }
264
+ onClick = { onFeatureClick }
265
+ onResize = { ( e ) => {
266
+ updateViewportChange ( {
267
+ width : e . target . getContainer ( ) . offsetWidth ,
268
+ height : e . target . getContainer ( ) . offsetHeight ,
269
+ } ) ;
270
+ } }
280
271
interactiveLayerIds = { interactiveLayerIds }
281
- touchZoomRotate
282
272
maxPitch = { 85 }
283
273
terrain = {
284
274
terrain3DExaggeration
@@ -292,7 +282,9 @@ const Map = ({
292
282
captureMap ( mapViewport , mapId , setMapCanvas , pathGeometry ) ;
293
283
} }
294
284
preserveDrawingBuffer
295
- id = { mapId }
285
+ dragPan
286
+ scrollZoom
287
+ touchZoomRotate
296
288
>
297
289
< VirtualLayers />
298
290
{ ! hideAttribution && (
@@ -344,74 +336,73 @@ const Map = ({
344
336
layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . ROUTES . GROUP ] }
345
337
infraID = { infraID }
346
338
/>
347
- { ! isReadOnly && (
348
- < >
349
- < OperationalPoints
350
- colors = { colors [ mapStyle ] }
351
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . OPERATIONAL_POINTS . GROUP ] }
352
- infraID = { infraID }
353
- operationnalPointId = { hoveredOperationalPointId }
354
- overrideStore
355
- />
356
339
357
- < Electrifications
358
- colors = { colors [ mapStyle ] }
359
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . ELECTRIFICATIONS . GROUP ] }
360
- infraID = { infraID }
361
- />
340
+ < OperationalPoints
341
+ colors = { colors [ mapStyle ] }
342
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . OPERATIONAL_POINTS . GROUP ] }
343
+ infraID = { infraID }
344
+ operationnalPointId = { hoveredOperationalPointId }
345
+ />
362
346
363
- < NeutralSections
364
- colors = { colors [ mapStyle ] }
365
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . DEAD_SECTIONS . GROUP ] }
366
- infraID = { infraID }
367
- />
347
+ < Electrifications
348
+ colors = { colors [ mapStyle ] }
349
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . ELECTRIFICATIONS . GROUP ] }
350
+ infraID = { infraID }
351
+ />
368
352
369
- < BufferStops
370
- colors = { colors [ mapStyle ] }
371
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . BUFFER_STOPS . GROUP ] }
372
- infraID = { infraID }
373
- />
374
- < Detectors
375
- colors = { colors [ mapStyle ] }
376
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . DETECTORS . GROUP ] }
377
- infraID = { infraID }
378
- />
379
- < Switches
380
- colors = { colors [ mapStyle ] }
381
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SWITCHES . GROUP ] }
382
- infraID = { infraID }
383
- />
353
+ < NeutralSections
354
+ colors = { colors [ mapStyle ] }
355
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . DEAD_SECTIONS . GROUP ] }
356
+ infraID = { infraID }
357
+ />
384
358
385
- < SpeedLimits
386
- colors = { colors [ mapStyle ] }
387
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SPEED_LIMITS . GROUP ] }
388
- infraID = { infraID }
389
- />
390
- < SNCF_PSL
391
- colors = { colors [ mapStyle ] }
392
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SPEED_LIMITS . GROUP ] }
393
- infraID = { infraID }
394
- />
359
+ < BufferStops
360
+ colors = { colors [ mapStyle ] }
361
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . BUFFER_STOPS . GROUP ] }
362
+ infraID = { infraID }
363
+ />
364
+ < Detectors
365
+ colors = { colors [ mapStyle ] }
366
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . DETECTORS . GROUP ] }
367
+ infraID = { infraID }
368
+ />
369
+ < Switches
370
+ colors = { colors [ mapStyle ] }
371
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SWITCHES . GROUP ] }
372
+ infraID = { infraID }
373
+ />
395
374
396
- < Signals
397
- sourceTable = "signals"
398
- colors = { colors [ mapStyle ] }
399
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SIGNALS . GROUP ] }
400
- infraID = { infraID }
401
- />
402
- < LineSearchLayer
403
- layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . LINE_SEARCH . GROUP ] }
404
- infraID = { infraID }
405
- />
406
- { ! showStdcmAssets && featureInfoClick && (
407
- < AddPathStepPopup
408
- pathProperties = { pathProperties }
409
- featureInfoClick = { featureInfoClick }
410
- resetFeatureInfoClick = { resetFeatureInfoClick }
411
- />
412
- ) }
413
- </ >
375
+ < SpeedLimits
376
+ colors = { colors [ mapStyle ] }
377
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SPEED_LIMITS . GROUP ] }
378
+ infraID = { infraID }
379
+ />
380
+ < SNCF_PSL
381
+ colors = { colors [ mapStyle ] }
382
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SPEED_LIMITS . GROUP ] }
383
+ infraID = { infraID }
384
+ />
385
+
386
+ < Signals
387
+ sourceTable = "signals"
388
+ colors = { colors [ mapStyle ] }
389
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . SIGNALS . GROUP ] }
390
+ infraID = { infraID }
391
+ />
392
+
393
+ < LineSearchLayer
394
+ layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . LINE_SEARCH . GROUP ] }
395
+ infraID = { infraID }
396
+ />
397
+
398
+ { ! showStdcmAssets && featureInfoClick && (
399
+ < AddPathStepPopup
400
+ pathProperties = { pathProperties }
401
+ featureInfoClick = { featureInfoClick }
402
+ resetFeatureInfoClick = { resetFeatureInfoClick }
403
+ />
414
404
) }
405
+
415
406
< ItineraryLayer
416
407
layerOrder = { LAYER_GROUPS_ORDER [ LAYERS . ITINERARY . GROUP ] }
417
408
geometry = { pathGeometry }
0 commit comments