File tree Expand file tree Collapse file tree 3 files changed +37
-2
lines changed
Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -1463,7 +1463,26 @@ ${props.text}`,
14631463 position : "bottom"
14641464 } ) ;
14651465 }
1466+ }
14661467
1468+ /**
1469+ * Cache l'itinéraire s'il est affiché à partir de son ID
1470+ * @param {Number } routeId
1471+ */
1472+ hideRouteFromID ( routeId ) {
1473+ try {
1474+ const route = this . #getRouteFromID( routeId ) ;
1475+ if ( route . visible ) {
1476+ this . toggleShowRoute ( route ) ;
1477+ }
1478+ } catch ( e ) {
1479+ console . warn ( e ) ;
1480+ Toast . show ( {
1481+ text : "L'itinéraire n'a pas pu être ouvert." ,
1482+ duration : "short" ,
1483+ position : "bottom"
1484+ } ) ;
1485+ }
14671486 }
14681487
14691488 /**
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ let RouteDrawDOM = {
9292 text : "Partager" ,
9393 value : "share" ,
9494 } ,
95+ {
96+ class : "tools-layer-visibility" ,
97+ text : "Masquer" ,
98+ value : "hide" ,
99+ } ,
95100 {
96101 class : "tools-layer-download" ,
97102 text : "Télécharger le plan" ,
@@ -120,6 +125,9 @@ let RouteDrawDOM = {
120125 if ( value === "share" ) {
121126 this . shareRoute ( ) ;
122127 }
128+ if ( value === "hide" ) {
129+ this . hideRoute ( ) ;
130+ }
123131 if ( value === "edit" ) {
124132 this . openEdition ( ) ;
125133 }
Original file line number Diff line number Diff line change @@ -315,6 +315,14 @@ class RouteDraw {
315315 Globals . myaccount . shareRouteFromID ( this . routeId ) ;
316316 }
317317
318+ /**
319+ * Cache l'itinéraire à l'aide de la méthode de myAccount
320+ */
321+ hideRoute ( ) {
322+ Globals . myaccount . hideRouteFromID ( this . routeId ) ;
323+ this . hide ( true ) ;
324+ }
325+
318326 /**
319327 * Exporte l'itinéraire à l'aide de la méthode de myAccount
320328 */
@@ -1293,9 +1301,9 @@ class RouteDraw {
12931301 * ferme le menu des résultats du calcul
12941302 * @public
12951303 */
1296- hide ( ) {
1304+ hide ( hideRoute = false ) {
12971305 const routeId = this . routeId ;
1298- if ( routeId !== null ) {
1306+ if ( routeId !== null && ! hideRoute ) {
12991307 Globals . myaccount . showRouteFromID ( routeId ) ;
13001308 }
13011309 Globals . menu . close ( "routeDraw" ) ;
You can’t perform that action at this time.
0 commit comments