How to use the @turf/circle/index function in @turf/circle

To help you get started, we’ve selected a few @turf/circle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github w3reality / three-geo / examples / geo-viewer / src / map-helper.js View on Github external
const { projInv, unitsPerMeter } = this.projection;

        // add orbitMarker
        const target = orbit.userData.target;
        const llTarget = projInv(target.x, target.y);
        console.log('llTarget:', llTarget);

        this.orbitMarker =
            L.marker(llTarget)
                .bindTooltip("Orbit Axis", {
                    permanent: true,
                    direction: 'right',
                }).addTo(this.map);

        // add orbitCircle
        const circle = turfCircle(
            MapHelper.swap(llTarget),
            orbit.userData.radius / unitsPerMeter, {
                units: 'meters',
            });
        this.orbitCircle =
            L.geoJson(circle, {
                style: feature => {
                    return {
                        dashArray: '3, 5',
                        color: '#ff00ff',
                        fillOpacity: 0.0,
                    };
                },
            }).addTo(this.map);
    }

@turf/circle

turf circle module

MIT
Latest version published 3 months ago

Package Health Score

96 / 100
Full package analysis