Skip to content

Commit

Permalink
PoC for map zoomies options
Browse files Browse the repository at this point in the history
  • Loading branch information
yileifeng committed Dec 5, 2024
1 parent 20a17a9 commit 33bbde8
Show file tree
Hide file tree
Showing 13 changed files with 410 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
public/TCEI-IECT
.DS_Store
node_modules
/dist
Expand Down
23 changes: 23 additions & 0 deletions StoryRampSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,25 @@
"type": "string",
"description": "Supporting text content for the map."
},
"zoomDetails": {
"type": "object",
"description": "Attributes to zoom to point of interest.",
"properties": {
"x": {
"type": "number",
"description": "X coordinate of point."
},
"y": {
"type": "number",
"description": "Y coordinate of point."
},
"zoom": {
"type": "number",
"description": "Scale value when zooming map."
},
"required": ["x", "y", "zoom"]
}
},
"customTemplates": {
"type": "array",
"description": "An array of custom template names that will need to be registered on the map component.",
Expand Down Expand Up @@ -283,6 +302,10 @@
"default": "",
"enum": ["", "left", "right"]
},
"duration": {
"type": "number",
"description": "Animation duration of zoom."
},
"points": {
"type": "array",
"description": "A list of points of interest.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,71 @@
"backgroundImage": "00000000-0000-0000-0000-000000000000/assets/en/bg.jpg"
},
"slides": [
{
"title": "Zoomies with Interactive CSS Animation",
"backgroundImage": "00000000-0000-0000-0000-000000000000/assets/en/map.jpg",
"bgCssClasses": "img-zoomies",
"panel": [
{
"title": "Locator map - static image with animations as background",
"type": "text",
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"customStyles": "",
"cssClasses": "right-align"
}
],
"includeInToc": false
},
{
"title": "Zoomies with RAMP API",
"panel": [
{
"config": "00000000-0000-0000-0000-000000000000/ramp-config/Locator_Map.json",
"type": "map",
"zoomDetails": {
"x": -123.71534,
"y": 49.113141,
"zoom": 2000000
},
"scrollguard": true
},
{
"title": "Locator map as RAMP",
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"type": "text"
}
],
"includeInToc": false
},
{
"title": "Interactive Map with Zoomies",
"panel": [
{
"config": "00000000-0000-0000-0000-000000000000/ramp-config/Locator_Map.json",
"type": "interactive-map",
"scrollguard": true,
"title": "Interactive Map with Zoom to Salish Sea",
"points": [
{
"title": "Home Extent",
"text": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"target": {
"returnHome": true
}
},
{
"title": "Point of Interest",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"target": {
"layerId": "Salish_Sea_Boundaries",
"oid": 1
}
}
],
"duration": 2000
}
]
},
{
"title": "Overview",
"backgroundImage": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-516166467__1554821531978__w1920.jpg",
Expand Down Expand Up @@ -581,7 +646,7 @@
]
}
],
"tocOrientation": "horizontal",
"tocOrientation": "vertical",
"stylesheets": ["00000000-0000-0000-0000-000000000000/styles/main.css"],
"contextLink": "https://www.canada.ca/en/environment-climate-change/services/national-pollutant-release-inventory/tools-resources-data/exploredata.html",
"contextLabel": "Explore National Pollutant Release Inventory data",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@
{
"id": "EXT_NRCAN_Lambert_3978",
"default": {
"xmin": -14122466.687850542,
"xmax": -11280232.228095304,
"xmin": -15122466.687850542,
"xmax": -12280232.228095304,
"ymin": 6247479.46145181,
"ymax": 8125995.868587801,
"spatialReference": {
Expand All @@ -243,8 +243,8 @@
{
"id": "EXT_ESRI_World_AuxMerc_3857",
"default": {
"xmin": -14122466.687850542,
"xmax": -11280232.228095304,
"xmin": -15122466.687850542,
"xmax": -12280232.228095304,
"ymin": 6247479.46145181,
"ymax": 8125995.868587801,
"spatialReference": {
Expand Down Expand Up @@ -443,7 +443,7 @@
},
"mergeGrids": [
{
"gridId": "CommunityDirectory",
"gridId": "Community Directory",
"layers": [
{
"layerId": "CD"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
{
"configs": {
"en": {
"map": {
"extentSets": [
{
"id": "EXT_ESRI_World_AuxMerc_3857",
"default": {
"xmax": -5007771.626060756,
"xmin": -16632697.354854,
"ymax": 10015875.184845109,
"ymin": 5022907.964742964,
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
}
}
}
],
"lodSets": [
{
"id": "LOD_ESRI_World_AuxMerc_3857",
"lods": [
{
"level": 0,
"resolution": 19567.87924099992,
"scale": 73957190.948944
},
{
"level": 1,
"resolution": 9783.93962049996,
"scale": 36978595.474472
},
{
"level": 2,
"resolution": 4891.96981024998,
"scale": 18489297.737236
},
{
"level": 3,
"resolution": 2445.98490512499,
"scale": 9244648.868618
},
{
"level": 4,
"resolution": 1222.992452562495,
"scale": 4622324.434309
},
{
"level": 5,
"resolution": 611.4962262813797,
"scale": 2311162.217155
},
{
"level": 6,
"resolution": 305.74811314055756,
"scale": 1155581.108577
},
{
"level": 7,
"resolution": 152.87405657041106,
"scale": 577790.554289
},
{
"level": 8,
"resolution": 76.43702828507324,
"scale": 288895.277144
},
{
"level": 9,
"resolution": 38.21851414253662,
"scale": 144447.638572
},
{
"level": 10,
"resolution": 19.10925707126831,
"scale": 72223.819286
},
{
"level": 11,
"resolution": 9.554628535634155,
"scale": 36111.909643
},
{
"level": 12,
"resolution": 4.77731426794937,
"scale": 18055.954822
},
{
"level": 13,
"resolution": 2.388657133974685,
"scale": 9027.977411
},
{
"level": 14,
"resolution": 1.1943285668550503,
"scale": 4513.988705
},
{
"level": 15,
"resolution": 0.5971642835598172,
"scale": 2256.994353
},
{
"level": 16,
"resolution": 0.29858214164761665,
"scale": 1128.497176
},
{
"level": 17,
"resolution": 0.14929107082380833,
"scale": 564.248588
},
{
"level": 18,
"resolution": 0.07464553541190416,
"scale": 282.124294
},
{
"level": 19,
"resolution": 0.03732276770595208,
"scale": 141.062147
},
{
"level": 20,
"resolution": 0.01866138385297604,
"scale": 70.5310735
}
]
}
],
"tileSchemas": [
{
"id": "DEFAULT_ESRI_World_AuxMerc_3857",
"name": "Web Mercator Maps",
"extentSetId": "EXT_ESRI_World_AuxMerc_3857",
"lodSetId": "LOD_ESRI_World_AuxMerc_3857",
"thumbnailTileUrls": ["/tile/8/91/74', '/tile/8/91/75"]
},
{
"id": "EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",
"name": "Web Mercator Maps",
"extentSetId": "EXT_ESRI_World_AuxMerc_3857",
"lodSetId": "LOD_ESRI_World_AuxMerc_3857",
"thumbnailTileUrls": ["/tile/8/91/74", "/tile/8/91/75"],
"hasNorthPole": false
}
],
"basemaps": [
{
"id": "esriOcean",
"tileSchemaId": "DEFAULT_ESRI_World_AuxMerc_3857",
"layers": [
{
"layerType": "esri-tile",
"url": "https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",
"opacity": 1
}
]
},
{
"id": "baseEsriWorld",
"name": "World Imagery",
"description": "World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide.",
"altText": "World Imagery",
"layers": [
{
"id": "World_Imagery",
"layerType": "esri-tile",
"url": "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
}
],
"tileSchemaId": "EXT_ESRI_World_AuxMerc_3857#LOD_ESRI_World_AuxMerc_3857",
"attribution": {
"text": {
"disabled": true
},
"logo": {
"disabled": true
}
}
}
],
"initialBasemapId": "baseEsriWorld"
},
"legend": {
"type": "structured",
"root": {
"name": "root",
"children": [
{
"layerId": "Salish_Sea_Boundaries"
}
]
}
},
"layers": [
{
"id": "Salish_Sea_Boundaries",
"name": "Salish Sea Boundaries",
"layerType": "esri-feature",
"url": "https://ecqcj8ywvwsd025.ncr.int.ec.gc.ca:6443/arcgis/rest/services/CWS-SCF_Storylines/TMXLocator/MapServer/0"
}
]
}
}
}
25 changes: 24 additions & 1 deletion public/00000000-0000-0000-0000-000000000000/styles/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
.textPanelOutline {
border: 2px solid black;
}
}

.right-align {
margin-left: auto !important;
margin-right: 10% !important;
max-width: 600px;
}

.img-zoomies {
margin: auto;
animation: zoom-in-zoom-out 8s ease infinite;
}

@keyframes zoom-in-zoom-out {
0% {
transform: scale(1);
}
50% {
transform: scale(2);
}
100% {
transform: scale(1);
}
}
Loading

0 comments on commit 33bbde8

Please sign in to comment.