Skip to content

Commit

Permalink
Merge branch '2017.03.01' into 170301_porting
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed May 29, 2017
2 parents 5ac7612 + 9278b8b commit 25e9f93
Show file tree
Hide file tree
Showing 24 changed files with 121 additions and 91 deletions.
6 changes: 0 additions & 6 deletions web/client/components/background/BackgroundSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ const BackgroundSelector = React.createClass({
this.props.onLayerChange('tempLayer', {});
this.props.onStartChange(0);
},
componentWillUpdate(nextProps) {
if (this.props.size.width !== nextProps.size.width
|| this.props.size.height !== nextProps.size.height) {
this.props.onStartChange(0);
}
},
getThumb(layer) {
return this.props.thumbs[layer.source] && this.props.thumbs[layer.source][layer.name] || layer.thumbURL || this.props.thumbs.unknown;
},
Expand Down
4 changes: 2 additions & 2 deletions web/client/components/background/PreviewList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const PreviewList = React.createClass({
},
render() {
let iconButtons = [].concat(this.props.icons);
iconButtons = iconButtons.slice(this.props.start, this.props.start + this.props.length);
iconButtons = this.props.pagination ? iconButtons.slice(this.props.start, this.props.start + this.props.length) : iconButtons;
if (this.props.pagination) {
if (this.props.start !== 0) {
iconButtons.unshift(<PaginationButton key="pagination_0" vertical={this.props.vertical} side={this.props.vertical ? this.props.width : this.props.height} direction={false} onClick={ () => { this.props.onStartChange(this.props.start - 1); }} />);
}
if (this.props.start + this.props.length !== this.props.icons.length) {
if (this.props.start + this.props.length < this.props.icons.length) {
iconButtons.push(<PaginationButton key="pagination_1" vertical={this.props.vertical} side={this.props.vertical ? this.props.width : this.props.height} direction={true} onClick={ () => { this.props.onStartChange(this.props.start + 1); } } />);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ describe("test the BackgroundSelector", () => {
const node = ReactDOM.findDOMNode(backgroundSelector);
expect(node).toExist();

backgroundSelector.componentWillUpdate({size: {width: 1000, height: 400}, drawerEnabled: false});
backgroundSelector.componentWillUpdate({size: {width: 900, height: 500}, drawerEnabled: false});
backgroundSelector.componentWillUpdate({size: {width: 1000, height: 500}, drawerEnabled: true});
backgroundSelector.componentWillUpdate({size: {width: 1000, height: 500}, drawerEnabled: false});

const icons = backgroundSelector.getIcons(5, 5, 5, false);
expect(icons.length).toBeGreaterThan(0);

Expand Down
2 changes: 1 addition & 1 deletion web/client/components/mapcontrols/search/searchbar.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.MapSearchBar {
left: 45px;
left: 65px;
position: absolute;
right: 55px;
top: 10px;
Expand Down
4 changes: 2 additions & 2 deletions web/client/components/print/Font.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const Font = React.createClass({
onChangeFamily(family) {
this.props.onChangeFamily(family);
},
onChangeSize(size) {
this.props.onChangeSize(size);
onChangeSize(e) {
this.props.onChangeSize(parseFloat(e.target.value));
},
render() {
return (
Expand Down
4 changes: 2 additions & 2 deletions web/client/epics/wfsquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ const viewportSelectedEpic = (action$, store) =>
action$.ofType(SELECT_VIEWPORT_SPATIAL_METHOD, CHANGE_MAP_VIEW)
.switchMap((action) => {
// calculate new geometry from map properties only for viewport
const map = action.type === CHANGE_MAP_VIEW ? action : store.getState().map.present;
const map = action.type === CHANGE_MAP_VIEW ? action : store.getState().map.present || store.getState().map;
if (action.type === SELECT_VIEWPORT_SPATIAL_METHOD ||
action.type === CHANGE_MAP_VIEW &&
store.getState().queryform &&
store.getState().queryform.spatialField &&
store.getState().queryform.spatialField.method === "viewport") {
store.getState().queryform.spatialField.method === "Viewport") {
const bounds = Object.keys(map.bbox.bounds).reduce((p, c) => {
return assign({}, p, {[c]: parseFloat(map.bbox.bounds[c])});
}, {});
Expand Down
6 changes: 6 additions & 0 deletions web/client/examples/plugins/assets/css/plugins.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,9 @@ html, body, #container, #map {
#plugins-list {
overflow-x: hidden;
}

#plugins-container {
position: absolute;
width: 100%;
height: 100%;
}
6 changes: 3 additions & 3 deletions web/client/examples/plugins/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ module.exports = {
TOCPlugin: require('../../plugins/TOC'),
FeatureGridPlugin: require('../../plugins/FeatureGrid'),
RasterStylerPlugin: require('../../plugins/RasterStyler'),
VectorStylerPlugin: require('../../plugins/VectorStyler'),
BackgroundSwitcherPlugin: require('../../plugins/BackgroundSwitcher'),
BackgroundSelectorPlugin: require('../../plugins/BackgroundSelector'),
MeasurePlugin: require('../../plugins/Measure'),
MeasureResultsPlugin: require('../../plugins/MeasureResults'),
PrintPlugin: require('../../plugins/Print'),
FullScreenPlugin: require('../../plugins/FullScreen'),
SnapshotPlugin: require('../../plugins/Snapshot'),
ShapeFilePlugin: require('../../plugins/ShapeFile'),
MetadataExplorerPlugin: require('../../plugins/MetadataExplorer'),
SettingsPlugin: require('../../plugins/Settings'),
TutorialPlugin: require('../../plugins/Tutorial'),
ExpanderPlugin: require('../../plugins/Expander'),
HelpPlugin: require('../../plugins/Help'),
SharePlugin: require('../../plugins/Share'),
HomePlugin: require('../../plugins/Home'),
LoginPlugin: require('../../plugins/Login')
Expand Down
1 change: 0 additions & 1 deletion web/client/examples/print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="https://unpkg.com/pdfjs-dist@1.4.79/build/pdf.combined.js"></script>
<style>
html, body, #container, .fill, #map {
position:absolute;
Expand Down
2 changes: 2 additions & 0 deletions web/client/examples/queryform/components/SmartQueryForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const {
removeGroupField,
changeCascadingValue,
expandAttributeFilterPanel,
selectViewportSpatialMethod,
expandSpatialFilterPanel,
selectSpatialMethod,
selectSpatialOperation,
Expand Down Expand Up @@ -94,6 +95,7 @@ const SmartQueryForm = connect((state) => {
onSelectSpatialMethod: selectSpatialMethod,
onSelectSpatialOperation: selectSpatialOperation,
onChangeDrawingStatus: changeDrawingStatus,
onSelectViewportSpatialMethod: selectViewportSpatialMethod,
onRemoveSpatialSelection: removeSpatialSelection,
onShowSpatialSelectionDetails: showSpatialSelectionDetails,
onEndDrawing: endDrawing,
Expand Down
7 changes: 6 additions & 1 deletion web/client/examples/queryform/stores/queryformstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
var DebugUtils = require('../../../utils/DebugUtils');

const {combineReducers} = require('redux');
const {createEpicMiddleware, combineEpics} = require('redux-observable');
const {viewportSelectedEpic} = require('../../../epics/wfsquery');

// STATE_FIPS SUB_REGION STATE_ABBR LAND_KM WATER_KM PERSONS FAMILIES HOUSHOLD MALE FEMALE WORKERS DRVALONE CARPOOL PUBTRANS EMPLOYED UNEMPLOY SERVICE MANUAL P_MALE P_FEMALE SAMP_POP

Expand Down Expand Up @@ -69,5 +71,8 @@ const reducers = combineReducers({
query: require('../reducers/query')
});

const rootEpic = combineEpics(viewportSelectedEpic);
const epicMiddleware = createEpicMiddleware(rootEpic);

// export the store with the given reducers
module.exports = DebugUtils.createDebugStore(reducers, {queryform: initialState});
module.exports = DebugUtils.createDebugStore(reducers, {queryform: initialState}, [epicMiddleware]);
5 changes: 4 additions & 1 deletion web/client/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
{
"name": "BackgroundSelector",
"cfg": {
"bottom": 40,
"dimensions": {
"side": 65,
"sidePreview": 65,
Expand Down Expand Up @@ -126,7 +127,8 @@
}, "Login",
"OmniBar", "BurgerMenu", "Expander", "GlobeViewSwitcher"
],
"desktop": ["Map", "HelpLink", "Share", "DrawerMenu", "Version", "BackgroundSelector", {
"desktop": ["Map", "HelpLink", "Share", "DrawerMenu", "Version", {"name": "BackgroundSelector", "cfg": { "bottom": 40 } },
{
"name": "Identify",
"showIn": ["IdentifyBar", "Settings"],
"cfg": {
Expand Down Expand Up @@ -223,6 +225,7 @@
},{
"name": "BackgroundSelector",
"cfg": {
"bottom": 40,
"dimensions": {
"side": 65,
"sidePreview": 65,
Expand Down
22 changes: 16 additions & 6 deletions web/client/plugins/BackgroundSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ const {changeLayerProperties} = require('../actions/layers');
const {createSelector} = require('reselect');
const {layersSelector} = require('../selectors/layers');

const mapSelector = (state) => (state.map && state.map.present) || {};
const {mapSelector} = require('../selectors/map');
const backgroundControlsSelector = (state) => (state.controls && state.controls.backgroundSelector) || {};
const drawerEnabledControlSelector = (state) => (state.controls && state.controls.drawer && state.controls.drawer.enabled) || false;

const HYBRID = require('./background/assets/img/HYBRID.jpg');
const ROADMAP = require('./background/assets/img/ROADMAP.jpg');
const TERRAIN = require('./background/assets/img/TERRAIN.jpg');
const SATELLITE = require('./background/assets/img/SATELLITE.jpg');
const Aerial = require('./background/assets/img/Aerial.jpg');
const mapnik = require('./background/assets/img/mapnik.jpg');
const mapquestOsm = require('./background/assets/img/mapquest-osm.jpg');
Expand All @@ -33,7 +34,8 @@ const thumbs = {
google: {
HYBRID,
ROADMAP,
TERRAIN
TERRAIN,
SATELLITE
},
bing: {
Aerial,
Expand All @@ -59,13 +61,12 @@ const thumbs = {

const backgroundSelector = createSelector([mapSelector, layersSelector, backgroundControlsSelector, drawerEnabledControlSelector],
(map, layers, controls, drawer) => ({
size: map.size || {width: 0, height: 0},
size: map && map.size || {width: 0, height: 0},
layers: layers.filter((layer) => layer.group === "background") || [],
tempLayer: controls.tempLayer || {},
currentLayer: controls.currentLayer || {},
start: controls.start || 0,
enabled: controls.enabled && !drawer,
thumbs
enabled: controls.enabled && !drawer
}));

/**
Expand Down Expand Up @@ -99,7 +100,16 @@ const BackgroundSelectorPlugin = connect(backgroundSelector, {
onToggle: toggleControl.bind(null, 'backgroundSelector', null),
onLayerChange: setControlProperty.bind(null, 'backgroundSelector'),
onStartChange: setControlProperty.bind(null, 'backgroundSelector', 'start')
})(require('../components/background/BackgroundSelector'));
}, (stateProps, dispatchProps, ownProps) => ({
...stateProps,
...dispatchProps,
...ownProps,
thumbs: {
...thumbs,
...ownProps.thumbs
}
})
)(require('../components/background/BackgroundSelector'));

module.exports = {
BackgroundSelectorPlugin,
Expand Down
4 changes: 2 additions & 2 deletions web/client/plugins/MetadataExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const MetadataExplorerComponent = React.createClass({
return {
id: "mapstore-metadata-explorer",
active: false,
wrap: false,
modal: true,
wrap: true,
modal: false,
wrapWithPanel: false,
panelStyle: {
zIndex: 100,
Expand Down
3 changes: 2 additions & 1 deletion web/client/plugins/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const {Glyphicon} = require('react-bootstrap');
const assign = require('object-assign');

const SettingsPanel = require('./settings/SettingsPanel');
const LocaleUtils = require('../utils/LocaleUtils');
const {Panel} = require('react-bootstrap');
const Dialog = require('../components/misc/Dialog');

Expand Down Expand Up @@ -85,7 +86,7 @@ const SettingsButton = React.createClass({
},
renderSettings() {
const settingsFirst = {
language: <span><label><Message msgId="language" /></label> <LangBar key="langSelector"/></span>
language: <span><label><Message msgId="language" /></label> <LangBar locales={LocaleUtils.getSupportedLocales()} key="langSelector"/></span>
};
const settingsLast = {
history: <HistoryBar
Expand Down
4 changes: 2 additions & 2 deletions web/client/plugins/ShapeFile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {

const ShapeFilePlugin = connect((state) => (
{
visible: state.controls && state.controls.shapefile && state.controls.shapefile.enabled,
visible: state.controls && state.controls.shapefile && state.controls.shapefile.enabled || state.controls && state.controls.toolbar && state.controls.toolbar.active === 'shapefile',
layers: state.shapefile && state.shapefile.layers || null,
selected: state.shapefile && state.shapefile.selected || null,
bbox: state.shapefile && state.shapefile.bbox || null,
Expand Down Expand Up @@ -58,7 +58,7 @@ module.exports = {
help: <Message msgId="helptexts.shapefile"/>,
title: "shapefile.title",
tooltip: "shapefile.tooltip",
wrap: true,
wrap: false,
icon: <Glyphicon glyph="open-file"/>,
exclusive: true,
priority: 1
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion web/client/plugins/burgermenu/burgermenu.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#mapstore-burger-menu {
position: absolute;
left: 200px;
right: 0;
top: 0;
}

#mapstore-navbar #mapstore-burger-menu {
Expand Down
9 changes: 1 addition & 8 deletions web/client/plugins/shapefile/ShapeFile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,7 @@ const ShapeFile = React.createClass({
id: "mapstore-shapefile-upload",
wrap: true,
wrapWithPanel: false,
panelStyle: {
minWidth: "360px",
zIndex: 100,
position: "absolute",
overflow: "visible",
top: "100px",
left: "calc(50% - 150px)"
},
panelStyle: {},
panelClassName: "toolbar-panel",
visible: false,
toggleControl: () => {},
Expand Down
34 changes: 0 additions & 34 deletions web/client/product/assets/css/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,40 +55,6 @@ html, body, #container, .fill {
background-size:contain;
}

.leafletbottom.leafletright, .leaflet-control-minimap{
bottom: 47px !important;
right: 49px !important;
}

.leaflet-control-scale {
position: absolute;
bottom: -1px;
right: 47px;
z-index: 1000;
}
.leaflet-control-attribution {
width: 165px;
position: absolute;
right: 0;
bottom: 0;
}

.leaflet-bottom.leaflet-right {
margin-bottom: 0 !important;
}

.ol-custom-overviewmap, .ol-custom-overviewmap.ol-uncollapsible {
bottom: 55px !important;
left: auto !important;
right: 57px !important;
top: auto !important;
}

.ol-scale-line.ol-unselectable {
right: 58px;
left: auto;
bottom: 3px;
}
.modal-dialog-container {
z-index: 2000!important;
}
50 changes: 50 additions & 0 deletions web/client/themes/default/ms2-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -1087,3 +1087,53 @@ select.form-control option {
.application-version-label {
font-weight: bold;
}

.leafletbottom.leafletright, .leaflet-control-minimap{
bottom: 47px !important;
right: 49px !important;
}

.leaflet-control-scale {
position: absolute;
bottom: -1px;
right: 47px;
z-index: 1000;
}
.leaflet-control-attribution {
width: 165px;
position: absolute;
right: 0;
bottom: 0;
}

.leaflet-bottom.leaflet-right {
margin-bottom: 0 !important;
}

.ol-custom-overviewmap, .ol-custom-overviewmap.ol-uncollapsible {
bottom: 55px !important;
left: auto !important;
right: 57px !important;
top: auto !important;
}

.ol-scale-line.ol-unselectable {
right: 58px;
left: auto;
bottom: 3px;
}

.toolbar-panel #background-switcher {
max-height: 600px;
overflow: auto;
}

#mapstore-shapefile-upload {
min-width: 360px;
z-index: 100;
position: absolute;
overflow: visible;
top: 100px;
width: 50%;
left: ~"calc(50% - 150px)";
}
Loading

0 comments on commit 25e9f93

Please sign in to comment.