/////////////////////////////////////////////////////////////////////////// // Copyright © 2020 zhongsong. All Rights Reserved. // 模块描述:河流水面线分析 /////////////////////////////////////////////////////////////////////////// define([ 'dojo/_base/declare', 'dojo/_base/lang', 'dojo/_base/array', 'dojo/_base/html', 'dojo/topic', 'jimu/BaseWidget' ], function (declare, lang, array, html, topic, BaseWidget ) { return declare([BaseWidget], { baseClass: 'jimu-widget-Plot', name: 'Plot', type: '', layer: null, plot: null, startup: function () { var that = this; $('.jimu-widget-Plot .plot-box ul li button').click(function () { window.dcViewer.contextMenu.enable=false; var type = $(this).attr('drawtype'); that.draw(type); }) $('.xx').click(function () { $('.jimu-widget-Plot').hide() window.dcViewer.contextMenu.enable=true; }) }, draw: function (type) { var that = this; that.plot && that.plot.draw(type, overlay => { that.layer.addOverlay(overlay) that.plot.edit(overlay) }) }, onOpen: function () { this.layer = new DC.VectorLayer('layer') dcViewer.addLayer(this.layer) this.plot = new DC.Plot(dcViewer) } }); });