measurer.Measurer
measurer.Measurer is the static utility object for measurers, providing the ability to obtain a measurer instance by its code. It is never instantiated; the Identity, WGS84Sphere, and BaiduSphere measurers are registered internally, and calling it without an argument returns the default measurer WGS84Sphere.
js
import { measurer } from "maptalks";
const m = measurer.Measurer.getInstance("EPSG:4326"); // WGS84Sphere
const d = measurer.Measurer.getInstance(); // the default WGS84SphereProperties / Static Methods
getInstance(name?): measurer— Return a measurer object by code.namecan be'EPSG:4326','IDENTITY', or'BAIDU'; without an argument the default measurer (WGS84Sphere) is returned, andnullis returned for an invalid code.
Methods
(No standalone instance methods; measurers are object mixins. Use the returned instance's measureLength / measureArea / locate / rotate methods.)