extendsGeoJSONLoader
Loader and parser for the WKT format. The contents are converted to GeoJSON using the betterknown package and then parsed with the GeoJSONLoader parse function.
import { MeshNormalMaterial } from 'three';
import { WKTLoader } from 'three-geojson';
// scene, camera and renderer are initialized here
const URL = 'https://raw.githubusercontent.com/gkjohnson/three-geojson/main/example/california.wkt';
const result = await new WKTLoader().loadAsync( URL );
const mesh = result.polygons[ 0 ].getMeshObject( { thickness: 1 } );
mesh.material = new MeshNormalMaterial();
mesh.scale.setScalar( 0.3 );
mesh.rotation.x = - Math.PI / 2;
mesh.position.set( 0, 0, 0 );
scene.add( mesh );Methods
loadAsync( url: string ): Promise<GeoJSONResult>Loads and parses a WKT file.
parse( text: string ): GeoJSONResultParses WKT content.
Inherited
From GeoJSONLoader
- Properties