[openstreetmap/openstreetmap-website] Use MapLibre class extensions to DRY code (PR #6726)
Frank Elsinga
notifications at github.com
Mon Jan 19 20:39:31 UTC 2026
@CommanderStorm approved this pull request.
If you want to abstract this away, I can adjust the rest of the code I wrote.
Do note that for the abstractions you are writing there are no docs anywhere, which will be harder for other developers without reading your code over time.
There is a cost to doing it this way, but if you are willing to pay that "weirdness" tax, then that is fine.
> + const rotationOptions = {};
+ if (allowRotation === false) {
+ Object.assign(rotationOptions, {
+ rollEnabled: false,
+ dragRotate: false,
+ pitchWithRotate: false,
+ bearingSnap: 180
+ });
I would argue against API abstractions like this, since without any documentation how the code works this is otherwise reasonably hard to think about what is actually happening.
This rails thingy with the weird not quite working imports where one never knows what code runs where and where it comes from is already a high bar, no need to be even more weird.
Your call though, if you want your world to look like this, I am the last person to stop you.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6726#pullrequestreview-3679545290
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6726/review/3679545290 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260119/b265a39d/attachment.htm>
More information about the rails-dev
mailing list