0.98.3 • Published 2 months ago

@maptalks/analysis v0.98.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

maptalks.analysis

NPM Version

Usage

maptalks.analysis a plugin to excute analysis task in maptalks.

Install

  • Install with npm: npm install @maptalks/analysis.
  • Use unpkg CDN: https://unpkg.com/@maptalks/analysis/dist/maptalks.analysis.js

Vanilla Javascript

<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>

ES6

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);

API

  • Class : ViewshedAnalysis(inherited from maptalks.Eventable)

    ViewshedAnalysis's constructor.

    Method : new ViewshedAnalysis(options)

    ParameterTypeDefaultDescription
    eyePosArraynullposition of eye, include longitude、latitude、altitude
    lookPointArraynullposition of look point
    verticalAngleNumber90vertical angle of viewer
    horizontalAngleNumber90horizontal angle of viewer

    Method : addTo(groupgllayer)

    add viewshed analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : ViewshedAnalysis: this

    Method : remove()

    remove the viewshed analysis from groupgllayer

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : enable()

    enable the analysis task

    returns : ViewshedAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available ViewshedAnalysis: return this

    Method : isEnbale()

    whether the analysis task is enable

    returns : Boolean: true or false

  • Class : FloodAnalysis(inherited from maptalks.Eventable)

    FloodAnalysis's constructor.

    Method : new FloodAnalysis(options)

    ParameterTypeDefaultDescription
    boundaryArraythe coordinate rings of flood boundary
    waterColorArray0.1451, 0.2588, 0.4863the color of water
    waterHeightArraynullthe depth of water

    Method : addTo(groupgllayer)

    add flood analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : FloodAnalysis: this

    Method : remove()

    remove the flood analysis from groupgllayer

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : enable()

    enable the analysis task

    returns : FloodAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available FloodAnalysis: return this

    Method : isEnbale()

    whether the analysis task is enable

    returns : Boolean: true or false

  • Class : SkylineAnalysis(inherited from maptalks.Eventable)

    SkylineAnalysis's constructor.

    Method : new SkylineAnalysis(options)

    ParameterTypeDefaultDescription
    lineColorArray1, 0, 0the color of skyline
    lineWidthArray1.0the width of skyline

    Method : addTo(groupgllayer)

    add skyline analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : SkylineAnalysis: this

    Method : remove()

    remove the skyline analysis from groupgllayer

    Method : exportSkylineMap(options)

    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 |

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : enable()

    enable the analysis task

    returns : SkylineAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available SkylineAnalysis: return this

    Method : isEnbale()

    whether the analysis task is enable

    returns : Boolean: true or false

  • Class : InsightAnalysis(inherited from maptalks.Eventable)

    InsightAnalysis's constructor.

    Method : new InsightAnalysis(options)

    ParameterTypeDefaultDescription
    lineColorArray1, 0, 0the color of Insight
    lineWidthArray1.0the width of Insight

    Method : addTo(groupgllayer)

    add insight analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : InsightAnalysis: this

    Method : remove()

    remove the insight analysis from groupgllayer

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : enable()

    enable the analysis task

    returns : InsightAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available InsightAnalysis: return this

    Method : isEnbale()

    whether the analysis task is enable

    returns : Boolean: true or false

  • Class : CutAnalysis(inherited from maptalks.Eventable)

    CutAnalysis's constructor.

    Method : new CutAnalysis(options)

    ParameterTypeDefaultDescription
    positionArraythe position of helper parts
    rotationArraythe Euler angle of helper parts
    scaleArraythe scale of helper parts

    Method : addTo(groupgllayer)

    add cut analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : CutAnalysis: this

    Method : remove()

    remove the cut analysis from groupgllayer

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : enable()

    enable the analysis task

    returns : CutAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available

    returns : CutAnalysis: return this

    Method : isEnbale()

    whether the analysis task is enable

    returns : Boolean: true or false

    Method : reset()

    reset cutanalysis's initial state

    returns : CutAnalysis: return this

  • Class : ExcavateAnalysis(inherited from maptalks.Eventable)

    ExcavateAnalysis's constructor.

    Method : new ExcavateAnalysis(options)

    ParameterTypeDefaultDescription
    boundaryArraythe coordinate rings of excavate boundary
    textureUrlStringthe excavate texture's url
    heightNumberexcavate height

    Method : addTo(groupgllayer)

    add excavate analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : ExcavateAnalysis: this

    Method : remove()

    remove the excavate analysis from groupgllayer

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : enable()

    enable the analysis task

    returns : ExcavateAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available

    returns : ExcavateAnalysis: return this

    Method : isEnbale()

    whether the analysis task is enable

    returns : Boolean: true or false

  • Class : CrossCutAnalysis(inherited from maptalks.Eventable)

    CrossCutAnalysis's constructor.

    Method : new CrossCutAnalysis(options)

    ParameterTypeDefaultDescription
    cutLineArraythe coordinate rings of cross cut line
    textureUrlStringthe excavate texture's url
    cutLineColorArray0, 1, 0, 1color array

    Method : addTo(groupgllayer)

    add crosscut analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : CrossCutAnalysis: this

    Method : remove()

    remove the crosscut analysis from groupgllayer

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : getAltitudes(count)

    ParameterTypeDefaultDescription
    countNumberthe count of cut times

    returns : Array: [{distance: [], point: longitude, latitude, altitude }

    Method : enable()

    enable the analysis task

    returns : CrossCutAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available

    returns : CrossCutAnalysis: return this

    Method : 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)

    ParameterTypeDefaultDescription
    limitHeightNumberthe limited height of analysis
    limitColorArraylimited meshes will be rendered by limitedColor

    Method : addTo(groupgllayer)

    add limit analysis to groupgllayer | Parameter | Type | Default | Description| | ------------- |---------- |-------------|--------- | | groupgllayer | maptalks.GroupGLLayer | | a groupgllayer to add |

    returns : HeightLimitAnalysis: this

    Method : remove()

    remove the limit analysis from groupgllayer

    Method : update(name, value)

    ParameterTypeDefaultDescription
    nameStringname of property
    valueAnyvalue of property

    Method : enable()

    enable the analysis task

    returns : CrossCutAnalysis: return this

    Method : disable()

    disable the analysis task, when disable the analysis task, it will be not available

    returns : CrossCutAnalysis: return this

    Method : isEnbale()

    whether the analysis task is enable

    returns : Boolean: true or false

0.98.3

2 months ago

0.99.0

4 months ago

0.100.0

4 months ago

0.98.1

4 months ago

0.98.2

4 months ago

0.98.0

4 months ago

0.97.4

9 months ago

0.97.2

10 months ago

0.97.0

10 months ago

0.97.1

10 months ago

0.96.0

11 months ago

0.95.8

11 months ago

0.95.6

11 months ago

0.95.5

12 months ago

0.95.4

12 months ago

0.95.3

12 months ago

0.95.2

12 months ago

0.95.0

12 months ago

0.87.0

1 year ago

0.91.4

1 year ago

0.91.0

1 year ago

0.93.0

1 year ago

0.91.2

1 year ago

0.88.0

1 year ago

0.90.0

1 year ago

0.92.0

1 year ago

0.94.0

1 year ago

0.89.3

1 year ago

0.87.1

1 year ago

0.89.0

1 year ago

0.89.1

1 year ago

0.89.2

1 year ago

0.86.0

1 year ago

0.84.0

2 years ago

0.83.1

2 years ago

0.85.0

2 years ago

0.84.1

2 years ago

0.84.2

2 years ago

0.84.3

2 years ago

0.83.0

2 years ago

0.84.4

2 years ago

0.84.5

2 years ago

0.81.3

2 years ago

0.81.4

2 years ago

0.81.0

2 years ago

0.82.0

2 years ago

0.81.2

2 years ago

0.80.0

2 years ago

0.76.0

2 years ago

0.79.2

2 years ago

0.78.0

2 years ago

0.77.0

2 years ago

0.76.1

2 years ago

0.79.1

2 years ago

0.78.2

2 years ago

0.79.0

2 years ago

0.78.1

2 years ago

0.74.3

2 years ago

0.74.2

2 years ago

0.74.1

2 years ago

0.74.0

2 years ago

0.73.6

2 years ago

0.73.5

2 years ago

0.73.4

2 years ago

0.73.3

2 years ago

0.73.2

2 years ago

0.73.1

2 years ago

0.1.0

2 years ago