简体   繁体   English

单张中的多边形背景纹理

[英]Polygon Background Texture in Leaflet

I am working on a mobile application with leaflet 1.0. 我正在使用带有传单1.0的移动应用程序。 The map contains many differently shaped polygons and I want to give them a texture via PNG-Files. 该地图包含许多形状不同的多边形,我想通过PNG文件为它们提供纹理。

Leaflet's ImageOverlay does pretty much what I want except that it can't clip the image to the shape of the polygon. Leaflet的ImageOverlay几乎完成了我想要的操作,只是它无法将图像裁剪为多边形的形状。 ImageOverlays only accept imageUrls so I need to have the clipped image locally saved for every individual polygon. ImageOverlays仅接受imageUrl,因此我需要为每个单独的多边形在本地保存剪切的图像。 Is there a better approach for my problem? 我的问题有更好的方法吗?

请参阅插件列表中的“ Leaflet.pattern”插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM