nnnjjj123
2020-11-17 1b2c1edb61190eeb19f465ff031eaa3b2a1b8dbc
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
///////////////////////////////////////////////////////////////////////////
// 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)
      }
 
    });
  });