sakitam-fdd / wind-layer

:flags: :rocket: wind-layer | a openlayers && maptalks && amap && bmap && leaflet && mapbox-gl && maplibre-gl extension like windy.com for weather visualization
https://sakitam-fdd.github.io/wind-layer/
Other
542 stars 145 forks source link

fix contains method #208

Closed PetyaOgurkin closed 6 months ago

PetyaOgurkin commented 6 months ago

Will allow to set extents on the border between longitude 180 and -180 in polar projections and will not clip the layer

sakitam-fdd commented 6 months ago

@PetyaOgurkin Thank you for your work, I don't currently understand the intent of this logic, can you explain exactly what scenario you are running into the problem in question? I understand that our data is generally in the range of -180 - 180 or 0 - 360.

I understand that you need to address scenarios that are not in the above data range eg 180 - 540

image

I don't know if I'm understanding you correctly.

PetyaOgurkin commented 6 months ago

This is relevant, for example, for Russia or New Zealand. I have data with extents minLat = 41, maxLat = 82, minLong = 19, maxLong = 192/-168, which I use in the polar projection EPSG:3576.

I tried setting extents in different ways and setting different settings, but I couldn’t achieve the desired result.

With default settings: simple

translateX: false translatex

wrapX: true wrapx

And with my changes: patch