A transformer strategy is an interface used by the CoordinateTransformer to forward the transformation to a specific implementation.

In your manifest.json:

"components": [{
"name": "MyCustomTransformerStrategy",
"provides": "coordinatetransformer.CustomTransformerStrategy"
}]

In your code (MyCustomTransformerStrategy.ts):

export default class MyCustomTransformerStrategy implements TransformerStrategy {
transform(
geometry: Items<Geometry>,
sourceSRS: SpatialReference,
targetSRS: SpatialReference
): Items<Geometry> | Promise<Items<Geometry>> {
// pseudo code
return transformation(sourceSRS, targetSRS).transform(geometry);
}
}
interface TransformerStrategy {
    transform(
        geometry: any,
        sourceSRS: SpatialReference,
        targetSRS: SpatialReference,
    ): any;
}

Methods

Methods

  • Transforms a geometry.

    Parameters

    • geometry: any

      input geometry

    • sourceSRS: SpatialReference

      source spatial reference system

    • targetSRS: SpatialReference

      target spatial reference system

    Returns any

    The transformed geometry (if input was an array, output will be an array of transformed geometries). The types of the geometries must stay the same.

MMNEPVFCICPMFPCPTTAAATR