Mercurial > pub > ImplabJs
comparison src/djol/IdentifyGroup.js @ 34:27e8e9e38e07 default tip
Слияние
author | nickolay |
---|---|
date | Wed, 05 Jun 2019 20:44:15 +0300 |
parents | 8af8e840dd49 1dc2fd263b90 |
children |
comparison
equal
deleted
inserted
replaced
33:8af8e840dd49 | 34:27e8e9e38e07 |
---|---|
1 define( | |
2 [ | |
3 "implab/safe", | |
4 'dijit/_WidgetBase', | |
5 'dijit/_TemplatedMixin', | |
6 "dijit/_WidgetsInTemplateMixin", | |
7 "dijit/layout/_LayoutWidget", | |
8 "dijit/layout/ContentPane", | |
9 "dojo/_base/declare", | |
10 "dojo/dom-construct", | |
11 "dojo/on", | |
12 "ol3/IdentifyItem" ], | |
13 function( | |
14 safe, | |
15 _WidgetBase, | |
16 _TemplatedMixin, | |
17 _WidgetsInTemplateMixin, | |
18 _LayoutWidget, | |
19 ContentPane, | |
20 declare, | |
21 domConstruct, | |
22 on, | |
23 IdentifyItem) { | |
24 | |
25 return declare( | |
26 [ _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin ], | |
27 { | |
28 | |
29 /** | |
30 */ | |
31 _empty : true, | |
32 /** | |
33 */ | |
34 layerName : null, | |
35 /** | |
36 * Шаблон всего widget | |
37 */ | |
38 templateString : "<div class='identify-item-group'><div data-dojo-attach-point='identifyItemGroupTitle' class='identify-item-group-title'></div><div class='identify-item-group-content-container' data-dojo-attach-point='containerNode'></div></div>", | |
39 | |
40 itemTemplate : "", | |
41 | |
42 title : null, | |
43 | |
44 /** | |
45 * Метод из widget.lifecycle | |
46 */ | |
47 postCreate : function() { | |
48 var me = this; | |
49 if (typeof this.title == "string") { | |
50 this.identifyItemGroupTitle.innerHTML = me.title; | |
51 } else if (me.title && me.title.placeAt) { | |
52 me.title.placeAt(me.identifyItemGroupTitle, "only"); | |
53 } else { | |
54 domConstruct.place( | |
55 me.title, | |
56 me.identifyItemGroupTitle, | |
57 "only"); | |
58 } | |
59 on(this.domNode, "click", function() { | |
60 if ("function" == typeof me.callback) { | |
61 me.callback(); | |
62 } | |
63 }); | |
64 }, | |
65 | |
66 addItem : function(options) { | |
67 safe.argumentNotNull(options, "options"); | |
68 safe.argumentNotNull(options.model, "options.model"); | |
69 | |
70 if (options.model) { | |
71 | |
72 var item = new IdentifyItem({ | |
73 title : options.title || this.itemTemplate, | |
74 model : options.model, | |
75 callback : options.callback | |
76 }); | |
77 this.addChild(item); | |
78 this._empty = false; | |
79 } else { | |
80 console | |
81 .error("Не задано необходимое свойство layerFeature"); | |
82 } | |
83 }, | |
84 | |
85 isEmpty : function() { | |
86 return this._empty; | |
87 } | |
88 }); | |
89 }); |