-
Notifications
You must be signed in to change notification settings - Fork 162
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
try proj4leaflet to support projection in /map
viewer
#560
Conversation
'{{ tms.crs.to_proj4() }}', { | ||
origin: [{{ tms.xy_bbox[0] }}, {{ tms.xy_bbox[3] }}], | ||
// bounds: [[{{ tms.xy_bbox[0] }}, {{ tms.xy_bbox[1] }}], [{{ tms.xy_bbox[2] }}, {{ tms.xy_bbox[3] }}]], | ||
resolutions: {{ resolutions|safe }}, |
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.
It seems to work but it needs more testing
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.
I'm not sure if resolutions
is https://github.com/developmentseed/morecantile/blob/main/morecantile/models.py#L370-L379
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.
So this is a bit tricky. I'll quote myself from https://gis.stackexchange.com/a/423647/53755 :
The result of
L.CRS.scale()
has to be multiplied by a CRS-dependant constant (the world bounds according to that CRS) in order to make the numbers meaningful, which IMO leads to confusion.
So you have to be careful about the CRS's bounds, specially if you plan on using TMS-style tiles with an inverted Y-coordinate (a {-y}
in the URL template). Specifically, see https://stackoverflow.com/a/62625435/4768502
See also https://gis.stackexchange.com/a/310124/53755 - Don't be confused when using Leaflet's functions for projecting/unprojecting coordinates because they don't rely on CRS-relative numbers, but rather screen-relative numbers.
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.
Thanks for you help @IvanSanchez
going back at this today, and I'm not quite sure I understand all of ☝️ 😭
/map
viewer
…nto mapViewerLeafletTMS
data.tiles[0], { | ||
minZoom: data.minzoom, | ||
maxZoom: data.maxzoom, | ||
bounds: L.latLngBounds([bottom, left], [top, right]), |
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.
I don't think you want to do this - the bounds
option on a L.Tilelayer
is a constraint, so the tilelayer will load less tiles. It's not an informative field.
Focus on getting the bounds
of the Leaflet CRS
right - tilelayers will work throughout that range, and only throughout that range.
🥳 adding the markers really help 🙏 @IvanSanchez |
Alright everything seems to work well 🥳 notes:
|
closes #559