react-leaflet icon indicating copy to clipboard operation
react-leaflet copied to clipboard

How to custom the request header in TileLayer ?

Open IHsunChen opened this issue 2 years ago • 1 comments

I have searched google and did not find any usable answer. Can someone help me ?

IHsunChen avatar Jun 05 '23 11:06 IHsunChen

From the source code perspective of LeafLet Tilelayer, which extends Gridlayer, the tileLayer request is sent via the img HTML tag with its src property as the request's url. you can create a class extends the tileLayer and overrides TileLayer's createTile().

Notion: You're trying to do X, and you thought of solution Y. So you're asking about solution Y, without even mentioning > X. The problem is, there might be a better solution, but we can't know that unless you describe what X is, see "X Y problem"

AhXianGL avatar Jul 05 '23 03:07 AhXianGL