Skip to main content
100%

Basic Weather Fronts - markers along topojson lines

✓ Published0🌍 Public
Aandrew-reid
Last edited Oct 14, 2016
Created on Oct 14, 2016

Four semi-transparent weather fronts are drawn as thick black paths over a Kavrayskiy VII-projected world map, with graticule and country boundaries. Each front is decorated with repeated SVG markers—semicircles or triangles—that are placed along the path length using `getPointAtLength()`. The marker style alternates by line index, simulating warm and cold front symbols, and the markers are oriented automatically along each front.

AI-generated description

Just a basic attempt to create front symbology on topojson lines. The implementation could be much better. For example, by taking three points along the line where markers are to be added, a marker that accounts for the general shape of the curve could be used, minimizing the problem of one marker for all curves types. Four markers are used here, two for each of cold and warm fronts. Two so that the direction of the marker can be clear. All four are shown here, but I changed my drawing direction halfway through making the lines, so both warm fronts and both cold fronts appear to point in the same direction.

Used Dustin Larimer's block to get started, though a stack overflow question got me going further with getting the points along the line.

Similar vizzes