Skip to content

Commit

Permalink
Merged fixes / improvements from qwc2 (#1622) (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarto authored May 16, 2017
1 parent 650b5c4 commit 2a9f77a
Show file tree
Hide file tree
Showing 27 changed files with 631 additions and 147 deletions.
12 changes: 11 additions & 1 deletion web/client/actions/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

const CHANGE_DRAWING_STATUS = 'CHANGE_DRAWING_STATUS';
const END_DRAWING = 'END_DRAWING';
const SET_CURRENT_STYLE = 'SET_CURRENT_STYLE';

function changeDrawingStatus(status, method, owner, features, options) {
return {
Expand All @@ -28,9 +29,18 @@ function endDrawing(geometry, owner) {
};
}

function setCurrentStyle(style) {
return {
type: SET_CURRENT_STYLE,
currentStyle: style
};
}

module.exports = {
CHANGE_DRAWING_STATUS,
END_DRAWING,
SET_CURRENT_STYLE,
changeDrawingStatus,
endDrawing
endDrawing,
setCurrentStyle
};
13 changes: 12 additions & 1 deletion web/client/actions/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ const CHANGE_MOUSE_POINTER = 'CHANGE_MOUSE_POINTER';
const CHANGE_ZOOM_LVL = 'CHANGE_ZOOM_LVL';
const PAN_TO = 'PAN_TO';
const ZOOM_TO_EXTENT = 'ZOOM_TO_EXTENT';
const ZOOM_TO_POINT = 'ZOOM_TO_POINT';
const CHANGE_MAP_CRS = 'CHANGE_MAP_CRS';
const CHANGE_MAP_SCALES = 'CHANGE_MAP_SCALES';
const CHANGE_MAP_STYLE = 'CHANGE_MAP_STYLE';
const CHANGE_ROTATION = 'CHANGE_ROTATION';

function zoomToPoint(pos, zoom, crs) {
return {
type: ZOOM_TO_POINT,
pos,
zoom,
crs
};
}

function changeMapView(center, zoom, bbox, size, mapStateSource, projection, viewerOptions) {
return {
Expand Down Expand Up @@ -108,6 +117,7 @@ module.exports = {
CHANGE_MAP_SCALES,
CHANGE_MAP_STYLE,
CHANGE_ROTATION,
ZOOM_TO_POINT,
changeMapView,
clickOnMap,
changeMousePointer,
Expand All @@ -117,5 +127,6 @@ module.exports = {
zoomToExtent,
panTo,
changeMapStyle,
changeRotation
changeRotation,
zoomToPoint
};
4 changes: 3 additions & 1 deletion web/client/actions/mapInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,7 @@ module.exports = {
showMapinfoRevGeocode,
getVectorInfo,
noQueryableLayers,
clearWarning
clearWarning,
errorFeatureInfo,
loadFeatureInfo
};
1 change: 1 addition & 0 deletions web/client/actions/measurement.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function changeMeasurement(measurement) {
function changeMeasurementState(measureState) {
return {
type: CHANGE_MEASUREMENT_STATE,
pointMeasureEnabled: measureState.pointMeasureEnabled,
lineMeasureEnabled: measureState.lineMeasureEnabled,
areaMeasureEnabled: measureState.areaMeasureEnabled,
bearingMeasureEnabled: measureState.bearingMeasureEnabled,
Expand Down
22 changes: 19 additions & 3 deletions web/client/actions/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const TEXT_SEARCH_NESTED_SERVICES_SELECTED = 'TEXT_SEARCH_NESTED_SERVICE_SELECTE
const TEXT_SEARCH_ERROR = 'TEXT_SEARCH_ERROR';
const TEXT_SEARCH_CANCEL_ITEM = 'TEXT_SEARCH_CANCEL_ITEM';
const TEXT_SEARCH_ITEM_SELECTED = 'TEXT_SEARCH_ITEM_SELECTED';
const TEXT_SEARCH_SET_HIGHLIGHTED_FEATURE = 'TEXT_SEARCH_SET_HIGHLIGHTED_FEATURE';
/**
* updates the results of the search result loaded
* @memberof actions.search
Expand Down Expand Up @@ -92,10 +93,11 @@ function resetSearch() {
* @memberof actions.search
* @param {object} itemPosition
*/
function addMarker(itemPosition) {
function addMarker(itemPosition, itemText) {
return {
type: TEXT_SEARCH_ADD_MARKER,
markerPosition: itemPosition
markerPosition: itemPosition,
markerLabel: itemText
};
}

Expand Down Expand Up @@ -157,6 +159,18 @@ function cancelSelectedItem(item) {
};
}

/**
* Highlights the given feature
* @memberof actions.search
* @param {object} feature the feature to highlight
*/
function setHighlightedFeature(feature) {
return {
type: TEXT_SEARCH_SET_HIGHLIGHTED_FEATURE,
highlightedFeature: feature
};
}

/**
* Actions for search
* @name actions.search
Expand All @@ -174,6 +188,7 @@ module.exports = {
TEXT_SEARCH_ITEM_SELECTED,
TEXT_SEARCH_NESTED_SERVICES_SELECTED,
TEXT_SEARCH_CANCEL_ITEM,
TEXT_SEARCH_SET_HIGHLIGHTED_FEATURE,
searchTextLoading,
searchResultError,
searchResultLoaded,
Expand All @@ -184,5 +199,6 @@ module.exports = {
searchTextChanged,
selectNestedService,
selectSearchItem,
cancelSelectedItem
cancelSelectedItem,
setHighlightedFeature
};
23 changes: 23 additions & 0 deletions web/client/actions/selection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright 2017, Sourcepole AG.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
const CHANGE_SELECTION_STATE = 'CHANGE_SELECTION_STATE';

function changeSelectionState(selectionState) {
return {
type: CHANGE_SELECTION_STATE,
geomType: selectionState.geomType,
point: selectionState.point,
line: selectionState.line,
polygon: selectionState.polygon
};
}

module.exports = {
CHANGE_SELECTION_STATE,
changeSelectionState
};
3 changes: 2 additions & 1 deletion web/client/components/buttons/ZoomButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const ZoomButton = React.createClass({
minZoom: 0,
maxZoom: 28,
onZoom: () => {},
bsStyle: "default"
bsStyle: "default",
style: {}
};
},
render() {
Expand Down
2 changes: 1 addition & 1 deletion web/client/components/data/identify/Identify.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ const Identify = React.createClass({
},
render() {
if (this.props.enabled && this.props.requests.length !== 0) {
return this.props.draggable ? (
return this.props.draggable && this.props.asPanel ? (
<Draggable>
{this.renderContent()}
</Draggable>
Expand Down
Loading

0 comments on commit 2a9f77a

Please sign in to comment.