Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

three-geojson-geometry

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-geojson-geometry

ThreeJS geometry for stroking GeoJSON objects on a sphere

  • 1.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
increased by22.33%
Maintainers
0
Weekly downloads
 
Created
Source

ThreeJS GeoJSON Geometry

NPM package Build Size NPM Downloads

A ThreeJS geometry class for stroking GeoJSON objects on a sphere.

Quick start

import { GeoJsonGeometry } from 'three-geojson-geometry';

or using a script tag

<script src="//unpkg.com/three-geojson-geometry"></script>

then

const myLine = new THREE.Line(
  new GeoJsonGeometry(geoJson),
  new THREE.LineBasicMaterial({ color: 'blue' })
);

API reference

Constructor

GeoJsonGeometry(geoJson: GeoJson object, radius: Float, resolution: Float)

  • geoJson: A GeoJson geometry object. It's recommended to split the geometries at the anti-meridian.
  • radius: Radius of the sphere surface to draw the poygon on. Default is 1.
  • resolution: Resolution of the sphere, in lat/lng degrees. If the distance between two adjacent line points is larger than this value, the line segment will be interpolated in order to approximate the curvature of the sphere surface. Lower values yield more perfectly curved lines, at the cost of performance. Default is 5.

Properties

.parameters: Object

An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.

Groups

When generating Polygon or MultiPolygon geometries, two groups are provided to which different materials can be applied.

  • 0: The outer ring of the polygon.
  • 1: The polygon inner holes (if any).

Object types

Different geoJson types should be represented using different ThreeJS object types:

  • Point and MultiPoints - Use THREE.Points
  • LineString and Polygon - Use THREE.Line
  • MultiLineString and MultiPolygon - Use THREE.LineSegments

Keywords

FAQs

Package last updated on 04 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc