-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add Leaflet maxZoom to configParameters #7294
base: main
Are you sure you want to change the base?
Add Leaflet maxZoom to configParameters #7294
Conversation
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 the change @glughi.
I have made a couple of comments.
@@ -103,6 +103,7 @@ export default class Leaflet extends GlobeOrMap { | |||
clippingRectangle: Rectangle | undefined | |||
) => GridLayer = computedFn((ip, clippingRectangle) => { | |||
const layerOptions = { | |||
maxZoom: this.terria.configParameters.leafletMaxZoom, |
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 think, because this is a map level config, it is better to pass it to the Map
instance created here:
terriajs/lib/Models/Leaflet.ts
Lines 149 to 155 in 676d1d8
this.map = L.map(container, { | |
zoomControl: false, | |
attributionControl: false, | |
zoomSnap: 1, // Change to 0.2 for incremental zoom when Chrome fixes canvas scaling gaps | |
preferCanvas: true, | |
worldCopyJump: false | |
}).setView([-28.5, 135], 5); |
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.
Hi, as you can read in the documentation of Leaflet (https://leafletjs.com/reference.html#map-maxzoom) the MapOptions.maxZoom
property has no default limitations. The GridLayerOptions.maxZoom
property is set to 18 by default, so it is the one to change so that zoom greater than 18 can be used.
…com/bioretics/terriajs into add-configParameters-leafletMaxZoom
What this PR does
Related to #7280
Add "leafletMaxZoom" to configParameters so that the maxZoom of the Leaflet viewer can be changed.
Test me
How should reviewers test this? (Hint: If you want to provide a test catalog item, create a Gist of its catalog JSON, add its url and your branch name to this url:
http://ci.terria.io/<branch name>/#clean&<raw url of your gist>
, and then paste that in the body of this PR)Checklist
doc/
.