Tutorial

Tutorial - Graphics API

Mapapps

Read more detailed information in the referenced API documentation:

Graphic API reference

You can delete graphics, that you insert in the previous tab "Add Graphics".

To select multiple values hold "Contr"("STRG") Key, while clicking.

Have a look at the delete example on this page, to see how to commit graphic ids.
To use the function as seen in the example, use following code:

    function postEvent(functionName, detail) {
        const integrationElement = document.getElementById('mapIntegrationElement').contentWindow
        if(integrationElement){
            integrationElement.postMessage({functionName: functionName, detail: detail}, "*")
        }
    }
    [...]
    const parameter = {
             geometry: {
                    type: "point", // autocasts as new Point()
                    x: 405647,
                    y: 5662584.5,
                    spatialReference: {
                        wkid: 25833
                    }
                },
                symbol: {
                    type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
                    color: [226, 119, 40],
                    outline: {
                        // autocasts as new SimpleLineSymbol()
                        color: [255, 255, 255],
                        width: 2
                    },
                    size: 20
                }
    }
    postEvent("addGraphics",parameter )
        
To delete graphics, you can use following example:

    function postEvent(functionName, detail) {
        const integrationElement = document.getElementById('mapIntegrationElement').contentWindow
        if(integrationElement){
            integrationElement.postMessage({functionName: functionName, detail: detail}, "*")
        }
    }
    [...]
    // delete multiple graphics
    const parameterArray = [1,2,3]
    postEvent("clearGraphics",parameterArray)

    [...]
    // delete single graphic
    const parameter = 4
    postEvent("clearGraphics", parameter)

    [...]
    // delete all graphics
    postEvent("clearAllGraphics",{})

    // delete all graphics and sketches
    postEvent("clearAllGraphics",{sketch: true})

    // delete all sketches and no graphics
    postEvent("clearAllGraphics",{sketch: true, graphics: false})