# General Information
GeoToolkit.JS provides a rich and extensible API to be used to build complex displays. Libraries are provided in obfuscated view. Obfuscation is process of the modifying code or data to protect software from reverse engineering and protect intellectual property. It is done by making code difficult to understand and making the code appear unreadable and scrambled. All public API is available to be used and internally it maps to obfuscated version.
# How to extend class
If it is necessary to extend any GeoToolkit class and override existing methods, mapping between public API and obfuscated version should be applied. Toolkit provides function obfuscate to apply this process to any extended GeoToolKit class.
import {obfuscate} from '@int/geotoolkit/lib';
import {Shape} from '@int/geotoolkit/scene/shapes/Shape';
import {RenderingContext} from '@int/geotoolkit/renderer/RenderingContext';
import {SetClassName} from '@int/geotoolkit/decorators';
@SetClassName('MyShape')
export class MyShape extends Shape {
constructor () {
super();
}
public override render (context: RenderingContext) {
}
}
obfuscate(MyShape);Usage of decorator SetClassName is optional. It provides a class name. Also it is possible to use decorator Obfuscate instead of calling obfuscate directly.
import {Shape} from '@int/geotoolkit/scene/shapes/Shape';
import {RenderingContext} from '@int/geotoolkit/renderer/RenderingContext';
import {SetClassName, Obfuscate} from '@int/geotoolkit/decorators';
@SetClassName('MyShape')
@Obfuscate()
export class MyShape extends Shape {
constructor () {
super();
}
public override render (context: RenderingContext) {
}
}