* Render Polyline to SVG
(line)
| 403 | * Render Polyline to SVG |
| 404 | */ |
| 405 | lineToSVG(line) { |
| 406 | const points = line.coords.map((coord) => [ |
| 407 | this.xToPx(geoutils.lonToX(coord[0], this.zoom)), |
| 408 | this.yToPx(geoutils.latToY(coord[1], this.zoom)), |
| 409 | ]); |
| 410 | return `<${(line.type === 'polyline') ? 'polyline' : 'polygon'} |
| 411 | style="fill-rule: inherit;" |
| 412 | points="${points.join(' ')}" |
| 413 | stroke="${line.color}" |
| 414 | fill="${line.fill ? line.fill : 'none'}" |
| 415 | stroke-width="${line.width}"/>`; |
| 416 | } |
| 417 | |
| 418 | /** |
| 419 | * Draw markers to the basemap |
no test coverage detected