liuyg
2021-07-02 25ce610f6ecca7325e7a743dc032c4a76559c63d
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 © 2018 NarutoGIS. All Rights Reserved.
// 模块描述:按钮恢复全图视角
///////////////////////////////////////////////////////////////////////////
define([
  'dojo/_base/declare',
  'dojo/_base/lang',
  'jimu/BaseWidget',
  'dojo/_base/html',
  'dojo/dom-construct',
  'dojo/topic',
  'dojo/on'
],
  function (
    declare,
    lang,
    BaseWidget,
    html,
    domConstruct,
    topic,
    on) {
    var clazz = declare([BaseWidget], {
 
      name: 'VrButton',
      baseClass: 'jimu-widget-vrbutton',
 
      postCreate: function () {
        this.inherited(arguments);
      },
 
      startup: function () {
        this.inherited(arguments);
        new Cesium.VRButton(this.domNode, this.map.scene)
        
        $('.cesium-vrButton').attr('title','VR模式');
 
        $(".jimu-widget-vrbutton button.cesium-button").html("<img src='./images/VR.png' alt=''>");
 
        $('.jimu-widget-vrbutton button.cesium-button').click(function () {
          var title = $(this).attr('title');
  
          if (title == "Exit VR mode") {
  
            $(".jimu-widget-vrbutton button.cesium-button").html("<img src='./images/关闭VR.png' alt=''>");
  
          } else {
            
            $(".jimu-widget-vrbutton button.cesium-button").html("<img src='./images/VR.png' alt=''>");
  
          }
        })
        
      }
 
    });
    return clazz;
  });