{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab"]},"type":"markdown"},"seo":{"title":"How to Extend API","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"how-to-extend-api","__idx":0},"children":["How to Extend API"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"general-information","__idx":1},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/pages/extendAPI#intro"},"children":["#"]}," General Information"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"how-to-extend-class","__idx":2},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/pages/extendAPI#example"},"children":["#"]}," How to extend class"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["obfuscate"]}," to apply this process to any extended GeoToolKit class."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"main","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"import {obfuscate} from '@int/geotoolkit/lib';\nimport {Shape} from '@int/geotoolkit/scene/shapes/Shape';\nimport {RenderingContext} from '@int/geotoolkit/renderer/RenderingContext';\nimport {SetClassName} from '@int/geotoolkit/decorators';\n\n@SetClassName('MyShape')\nexport class MyShape extends Shape {\n    constructor () {\n        super();\n    }\n    public override render (context: RenderingContext) {\n    }\n}\nobfuscate(MyShape);\n","lang":"ts"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Usage of decorator ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SetClassName"]}," is optional. It provides a class name. Also it is possible to use decorator ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Obfuscate"]}," instead of calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["obfuscate"]}," directly."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"main","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"import {Shape} from '@int/geotoolkit/scene/shapes/Shape';\nimport {RenderingContext} from '@int/geotoolkit/renderer/RenderingContext';\nimport {SetClassName, Obfuscate} from '@int/geotoolkit/decorators';\n\n@SetClassName('MyShape')\n@Obfuscate()\nexport class MyShape extends Shape {\n    constructor () {\n        super();\n    }\n    public override render (context: RenderingContext) {\n    }\n}\n","lang":"ts"},"children":[]}]}]}]},"headings":[{"value":"How to Extend API","id":"how-to-extend-api","depth":1},{"value":"General Information","id":"general-information","depth":3},{"value":"How to extend class","id":"how-to-extend-class","depth":3}],"frontmatter":{"title":"How to Extend API","seo":{"title":"How to Extend API"}},"lastModified":"2026-02-11T19:54:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/geotoolkit/programmers-guide/extend-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}