This repository has been archived by the owner on Apr 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
/
EditorPanel.js
58 lines (51 loc) · 1.59 KB
/
EditorPanel.js
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
58
/**
* @copyright 2011 geOps
* @license https://github.com/geops/ole/blob/master/license.txt
* @link https://github.com/geops/ole
*/
/**
* Class: OpenLayers.Editor.Control.EditorPanel
* The EditorPanel is a panel of all controls from a given editor.
* By default it appears as toolbar in the upper right corner of the map.
*
* Inherits from:
* - <OpenLayers.Control.Panel>
*
* @constructor
* @param {OpenLayers.Editor} editor
* @param {Object=} options
*/
OpenLayers.Editor.Control.EditorPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
/*
* {boolean} Whether to show by default. Leave value FALSE and show by starting editor's edit mode.
*/
autoActivate: false,
/**
* Constructor: OpenLayers.Editor.Control.EditorPanel
* Create an editing toolbar for a given editor.
*
* Parameters:
* editor - {<OpenLayers.Editor>}
* options - {Object}
*/
initialize: function (editor, options) {
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
},
draw: function() {
OpenLayers.Control.Panel.prototype.draw.apply(this, arguments);
if (!this.active) {
this.div.style.display = 'none';
}
return this.div;
},
redraw: function(){
if (!this.active) {
this.div.style.display = 'none';
}
OpenLayers.Control.Panel.prototype.redraw.apply(this, arguments);
if (this.active) {
this.div.style.display = '';
}
},
CLASS_NAME: 'OpenLayers.Editor.Control.EditorPanel'
});