ArcGIS for JS Argus map limits the display of specific areas

Time:2020-11-22

ArcGIS map services restrict specific areas and mask other maps that are not displayed

Method 1: using canvasclearRectMethod to achieve the effect of hollowing out
Method 2: using the path of canvas to achieve the effect of hollowing out

Clearrect method:

        var c=document.getElementById("myCanvas");
        var ctx=c.getContext("2d");
        ctx.fillStyle="#fff";
        ctx.fillRect(0,0,300,150);
        ctx.clearRect(20,20,100,50);