Skip to content

Commit

Permalink
Merge pull request #258 from CityOfDetroit/feature.257
Browse files Browse the repository at this point in the history
Adding zoom controls to layers in map component.
  • Loading branch information
jedgar1mx authored Aug 15, 2024
2 parents 9c51fc9 + 0e80eb8 commit 84b2df1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/assets/js/main.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/components/organisms/Map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ export default class Map extends HTMLElement {
case 'line':
tmpLayer.type = layer.type;
tmpLayer.source = layer.source;
layer.minZoom ? (tmpLayer.minzoom = layer.minZoom) : 0;
layer.maxZoom ? (tmpLayer.maxzoom = layer.maxZoom) : 0;
layer.active
? (tmpLayer.layout = { visibility: 'visible' })
: (tmpLayer.layout = { visibility: 'none' });
Expand All @@ -346,6 +348,8 @@ export default class Map extends HTMLElement {
case 'text':
tmpLayer.type = 'symbol';
tmpLayer.source = layer.source;
layer.minZoom ? (tmpLayer.minzoom = layer.minZoom) : 0;
layer.maxZoom ? (tmpLayer.maxzoom = layer.maxZoom) : 0;
layer.filter ? (tmpLayer.filter = layer.filter) : 0;
layer.active
? (tmpLayer.layout = {
Expand All @@ -368,6 +372,8 @@ export default class Map extends HTMLElement {
tmpLayer.type = layer.type;
tmpLayer.source = layer.source;
tmpLayer.clickable = layer.clickable;
layer.minZoom ? (tmpLayer.minzoom = layer.minZoom) : 0;
layer.maxZoom ? (tmpLayer.maxzoom = layer.maxZoom) : 0;
layer.filter ? (tmpLayer.filter = layer.filter) : 0;
layer.active
? (tmpLayer.layout = { visibility: 'visible' })
Expand All @@ -385,6 +391,8 @@ export default class Map extends HTMLElement {
tmpLayer.type = layer.type;
tmpLayer.source = layer.source;
tmpLayer.clickable = layer.clickable;
layer.minZoom ? (tmpLayer.minzoom = layer.minZoom) : 0;
layer.maxZoom ? (tmpLayer.maxzoom = layer.maxZoom) : 0;
layer.filter ? (tmpLayer.filter = layer.filter) : 0;
layer.active
? (tmpLayer.layout = { visibility: 'visible' })
Expand Down
11 changes: 11 additions & 0 deletions src/stories/map.stories.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 84b2df1

Please sign in to comment.