Skip to content

bgx1012/leaflet-polygon-fillPattern-canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

leaflet-polygon-fillPattern-canvas

Extend the Polygon Object to fill canvas element with an image pattern. Performance is better than svg rendering. Can improve the rendering performance of big data.

Usage example

//<div id="map"></div>
//<img id="lamp" style="display:none;" src="./fill.gif">

var map = L.map("map", {
  preferCanvas: true,
}).setView([23.7, 121], 8);

var poly1 = [
  [24, 121],
  [24.5, 121],
  [25.5, 121],
  [25.5, 124],
  [24.5, 121.9],
  [24, 121.9],
];
L.polygon(poly1, { imgId: "lamp" }).addTo(map);

geojson

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published