7
7
*/
8
8
9
9
const React = require ( 'react' ) ;
10
- const { Panel, Glyphicon} = require ( 'react-bootstrap' ) ;
10
+ const { Panel, Glyphicon, Modal } = require ( 'react-bootstrap' ) ;
11
11
const { findIndex} = require ( 'lodash' ) ;
12
12
13
13
require ( './css/identify.css' ) ;
@@ -37,6 +37,8 @@ const Identify = React.createClass({
37
37
viewerOptions : React . PropTypes . object ,
38
38
viewer : React . PropTypes . oneOfType ( [ React . PropTypes . object , React . PropTypes . func ] ) ,
39
39
purgeResults : React . PropTypes . func ,
40
+ noQueryableLayers : React . PropTypes . func ,
41
+ clearWarning : React . PropTypes . func ,
40
42
queryableLayersFilter : React . PropTypes . func ,
41
43
buildRequest : React . PropTypes . func ,
42
44
sendRequest : React . PropTypes . func ,
@@ -59,7 +61,8 @@ const Identify = React.createClass({
59
61
asPanel : React . PropTypes . bool ,
60
62
headerGlyph : React . PropTypes . string ,
61
63
closeGlyph : React . PropTypes . string ,
62
- allowMultiselection : React . PropTypes . bool
64
+ allowMultiselection : React . PropTypes . bool ,
65
+ warning : React . PropTypes . string
63
66
} ,
64
67
getDefaultProps ( ) {
65
68
return {
@@ -78,6 +81,8 @@ const Identify = React.createClass({
78
81
sendRequest : ( ) => { } ,
79
82
showMarker : ( ) => { } ,
80
83
hideMarker : ( ) => { } ,
84
+ noQueryableLayers : ( ) => { } ,
85
+ clearWarning : ( ) => { } ,
81
86
changeMousePointer : ( ) => { } ,
82
87
showRevGeocode : ( ) => { } ,
83
88
hideRevGeocode : ( ) => { } ,
@@ -133,7 +138,12 @@ const Identify = React.createClass({
133
138
}
134
139
135
140
} ) ;
136
- this . props . showMarker ( ) ;
141
+ if ( queryableLayers . length === 0 ) {
142
+ this . props . noQueryableLayers ( ) ;
143
+ } else {
144
+ this . props . showMarker ( ) ;
145
+ }
146
+
137
147
}
138
148
139
149
if ( newProps . enabled && ! this . props . enabled ) {
@@ -222,6 +232,20 @@ const Identify = React.createClass({
222
232
</ Draggable >
223
233
) : this . renderContent ( ) ;
224
234
}
235
+ if ( this . props . warning ) {
236
+ return ( < Modal show = { true } bsSize = "small" onHide = { ( ) => {
237
+ this . props . clearWarning ( ) ;
238
+ } } >
239
+ < Modal . Header className = "dialog-error-header-side" closeButton >
240
+ < Modal . Title > < Message msgId = "warning" /> </ Modal . Title >
241
+ </ Modal . Header >
242
+ < Modal . Body >
243
+ < div className = "mapstore-error" > < Message msgId = "identifyNoQueryableLayers" /> </ div >
244
+ </ Modal . Body >
245
+ < Modal . Footer >
246
+ </ Modal . Footer >
247
+ </ Modal > ) ;
248
+ }
225
249
return null ;
226
250
} ,
227
251
needsRefresh ( props ) {
0 commit comments