| | |
| | | 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(); |
| | |
| | | $('.close-measurement').click(function () { |
| | | $('.jimu-widget-Measurement').hide(); |
| | | }); |
| | | var measureSurface = new mars3d.Measure({ |
| | | viewer: viewer, |
| | | terrain: !1 |
| | | }); |
| | | |
| | | $('#measuerLength').click(function () { |
| | | measureSurface.measuerLength({ |
| | | that.measureSurface.measuerLength({ |
| | | terrain: !1, |
| | | unit: _type, |
| | | }) |
| | | }) |
| | | |
| | | $('#measuerLength2').click(function () { |
| | | measureSurface.measuerLength({ |
| | | that.measureSurface.measuerLength({ |
| | | terrain: !0, |
| | | unit: _type, |
| | | }) |
| | | }) |
| | | $('#measureArea').click(function () { |
| | | measureSurface.measureArea({ |
| | | that.measureSurface.measureArea({ |
| | | unit: _type |
| | | }); |
| | | }) |
| | | |
| | | |
| | | $('#measureHeight').click(function () { |
| | | measureSurface.measureHeight({ |
| | | that.measureSurface.measureHeight({ |
| | | isSuper: !1, |
| | | unit: _type, |
| | | }) |
| | | }) |
| | | |
| | | $('#measureHeight2').click(function () { |
| | | measureSurface.measureHeight({ |
| | | that.measureSurface.measureHeight({ |
| | | isSuper: !0, |
| | | unit: _type, |
| | | }) |
| | | }) |
| | | |
| | | $('#clearDraw').click(function () { |
| | | measureSurface.clearMeasure() |
| | | that.measureSurface.clearMeasure() |
| | | }) |
| | | |
| | | $('.xx').click(function () { |
| | | $('.jimu-widget-Measurement').hide() |
| | | measureSurface.clearMeasure() |
| | | 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() |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | }); |