@tomhughes commented on this pull request.
> }
function showSearchResult() {
- let marker = $(this).data("marker");
-
- if (!marker) {
- const data = $(this).find("a.set_position").data();
-
- marker = L.marker([data.lat, data.lon], { icon: OSM.getMarker({}) });
-
- $(this).data("marker", marker);
- }
-
+ const index = processedResults++;
+ const listItem = $(this);
+ const color = `hwb(${(index * (Math.sqrt(5) - 1) * 180) % 360}deg 5% 5%)`;
This actually appears to be the reciprocal of the golden angle (~222.5 degrees)
not the golden angle (~137.5 degrees) at least according to
https://en.wikipedia.org/wiki/Golden_angle?
The golden angle would be:
```suggestion
const color = `hwb(${(index * (3 - Math.sqrt(5) ) * 180) % 360}deg 5% 5%)`;
```
Possibly that calculation should be pulled out to a `goldenAngle` variable that
is then used in the template, as a way of documenting what we're doing?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6235#pullrequestreview-3059438187
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6235/review/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev