Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add labels to municipal boundaries layer #61

Merged
merged 2 commits into from
Sep 14, 2022

Conversation

mstone121
Copy link
Contributor

@mstone121 mstone121 commented Sep 8, 2022

Overview

This PR adds labels to the municipal boundaries layer.

If the zoom level is less than 9, the labels are not shown as this gets too busy.
On the satellite basemap, the labels are white text instead of the default black.

Closes #49

Demo

Screen Shot 2022-09-08 at 9 49 59 AM

Screen Shot 2022-09-08 at 9 50 06 AM

Testing Instructions

  • Go to draw map page
  • Enable municipal boundaries layer
  • Zoom in past zoom level 9
  • Labels should be present
  • Switch to satellite basemap
  • The labels should now be white text

Checklist

  • fixup! commits have been squashed
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines
  • README.md updated if necessary to reflect the changes
  • CI passes after rebase

@rajadain
Copy link
Contributor

Taking a quick look

@rajadain rajadain self-requested a review September 12, 2022 21:37
@rajadain rajadain self-assigned this Sep 12, 2022
@rajadain
Copy link
Contributor

I like the implementation, it's neat and clean.

One idea I had was to use the darkest and lightest purple for the labels, instead of black and white, to make the labels visually associate more with the layer.

But also, I wanted to record what the labels look like:

2022-09-12.17.56.35.mp4

and ask the UX folks, is this okay? Are there any styling changes you would recommend? /cc @gatesgodin @caseycesari

@gatesgodin
Copy link

The labels look great to me. The labels might need a thicker white stroke when on the satellite view for legibility. @rajadain

@rajadain
Copy link
Contributor

Let's go with this:

.muni-label {
    background: rgba(255, 255, 255, 0);
    border: 0;
    border-radius: 0px;
    box-shadow: 0 0px 0px;
    font-weight: bold;
    font-size: var(--chakra-fontSizes-sm);
    color: var(--chakra-colors-purple-900);
    text-shadow: 0 0 0.2em var(--chakra-colors-purple-50), 0 0 0.2em var(--chakra-colors-purple-50);
}

.muni-label-light {
    color: var(--chakra-colors-purple-50);
    text-shadow: 0 0 0.2em var(--chakra-colors-purple-900), 0 0 0.2em var(--chakra-colors-purple-900);
}

The text-shadow adds a darker / lighter blur behind the text that makes it stand out more. The shadow is specified twice for a stronger effect. Still pretty subtle, can't really see it unless you look for it. The larger font size also helps with the legibility.

image

image

image

@mstone121
Copy link
Contributor Author

@rajadain Good idea. Update here 3b9b071.

@caseycesari
Copy link
Contributor

That looks good to me too!

Copy link
Contributor

@rajadain rajadain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@mstone121 mstone121 merged commit be26c3c into develop Sep 14, 2022
@mstone121 mstone121 deleted the ms/add-muni-layer-labels branch September 14, 2022 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update map layer styles
4 participants