Skip to content

Avoiding Duplicate Features in Extended TileLayer rendering GeoJsonLayer #8790

Closed Answered by Pessimistress
kolpav asked this question in Q&A
Discussion options

You must be logged in to vote

The basic idea of the TileLayer is that you do not fetch or display data that is out of view. This means that you never return the whole feature when it spans multiple tiles. You are supposed to crop that feature and only return the portion that overlaps with the given bounding box.

Well, that is easier said than done, with a few catches here and there. The generation of tiles is most commonly done on a server, and transmitted with a protocol other than GeoJSON, for example, check out the MVTLayer which extends TileLayer to handle the MVT tile format. If you have to do the tile slicing on the client side, there are tools like geojson-vt. I put together a simple demo here.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kolpav
Comment options

Answer selected by kolpav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants