/////////////////////////////////////////////////////////////////////////// // 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() } } }); });