Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
deyihu committed Oct 13, 2024
1 parent bb15ab5 commit ae96a54
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ import {
const maskId = 'china';

const tileActor = getTileActor();
const polygon = {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": []
}
}

tileActor.removeMask(maskId).then(data => {

Expand All @@ -150,8 +143,8 @@ import * as maptalks from 'maptalks';
import {
getTileActor
} from 'maptalks.tileclip'
const tileActor = maptalks.getTileActor();
const maskId = '1';
const tileActor = getTileActor();
const maskId = 'china';
const baseLayer = new maptalks.TileLayer('base', {
debug: true,
urlTemplate: '/arcgisonline/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
Expand Down Expand Up @@ -188,4 +181,18 @@ baseLayer.on('renderercreate', function(e) {
})
};
});

const polygon = {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": []
}
}

tileActor.injectMask(maskId, polygon).then(data => {
baseLayer.addTo(map);
}).catch(error => {
console.error(error);
})
```

0 comments on commit ae96a54

Please sign in to comment.