Skip to content

feat: add property to show fill color for geojson#64

Merged
jessicamcinchak merged 1 commit intomainfrom
jess/geojson-fill
Oct 1, 2021
Merged

feat: add property to show fill color for geojson#64
jessicamcinchak merged 1 commit intomainfrom
jess/geojson-fill

Conversation

@jessicamcinchak
Copy link
Copy Markdown
Member

@jessicamcinchak jessicamcinchak commented Sep 30, 2021

Closes #63

When geojsonFill is true/present, it assumes your fill color is your stroke color with 20% opacity. This is pretty consistent with drawing style defaults! It's false by default, so geojson data will still display with only a border color by default.

Example:

<my-map geojsonColor="#286e8a" geojsonFill />
<script>
  const map = document.querySelector("my-map");
  map.geojsonData = {
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -0.11562466621398924,
                51.50746034612789
              ],
              [
                -0.11449813842773436,
                51.50617151942102
              ],
              [
                -0.11359691619873047,
                51.50653212745768
              ],
              [
                -0.11348962783813477,
                51.50645199258505
              ],
              [
                -0.1127493381500244,
                51.50665900738443
              ],
              [
                -0.11383295059204103,
                51.507907754128546
              ],
              [
                -0.11562466621398924,
                51.50746034612789
              ]
            ]
          ]
        }
      }
    ]
  };

Screenshot from 2021-09-30 14-57-10

@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 30, 2021

✔️ Deploy Preview for oslmap ready!

🔨 Explore the source changes: a4c5c13

🔍 Inspect the deploy log: https://app.netlify.com/sites/oslmap/deploys/6155b7be6abeaf00081e681a

😎 Browse the preview: https://deploy-preview-64--oslmap.netlify.app

@jessicamcinchak
Copy link
Copy Markdown
Member Author

@jessicamcinchak jessicamcinchak requested review from a team and melzreal September 30, 2021 13:15
Copy link
Copy Markdown
Contributor

@gunar gunar left a comment

Choose a reason for hiding this comment

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

Looks great!

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.

Allow for transparent fill colors of static geojson shapes as well as stroke color

2 participants