SpatialServer / Leaflet.MapboxVectorTile

A Leaflet Plugin that renders Mapbox Vector Tiles on HTML5 Canvas.
Other
299 stars 95 forks source link

How to handle points at tile boundaries #38

Open rimig opened 9 years ago

rimig commented 9 years ago

Hey all,

I'm struggling with how to handle points that straddle a tile boundary after adding a >1px radius. I think I understand what's going on here. The tile canvas that has the center of the point has no way to draw the complete point and there is no mechanism to inform adjacent tiles that they should draw the rest of the point (the part that bleeds over).

What's the thought on how to handle this? Any options besides smaller points?

Here's an example of how I'm hitting this, notice the points near the tile borders are cut off.

pointboundaries

I see that the confetti example has this as well but just masks it with smaller points based on zoom... https://github.com/SpatialServer/Leaflet.MapboxVectorTile/blob/master/examples/confetti.js#L71

Unfortunately I need larger points so am hoping to figure out a way to handle this. Curious if anyone has ideas on what to do here.

Thanks, Rob

hallahan commented 9 years ago

Yes. There is a parameter in MapboxStudio / Mapnik where you can specify the tile buffer size. You want to increase that so there is a little bit of overlap of the data in the tile. I know the default is in Mapbox Studio. In your situation, if you have a larger tile buffer, that point will be in both tiles, and this library will indeed properly render the circle for each tile's canvas.