File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
lib/components/data-vis/map
wrappers/components/data-vis/map Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 107
107
borderColor = " #003300" ,
108
108
labelSourceLayer = " place" ,
109
109
externalData = null ,
110
+ showLegend = false ,
110
111
}: {
111
112
data: object [];
112
113
paintObject? : object ;
149
150
setCustomPalette? : boolean ;
150
151
customBreaks? : number [];
151
152
interactive? : boolean ;
153
+ showLegend: boolean ;
152
154
onload? : (map : maplibregl .Map ) => void ;
153
155
onerror? : (error : Partial <ErrorEvent >) => void ;
154
156
onclick? : (e : maplibregl .MapMouseEvent ) => void ;
572
574
{/if }
573
575
</MapLibre >
574
576
</div >
575
-
576
- <div class =" legend" >
577
- {#each legendItems as item }
578
- <div class =" legend-item" >
579
- <div class ="legend-color" style ="background-color: {item .color };" ></div >
580
- <span >{item .label }</span >
581
- </div >
582
- {/each }
583
- </div >
577
+ {#if showLegend }
578
+ <div class =" legend" >
579
+ {#each legendItems as item }
580
+ <div class =" legend-item" >
581
+ <div class ="legend-color" style ="background-color: {item .color };" ></div >
582
+ <span >{item .label }</span >
583
+ </div >
584
+ {/each }
585
+ </div >
586
+ {/if }
584
587
585
588
<style >
586
589
:global(.maplibregl-ctrl-group button .reset-button ) {
Original file line number Diff line number Diff line change 291
291
value: 400 ,
292
292
description: " Set height of map" ,
293
293
},
294
+ {
295
+ name: " showLegend" ,
296
+ category: " Styling" ,
297
+ isProp: true ,
298
+ value: false ,
299
+ description: " Show the map Legend" ,
300
+ },
294
301
{
295
302
name: " styleSheet" ,
296
303
isProp: true ,
You can’t perform that action at this time.
0 commit comments