Skip to content

Commit

Permalink
chore(layer-selector): add stories testing default selection
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Aug 22, 2022
1 parent c4bfff7 commit 74c43af
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/layer-selector/src/LayerSelector.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,21 @@ export const withoutExpandableContainer = () => (
overlays={['Address Points']}
></LayerSelector>
);

export const defaultSelection = () => (
<LayerSelector
baseLayers={[
'Lite',
'Terrain',
{
token: 'Topo',
selected: true,
},
'Color IR',
]}
view={mapViewMock}
quadWord="my-fake-quad-word"
makeExpandable={false}
overlays={['Address Points']}
></LayerSelector>
);
32 changes: 32 additions & 0 deletions packages/layer-selector/src/LayerSelectorWithMap.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const customLOD = () => {

return <WithMap zoom={6} baseLayers={baseLayers} />;
};

export const linkedOverlays = () => {
const baseLayers = [
{
Expand Down Expand Up @@ -152,6 +153,37 @@ export const linkedOverlays = () => {
return <WithMap zoom={6} baseLayers={baseLayers} overlays={overlays} />;
};

export const defaultSelection = () => {
const baseLayers = [
{
Factory: TileLayer,
url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer',
id: 'Topo',
},
{
Factory: TileLayer,
url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer',
id: 'Terrain',
selected: true,
},
];

const overlays = [
{
Factory: FeatureLayer,
url: 'https://services1.arcgis.com/99lidPhWCzftIe9K/arcgis/rest/services/UtahMunicipalBoundaries/FeatureServer/0',
id: 'Cities',
selected: true,
},
{
Factory: FeatureLayer,
url: 'https://services1.arcgis.com/99lidPhWCzftIe9K/arcgis/rest/services/UtahCountyBoundaries/FeatureServer/0',
id: 'Counties',
},
];

return <WithMap zoom={6} baseLayers={baseLayers} overlays={overlays} />;
};
export const landOwnership = () => {
const landOwnershipOptions = {
overlays: [
Expand Down

0 comments on commit 74c43af

Please sign in to comment.