Spectrum Spatial (SSA/LIM)

 View Only

Change the legend text from Rasters

  • 1.  Change the legend text from Rasters

    Posted 02-15-2024 16:34

    In an SSA context I have the following

    image.png

    This is coming from an MRR.

    I want to make a few changes to the legend text. They should look like

    10% Hazard Category Z2
    0<1
    1

    2

    3

    ...

    AND

    10% Hazard Category ZAEM1

    0 - No mapped flow

    1 - H1 – Relatively benign flow

    2 - H2 – Unsafe for small vehicles

    3 - H3 – Unsafe for all vehicles

    4 - H4 – Unsafe for all people & vehicles

    5 - H5 – Unsafe – buildings require engineering design

    6 - H6 – Unconditionally dangerous

    I am using the current version of Spectrum and SSA with all patches.

    An SSA guru friend suggested the following code in the brand.css

    [title="1"]

    {
          
    visibility:hidden;
    }
     
     
    [title="1.0"]::before
    {
          content:"0<1"; 
      visibility: visible;
    }

    But the issue is that it then changes all the 1.0 values in every context/project.

    Is it possible to apply the changes based on the div that it is within
    <div class="col-8 padding-left wordBreak" title="10% - Hazard Category ZAEM1"> 10% - Hazard Category ZAEM1 </div>

     

    Or is there another solution. In previous versions I was informed that you could do the following but this no longer works.

    CSS branding update in CSS files.

    /* Legend raster override styles */

    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(7) &gt; div:nth-child(2),
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(8) &gt; div:nth-child(2),
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(9) &gt; div:nth-child(2),
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(10) &gt; div:nth-child(2),
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(11) &gt; div:nth-child(2),
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(12) &gt; div:nth-child(2),
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(13) &gt; div:nth-child(2),
    /* Reservoir Catchment Serviceability Legend */
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(7):after {
        content: &quot;High Pressure &gt;80m expected&quot;;
    }

    After changes

    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(8):after {
        content: &quot;Pressures &lt;80m and &gt;60m expected&quot;;
    }
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(9):after {
        content: &quot;Pressures &gt;35m and &lt;60m expected&quot;;
    }
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(10):after {
        content: &quot;Pressures &gt;30m and &lt;35m expected&quot;;
    }
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(11):after {
        content: &quot;Low Range Pressures &gt;22m and &lt;30m expected&quot;;
    }
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(12):after {
        content: &quot;Low Pressure &lt;22m expected&quot;;
    }
    #Reservoir\ Catchment\ Serviceability&gt; pb-spatial-legends&gt; div:not(Reservoir\
    Catchment\ Serviceability) &gt; div:nth-child(13):after {
        content: &quot;Unserviceable elevation &gt; Res TWL&quot;;
    }



    ------------------------------
    George Corea
    Data Guru
    Mangoesmapping
    MOOMIN QLD
    ------------------------------