multiPolygonToSvgPath
Chart
stable
Converts a multi-polygon (array of [lng, lat] polygon arrays) into a single SVG path string with multiple M…Z subpaths. Each polygon is projected via mercatorProject.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- multirequisArray<Array<[number, number]>>
- Multi-polygon data: outer array is a list of polygons, each polygon is an array of [lng, lat] geographic pairs.
- widthnumber1000
- SVG canvas width in pixels.
- heightnumber500
- SVG canvas height in pixels.
API
Valeur de retour
La valeur retournée par cet util.
- A single SVG d attribute string containing one closed M…Z subpath per polygon, separated by spaces.
Usage
Exemples
Extraits de code prêts à coller.
Render a country on an SVG map