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

More realistic canvas gradient/pattern example #15095

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mike-000
Copy link
Contributor

@mike-000 mike-000 commented Sep 8, 2023

The current Canvas Gradient example looks strange from user's perspective, the gradient appears at seemingly arbitrary positions depending on the view center and resolution and does not align consistently with the features which are sometimes all red or all purple. Repeating patterns based on real data would make a more realistic example.

https://deploy-preview-15095--ol-site.netlify.app/en/latest/examples/canvas-gradient-pattern.html

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

📦 Preview the website for this branch here: https://deploy-preview-15095--ol-site.netlify.app/.

@mike-000 mike-000 marked this pull request as ready for review September 8, 2023 13:27
@tschaub
Copy link
Member

tschaub commented Sep 9, 2023

The current Canvas Gradient example looks strange from user's perspective

I agree. And I was hopeful when I read this. If we can’t come up with a sensible looking example for a feature, then I think it is worth questioning the value of the feature.

Then I clicked on the example linked above

image

Perhaps this is a matter of taste, but I found this example somewhat shocking. I don’t think this qualifies as “a more realistic example.” I can say I have never seen anything like it actually.

@ahocevar
Copy link
Member

"More realistic", in my opinion, would be something like different hatches for different attribute values, or a solid color and a hatch depending on an attribute value. Both would be a pattern rather than a gradient, but hey, that's also more realistic, no?

@mike-000
Copy link
Contributor Author

mike-000 commented Oct 23, 2023

A gradient alone does not render well as it can be randomly positioned, so both options in the example are patterns containing gradients, allowing two properties of a feature to be represented in a single fill.

Hatched patterns (single color plus transparent) for a single property are supported in styles for the ArcGIS REST Feature service

image

https://www.arcgis.com/apps/mapviewer/index.html?url=https://services1.arcgis.com/RbMX0mRVOFNTdLzd/ArcGIS/rest/services/hosted_symbology_test/FeatureServer/0

and those could be replicated in OpenLayers https://codesandbox.io/s/vector-esri-forked-3ly3ry?file=/main.js

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.

None yet

3 participants