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
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- multirequiredArray<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
Return value
The value returned by this util.
- A single SVG d attribute string containing one closed M…Z subpath per polygon, separated by spaces.
Usage
Examples
Ready-to-paste usage snippets.
Render a country on an SVG map