-
Notifications
You must be signed in to change notification settings - Fork 196
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
Prevent uneccessary tile requests going out and being processed on response #151
Conversation
docs/demo-vectortiles.html
Outdated
<script type="text/javascript" src="../src/Leaflet.VectorGrid.Protobuf.js"></script>--> | ||
<script type="text/javascript" src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> | ||
<!-- <script src="https://unpkg.com/leaflet.vectorgrid@1.2.0"></script> --> | ||
<script type="text/javascript" src="./../dist/Leaflet.VectorGrid.bundled.js"></script> |
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.
Please note that this will fail "in production", i.e. when merged into the master
branch and when a new build is released.
docs/demo-vectortiles.html
Outdated
<script type="text/javascript" src="../src/Leaflet.Renderer.Canvas.Tile.js"></script> | ||
<script type="text/javascript" src="../src/Leaflet.VectorGrid.js"></script> | ||
<script type="text/javascript" src="../src/Leaflet.VectorGrid.Protobuf.js"></script>--> | ||
<script type="text/javascript" src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> |
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.
Upgrade to Leaflet 1.3.1 while we're at it?
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.
Try using tile.current
instead of the zoom level check, see https://github.com/Leaflet/Leaflet/blob/c7b5d1deba83ec9176c849ce71c85f27884a6280/src/layer/tile/GridLayer.js#L679
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.
LGTM
} | ||
} | ||
|
||
if (styleOptions instanceof Function) { | ||
styleOptions = styleOptions(feat.properties, coords.z); |
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.
feat.type
argument missed. See #130 (comment)
Also stop doing unnecessary work for responses that come back for tiles on previous zoom levels.