
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
@maptalks/analysis
Advanced tools
maptalks.analysis a plugin to excute analysis task in maptalks.
npm install @maptalks/analysis.https://unpkg.com/@maptalks/analysis/dist/maptalks.analysis.js<script type="text/javascript" src="../maptalks.analysis.js"></script>
<script>
var map = new maptalks.Map("map",{
center : [0, 0],
zoom : 15
});
var groupLayer = new maptalks.GroupGLLayer('g', [], { sceneConfig }).addTo(map);
var center = map.getCenter();
var eyePos = [center.x + 0.01, center.y, 0];
var lookPoint = [center.x, center.y, 0];
var verticalAngle = 30;
var horizontalAngle = 20;
var viewshedAnalysis = new maptalks.ViewshedAnalysis({
eyePos,
lookPoint,
verticalAngle,
horizontalAngle
});
viewshedAnalysis.addTo(groupLayer);
</script>
import { ViewshedAnalysis } from '@maptalks/analysis';
const map = new maptalks.Map("map",{
center : [0, 0],
zoom : 15
});
const groupLayer = new maptalks.GroupGLLayer('g', [], { sceneConfig }).addTo(map);
const center = map.getCenter();
const eyePos = [center.x + 0.01, center.y, 0];
const lookPoint = [center.x, center.y, 0];
const verticalAngle = 30;
const horizontalAngle = 20;
const viewshedAnalysis = new maptalks.ViewshedAnalysis({
eyePos,
lookPoint,
verticalAngle,
horizontalAngle
});
viewshedAnalysis.addTo(groupLayer);
(inherited from maptalks.Eventable)ViewshedAnalysis's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
eyePos | Array | null | position of eye, include longitude、latitude、altitude |
lookPoint | Array | null | position of look point |
verticalAngle | Number | 90 | vertical angle of viewer |
horizontalAngle | Number | 90 | horizontal angle of viewer |
add viewshed analysis to groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
groupgllayer | maptalks.GroupGLLayer | a groupgllayer to add |
returns :
ViewshedAnalysis: this
remove the viewshed analysis from groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | name of property | |
value | Any | value of property |
enable the analysis task
returns :
ViewshedAnalysis: return this
disable the analysis task, when disable the analysis task, it will be not available ViewshedAnalysis: return this
whether the analysis task is enable
returns :
Boolean: true or false
(inherited from maptalks.Eventable)FloodAnalysis's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
boundary | Array | the coordinate rings of flood boundary | |
waterColor | Array | [0.1451, 0.2588, 0.4863] | the color of water |
waterHeight | Array | null | the depth of water |
add flood analysis to groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
groupgllayer | maptalks.GroupGLLayer | a groupgllayer to add |
returns :
FloodAnalysis: this
remove the flood analysis from groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | name of property | |
value | Any | value of property |
enable the analysis task
returns :
FloodAnalysis: return this
disable the analysis task, when disable the analysis task, it will be not available FloodAnalysis: return this
whether the analysis task is enable
returns :
Boolean: true or false
(inherited from maptalks.Eventable)SkylineAnalysis's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
lineColor | Array | [1, 0, 0] | the color of skyline |
lineWidth | Array | 1.0 | the width of skyline |
add skyline analysis to groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
groupgllayer | maptalks.GroupGLLayer | a groupgllayer to add |
returns :
SkylineAnalysis: this
remove the skyline analysis from groupgllayer
remove the skyline analysis from groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
save | Boolean | true | whether pop a file save dialog to save the export image |
filename | String | export | specify the file name, if options.save is true |
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | name of property | |
value | Any | value of property |
enable the analysis task
returns :
SkylineAnalysis: return this
disable the analysis task, when disable the analysis task, it will be not available SkylineAnalysis: return this
whether the analysis task is enable
returns :
Boolean: true or false
(inherited from maptalks.Eventable)InsightAnalysis's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
lineColor | Array | [1, 0, 0] | the color of Insight |
lineWidth | Array | 1.0 | the width of Insight |
add insight analysis to groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
groupgllayer | maptalks.GroupGLLayer | a groupgllayer to add |
returns :
InsightAnalysis: this
remove the insight analysis from groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | name of property | |
value | Any | value of property |
enable the analysis task
returns :
InsightAnalysis: return this
disable the analysis task, when disable the analysis task, it will be not available InsightAnalysis: return this
whether the analysis task is enable
returns :
Boolean: true or false
(inherited from maptalks.Eventable)CutAnalysis's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
position | Array | the position of helper parts | |
rotation | Array | the Euler angle of helper parts | |
scale | Array | the scale of helper parts |
add cut analysis to groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
groupgllayer | maptalks.GroupGLLayer | a groupgllayer to add |
returns :
CutAnalysis: this
remove the cut analysis from groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | name of property | |
value | Any | value of property |
enable the analysis task
returns :
CutAnalysis: return this
disable the analysis task, when disable the analysis task, it will be not available
returns :
CutAnalysis: return this
whether the analysis task is enable
returns :
Boolean: true or false
reset cutanalysis's initial state
returns :
CutAnalysis: return this
(inherited from maptalks.Eventable)ExcavateAnalysis's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
boundary | Array | the coordinate rings of excavate boundary | |
textureUrl | String | the excavate texture's url | |
height | Number | excavate height |
add excavate analysis to groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
groupgllayer | maptalks.GroupGLLayer | a groupgllayer to add |
returns :
ExcavateAnalysis: this
remove the excavate analysis from groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | name of property | |
value | Any | value of property |
enable the analysis task
returns :
ExcavateAnalysis: return this
disable the analysis task, when disable the analysis task, it will be not available
returns :
ExcavateAnalysis: return this
whether the analysis task is enable
returns :
Boolean: true or false
(inherited from maptalks.Eventable)CrossCutAnalysis's constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
cutLine | Array | the coordinate rings of cross cut line | |
textureUrl | String | the excavate texture's url | |
cutLineColor | Array | [0, 1, 0, 1] | color array |
add crosscut analysis to groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
groupgllayer | maptalks.GroupGLLayer | a groupgllayer to add |
returns :
CrossCutAnalysis: this
remove the crosscut analysis from groupgllayer
| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | name of property | |
value | Any | value of property |
| Parameter | Type | Default | Description |
|---|---|---|---|
count | Number | the count of cut times |
returns :
Array: [{distance: [], point: [longitude, latitude, altitude] }Method : enable()
enable the analysis task
returns :
CrossCutAnalysis: return thisMethod : disable()
disable the analysis task, when disable the analysis task, it will be not available
returns :
CrossCutAnalysis: return thisMethod : isEnbale()
whether the analysis task is enable
returns :
Boolean: true or false
Class : HeightLimitAnalysis
(inherited from maptalks.Eventable)HeightLimitAnalysis's constructor.
Method : new HeightLimitAnalysis(options)
Parameter Type Default Description limitHeightNumber the limited height of analysis limitColorArray limited meshes will be rendered by limitedColor Method : addTo(groupgllayer)
add limit analysis to groupgllayer
Parameter Type Default Description groupgllayermaptalks.GroupGLLayer a groupgllayer to add returns :
HeightLimitAnalysis: thisMethod : remove()
remove the limit analysis from groupgllayer
Method : update(name, value)
Parameter Type Default Description nameString name of property valueAny value of property Method : enable()
enable the analysis task
returns :
CrossCutAnalysis: return thisMethod : disable()
disable the analysis task, when disable the analysis task, it will be not available
returns :
CrossCutAnalysis: return thisMethod : isEnbale()
whether the analysis task is enable
returns :
Boolean: true or false
FAQs
a plugin to excute many analysis tasks
We found that @maptalks/analysis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.