ted-piotrowski / shademap-examples

Use cases for ShadeMap API
5 stars 0 forks source link

Every point in the sun in Route.html #1

Open reasy19 opened 3 weeks ago

reasy19 commented 3 weeks ago

In the exmple Route.html every single drop point appers to think it's in the sun, i.e. it is giving the white pin drop not the black one. Despite clearly some of them being in the shade as you can see the shadows. Not only that but if you set it to night time where everything should be in the shade still all the points seem to be in the sun.

This is also an issue I am finding when trying to use the code in similar senarios. It seems the

shadeMap._generateShadeProfile({ locations, dates, sunColor: [255, 255, 255, 255], shadeColor: [0, 0, 0, 255] });

Method has a bug where it thinks everypoint is in the sun.

Not sure if this is a bug on Shade Map's end or I am using shadeMap._generateShadeProfile inccorectly.

ted-piotrowski commented 3 weeks ago

Thanks for reaching out. The undocumented APIs of mapbox-gl-shadow-simulator are only compatible with mapbox-gl-js version 3.0+. This is due to Mapbox GL JS adopting WebGL 2.0 in that release. I've updated the Mapbox GL JS version in the examples and they now work as expected. Let me know if this resolves your issue.

reasy19 commented 3 weeks ago

Yep, thanks this seems to have fixed the issue.