-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update rendering after addImage and removeImage (#9016)
fix #9004 A tile needs to be reparsed in order for it to use the new image. Reloading all tiles whenever an image is added would be expensive. For example: - load a map - add an image and use it in a geojson overlay You don't want adding that image to make the basemap tiles be reloaded. To get around that we track all the image ids used by each tile and only reload tiles that depend on images that changed.
- Loading branch information
Showing
9 changed files
with
212 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+193 Bytes
test/integration/render-tests/runtime-styling/image-add-remove-add/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions
52
test/integration/render-tests/runtime-styling/image-add-remove-add/style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"width": 64, | ||
"height": 64, | ||
"operations": [ | ||
[ | ||
"addImage", | ||
"marker", | ||
"./sprites/1x.png" | ||
], | ||
[ | ||
"addLayer", | ||
{ | ||
"id": "geometry", | ||
"type": "symbol", | ||
"source": "geometry", | ||
"layout": { | ||
"icon-image": "marker" | ||
} | ||
} | ||
], | ||
[ | ||
"wait" | ||
], | ||
[ | ||
"removeImage", | ||
"marker" | ||
], | ||
[ | ||
"addImage", | ||
"marker", | ||
"./sprites/dark.png" | ||
], | ||
[ | ||
"wait" | ||
] | ||
] | ||
} | ||
}, | ||
"sources": { | ||
"geometry": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "Point", | ||
"coordinates": [0, 0] | ||
} | ||
} | ||
}, | ||
"layers": [] | ||
} |
Binary file added
BIN
+4.43 KB
test/integration/render-tests/runtime-styling/pattern-add-remove-add/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions
52
test/integration/render-tests/runtime-styling/pattern-add-remove-add/style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"width": 64, | ||
"height": 64, | ||
"operations": [ | ||
[ | ||
"addImage", | ||
"marker", | ||
"./sprites/dark.png" | ||
], | ||
[ | ||
"addLayer", | ||
{ | ||
"id": "geometry", | ||
"type": "fill", | ||
"source": "geometry", | ||
"paint": { | ||
"fill-pattern": "marker" | ||
} | ||
} | ||
], | ||
[ | ||
"wait" | ||
], | ||
[ | ||
"removeImage", | ||
"marker" | ||
], | ||
[ | ||
"addImage", | ||
"marker", | ||
"./sprites/1x.png" | ||
], | ||
[ | ||
"wait" | ||
] | ||
] | ||
} | ||
}, | ||
"sources": { | ||
"geometry": { | ||
"type": "geojson", | ||
"data": { | ||
"type": "Polygon", | ||
"coordinates": [[[-180, 80], [180, 80], [180, -80], [-180, -80]]] | ||
} | ||
} | ||
}, | ||
"layers": [] | ||
} |