Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some cleaning on the api stuff #1689

Merged
merged 2 commits into from
Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 6 additions & 118 deletions web/client/jsapi/MapStore2.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,125 +22,13 @@ const ThemeUtils = require('../utils/ThemeUtils');
const assign = require('object-assign');
const {partialRight, merge} = require('lodash');

const defaultConfig = {
"map": {
"projection": "EPSG:3857",
"units": "m",
"center": {"x": 1250000.000000, "y": 5370000.000000, "crs": "EPSG:900913"},
"zoom": 5,
"maxExtent": [
-20037508.34, -20037508.34,
20037508.34, 20037508.34
],
"layers": [{
"type": "osm",
"title": "Open Street Map",
"name": "mapnik",
"source": "osm",
"group": "background",
"visibility": true
},
{
"type": "tileprovider",
"title": "NASAGIBS Night 2012",
"provider": "NASAGIBS.ViirsEarthAtNight2012",
"name": "Night2012",
"source": "nasagibs",
"group": "background",
"visibility": false
},
{
"type": "wms",
"url": "http://www.realvista.it/reflector/open/service",
"visibility": false,
"title": "e-Geos Ortofoto RealVista 1.0",
"name": "rv1",
"group": "background",
"format": "image/jpeg"
},
{
"type": "wms",
"url": "https://demo.geo-solutions.it/geoserver/wms",
"visibility": false,
"title": "Natural Earth",
"name": "sde:NE2_HR_LC_SR_W_DR",
"group": "background",
"format": "image/png"
},
{
"type": "wms",
"url": "https://demo.geo-solutions.it/geoserver/wms",
"visibility": false,
"title": "Hypsometric",
"name": "sde:HYP_HR_SR_OB_DR",
"group": "background",
"format": "image/png"
},
{
"type": "wms",
"url": "https://demo.geo-solutions.it/geoserver/wms",
"visibility": false,
"title": "Gray Earth",
"name": "sde:GRAY_HR_SR_OB_DR",
"group": "background",
"format": "image/png"
},
{
"type": "wms",
"url": "https://demo.geo-solutions.it/geoserver/wms",
"visibility": true,
"opacity": 0.5,
"title": "Weather data",
"name": "nurc:Arc_Sample",
"group": "Meteo",
"format": "image/png"
},
{
"type": "tileprovider",
"title": "OpenTopoMap",
"provider": "OpenTopoMap",
"name": "OpenTopoMap",
"source": "OpenTopoMap",
"group": "background",
"visibility": false
}]
}
};
const defaultConfig = require('json-loader!../config.json');

const localConfig = require('json-loader!../localConfig.json');

const defaultPlugins = {
"mobile": ["Map"],
"desktop": [
"Map",
"Help",
"Share",
"DrawerMenu",
"Identify",
"Locate",
"TOC",
"BackgroundSwitcher",
"Measure",
"MeasureResults",
"Print",
"ShapeFile",
"Settings",
"MetadataExplorer",
"MousePosition",
"Toolbar",
"ScaleBox",
"ZoomAll",
"MapLoading",
"Snapshot",
"ZoomIn",
"ZoomOut",
"Login",
"OmniBar",
"BurgerMenu",
"Expander",
"Undo",
"Redo",
"FullScreen",
"GoFull"
]
"mobile": localConfig.plugins.embedded,
"desktop": localConfig.plugins.embedded
};

function mergeDefaultConfig(pluginName, cfg) {
Expand Down Expand Up @@ -202,7 +90,7 @@ const actionListeners = {};
let stateChangeListeners = [];

const getInitialActions = (options) => {
if (!options.initialState) {
if (!options.initialState || !options.initialState.defaultState.map) {
if (options.configUrl) {
return [loadMapConfig.bind(null, options.configUrl || defaultConfig)];
}
Expand Down
55 changes: 0 additions & 55 deletions web/client/jsapi/plugins.js

This file was deleted.

9 changes: 8 additions & 1 deletion web/client/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,14 @@
}
}
},
"OmniBar"
"OmniBar", {
"name": "GoFull",
"override": {
"Toolbar": {
"alwaysVisible": true
}
}
}
],
"common": [{
"name": "OmniBar",
Expand Down
1 change: 1 addition & 0 deletions web/client/product/api.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const MapStore2 = require('../jsapi/MapStore2')
path: getScriptPath() + '/themes'
},
noLocalConfig: true,
initialState: require('./appConfigEmbedded').initialState,
translations: getScriptPath() + '/../translations'
});
window.MapStore2 = MapStore2;
2 changes: 1 addition & 1 deletion web/client/product/appConfigEmbedded.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
path: "/:mapId",
component: require('./pages/MapViewer')
}],
pluginsDef: require('./pluginsEmbedded.js'),
pluginsDef: require('./apiPlugins.js'),
initialState: {
defaultState: {
mode: "embedded",
Expand Down
28 changes: 0 additions & 28 deletions web/client/product/pluginsEmbedded.js

This file was deleted.