|
7 | 7 | */ |
8 | 8 | const React = require('react'); |
9 | 9 |
|
| 10 | +const {Glyphicon} = require('react-bootstrap'); |
| 11 | + |
10 | 12 | const {connect} = require('react-redux'); |
11 | 13 | const {createSelector} = require('reselect'); |
12 | 14 |
|
13 | 15 | const {mapSelector} = require('../selectors/map'); |
14 | 16 | const {layersSelector} = require('../selectors/layers'); |
15 | 17 | const {on} = require('../actions/controls'); |
16 | 18 |
|
17 | | -const {getFeatureInfo, getVectorInfo, purgeMapInfoResults, showMapinfoMarker, hideMapinfoMarker, showMapinfoRevGeocode, hideMapinfoRevGeocode, noQueryableLayers, clearWarning} = require('../actions/mapInfo'); |
| 19 | +const {getFeatureInfo, getVectorInfo, purgeMapInfoResults, showMapinfoMarker, hideMapinfoMarker, showMapinfoRevGeocode, hideMapinfoRevGeocode, noQueryableLayers, clearWarning, toggleMapInfoState} = require('../actions/mapInfo'); |
18 | 20 | const {closeAnnotations} = require('../actions/annotations'); |
19 | 21 | const {changeMousePointer} = require('../actions/map'); |
20 | 22 | const {changeMapInfoFormat} = require('../actions/mapInfo'); |
@@ -53,10 +55,12 @@ const conditionalToggle = on.bind(null, purgeMapInfoResults(), (state) => |
53 | 55 | * Identify plugin. This plugin allows to perform getfeature info. |
54 | 56 | * It can be configured to have a mobile or a desktop flavor. |
55 | 57 | * It's enabled by default. The bubbling of an on_click_map action to GFI is stopped |
56 | | - * if Annotations orFeatureGrid plugins are editing, draw or measurement supports are |
57 | | - * active ore the identify plugin is disabled. |
58 | | - * To restore old behaviour, in mapInfo state, set enabled to false and disabledAlwaysOn to true and |
59 | | - * manage the plugin using changeMapInfoState action or toggleControl action with 'info' as control name. |
| 58 | + * if Annotations or FeatureGrid plugins are editing, draw or measurement supports are |
| 59 | + * active, the query panel is active or the identify plugin is disabled. |
| 60 | + * To restore old behaviour, in mapInfo state, set disabledAlwaysOn to true and |
| 61 | + * manage the plugin using toggleControl action with 'info' as control name. |
| 62 | + * It's possible also possible disable the plugin by changeMapInfoState or toggleMapInfoState actions |
| 63 | + * |
60 | 64 | * @class Identify |
61 | 65 | * @memberof plugins |
62 | 66 | * @static |
@@ -117,6 +121,18 @@ const FeatureInfoFormatSelector = connect((state) => ({ |
117 | 121 |
|
118 | 122 | module.exports = { |
119 | 123 | IdentifyPlugin: assign(IdentifyPlugin, { |
| 124 | + Toolbar: { |
| 125 | + name: 'info', |
| 126 | + position: 6, |
| 127 | + tooltip: "info.tooltip", |
| 128 | + icon: <Glyphicon glyph="map-marker"/>, |
| 129 | + help: <Message msgId="helptexts.infoButton"/>, |
| 130 | + action: toggleMapInfoState, |
| 131 | + selector: (state) => ({ |
| 132 | + bsStyle: state.mapInfo && state.mapInfo.enabled ? "success" : "primary", |
| 133 | + active: !!(state.mapInfo && state.mapInfo.enabled) |
| 134 | + }) |
| 135 | + }, |
120 | 136 | Settings: { |
121 | 137 | tool: <FeatureInfoFormatSelector |
122 | 138 | key="featureinfoformat" |
|
0 commit comments