1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
| ///////////////////////////////////////////////////////////////////////////
| // Copyright © 2020 zhongsong. All Rights Reserved.
| // 模块描述:河流水面线分析
| ///////////////////////////////////////////////////////////////////////////
| define([
| 'dojo/_base/declare',
| 'dojo/_base/lang',
| 'dojo/_base/array',
| 'dojo/_base/html',
| 'dojo/topic',
| 'jimu/BaseWidget',
| './mars3d-src'
| ],
| function (declare,
| lang,
| array,
| html,
| topic,
| BaseWidget
| ) {
| return declare([BaseWidget], {
| baseClass: 'jimu-widget-Measurement',
| name: 'Measurement',
| type: '',
| measureSurface: null,
| startup: function () {
| topic.subscribe("closeMeasurement", lang.hitch(this, this.closeMeasurement));
| var that = this;
| var _type = this.type
| $('#measure_length_danwei').change(function () {
| var num = $('#measure_length_danwei .option:selected').val();
| _type = num
| });
| $('.close-measurement').click(function () {
| $('.jimu-widget-Measurement').hide();
| });
|
| $('#measuerLength').click(function () {
| that.measureSurface.measuerLength({
| terrain: !1,
| unit: _type,
| })
| })
|
| $('#measuerLength2').click(function () {
| that.measureSurface.measuerLength({
| terrain: !0,
| unit: _type,
| })
| })
| $('#measureArea').click(function () {
| that.measureSurface.measureArea({
| unit: _type
| });
| })
|
|
| $('#measureHeight').click(function () {
| that.measureSurface.measureHeight({
| isSuper: !1,
| unit: _type,
| })
| })
|
| $('#measureHeight2').click(function () {
| that.measureSurface.measureHeight({
| isSuper: !0,
| unit: _type,
| })
| })
|
| $('#clearDraw').click(function () {
| that.measureSurface.clearMeasure()
| })
|
| $('.xx').click(function () {
| $('.jimu-widget-Measurement').hide()
| that.measureSurface.clearMeasure()
|
| })
| },
|
| onOpen: function onOpen() {
| var that = this;
| that.measureSurface = new mars3d.Measure({
| viewer: that.map,
| terrain: !1
| });
| },
|
| closeMeasurement: function (item) {
|
| var that = this;
| if (item == this.name) {
| $('.jimu-widget-Measurement').hide()
| that.measureSurface.clearMeasure()
|
| }
|
| }
|
| });
| });
|
|