File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed
components/src/maplibre/VectorLayer Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 113113 </DesignTokens >
114114</Story >
115115
116+ <Story asChild name =" feat/341" >
117+ <DesignTokens theme =" light" >
118+ <div class =" container" >
119+ <Map showDebug ={true } style ={SWRDataLabLight ({ places: { showLabels: false } })}>
120+ <GeoJsonSource id ="demo" data ={SamplePoints as GeoJSON } attribution =" Demo attribution" />
121+ <VectorLayer
122+ sourceId =" demo"
123+ id =" circles"
124+ type =" circle"
125+ paint ={{
126+ ' circle-radius' : 12 ,
127+ ' circle-color' : ' red'
128+ }}
129+ />
130+ <AttributionControl position =" bottom-left" />
131+ </Map >
132+ </div >
133+ </DesignTokens >
134+ </Story >
135+
116136<Story asChild name =" Filter" >
117137 <DesignTokens theme =" light" >
118138 <div class =" controls" >
Original file line number Diff line number Diff line change 4545 sourceId,
4646 sourceLayer,
4747 filter,
48- visible = true ,
49- placeBelow = ' label-place-major-city' ,
48+ placeBelow,
5049 type,
5150 paint,
5251 layout,
8079 $effect (() => {
8180 if (map && styleLoaded ) {
8281 const style = map .getStyle ();
83- beforeId = style .layers .find ((l ) => {
84- return l .id === placeBelow ;
85- })?.id ;
82+ beforeId = placeBelow
83+ ? style .layers .find ((l ) => {
84+ return l .id === placeBelow ;
85+ })?.id
86+ : undefined ;
8687 }
8788 });
8889
8990 $effect (() => {
90- if (map && styleLoaded && beforeId ) {
91- map .addLayer (layerSpec , beforeId );
91+ if (map && styleLoaded ) {
92+ beforeId ? map .addLayer (layerSpec , beforeId ) : map . addLayer ( layerSpec );
9293 }
9394 });
9495
You can’t perform that action at this time.
0 commit comments