-
-
Notifications
You must be signed in to change notification settings - Fork 754
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 example using addProtocol to transform vector tile feature properties #5370
Add example using addProtocol to transform vector tile feature properties #5370
Conversation
@wipfli, check this out. This is how I solved the problem using addProtocol. I believe this is cleaner than our other approach. I'm curious to hear what you think! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5370 +/- ##
==========================================
+ Coverage 91.84% 91.95% +0.10%
==========================================
Files 282 282
Lines 38908 38908
Branches 6827 6820 -7
==========================================
+ Hits 35735 35777 +42
+ Misses 3046 3003 -43
- Partials 127 128 +1 ☔ View full report in Codecov by Sentry. |
hash: 'map' | ||
}); | ||
|
||
map.setTransformRequest((url, resourceType) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this return something in "regular" cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a request transform doesn't return, or returns undefined/null, then nothing happens and the original request parameters are used. I can add the return undefined
to be clear though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very nice examples!
It would be interesting to see how this example can be done in a worker thread instead of the main thread, but this is a "nice to have". |
Amazing, thanks for writing this example @neodescis. It great to see how this works with add protocol, and also it is interesting to have now an example which uses |
Provides an example of how to solve #4198 using addProtocol.
IMO, this should be favored over #5343 and #4199.
Launch Checklist
CHANGELOG.md
under the## main
section.