A ThreeJS geometry class for stroking GeoJSON objects on a sphere.
import { GeoJsonGeometry } from 'three-geojson-geometry';
or using a script tag
<script src="https://github.com/vasturiano/three-geojson-geometry/raw/master//unpkg.com/three-geojson-geometry"></script>
then
const myLine = new THREE.Line(
new GeoJsonGeometry(geoJson),
new THREE.LineBasicMaterial({ color: 'blue' })
);
GeoJsonGeometry(geoJson: GeoJson object, radius: Float, resolution: Float)
geometry
object. It's recommended to split the geometries at the anti-meridian.1
.5
..parameters: Object
An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
When generating Polygon
or MultiPolygon
geometries, two groups are provided to which different materials can be applied.
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