-
Notifications
You must be signed in to change notification settings - Fork 81
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
[fix] Set default value for maxZoom and limit maxZoom option #242
Conversation
The issue of empty responses from the tile server when zooming in beyond the supported zoom level has been addressed by setting the default maxZoom level to 12. This change ensures that tiles are displayed up to the supported zoom level. If a different default maxZoom level is desired, it can be modified by adjusting the value of . Closes #188
The issue of empty responses from the tile server when zooming in beyond the supported zoom level has been addressed by setting the default maxZoom level to 12. This change ensures that tiles are displayed up to the supported zoom level. If a different default maxZoom level is desired, it can be modified by adjusting the value of . Closes #188
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.
self.bboxData = { | ||
nodes: [], | ||
links: [], | ||
}; |
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 understand what are these lines for?
}, | ||
}); | ||
|
||
self.bboxData = { |
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.
what's this for?
// Add the following lines to set the default maxZoom and make it configurable | ||
self.config.maxZoom = self.config.maxZoom || 12; | ||
|
||
if (self.type === "netjson") { |
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.
there's already some identical if
statements below, why are you adding more?
Beware of copy pasta code.
@nemesifier I apologize for any inconvenience caused. I will make an effort to address the issue promptly. There were certain lines that I didn’t fully comprehend, so I copied them. However, I am committed to resolving this matter as soon as possible. |
I initially believed that I needed to replicate the function which is mentioned and simply add the following line. and I resolved the zoom level issue using this formula: |
[fix] Set default value for maxZoom and limit maxZoom option
This commit addresses the issue of limiting the maximum zoom level. The following changes have been made:
self.config.maxZoom = self.config.maxZoom || 12;
maxZoom
option of Leaflet to the value ofself.config.maxZoom
:options.maxZoom = self.config.maxZoom;
Closes #188