Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/15.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanderbiest committed Apr 6, 2016
2 parents d55c615 + 6da46fd commit c6a1d2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
16 changes: 0 additions & 16 deletions mapfishapp/src/main/webapp/app/js/GEOR_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,6 @@ GEOR.config = (function() {
*/
HEADER_HEIGHT: getCustomParameter("HEADER_HEIGHT", 90),

/**
* Method: DEFAULT_WMC
* runtime method to get the current default WMC
*/
DEFAULT_WMC: function() {
if (GEOR.config.CONTEXTS &&
GEOR.config.CONTEXTS[0] &&
GEOR.config.CONTEXTS[0]["wmc"]) {
return GEOR.config.CONTEXTS[0]["wmc"];
}
alert("Administrator: "+
"GEOR.config.CONTEXTS is not configured as expected !");
// should not happen:
return "default.wmc";
},

/**
* Constant: ANONYMOUS
* Whether a user is logged in or not: can be overriden
Expand Down
14 changes: 12 additions & 2 deletions mapfishapp/src/main/webapp/app/js/GEOR_mapinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ GEOR.mapinit = (function() {
// and finally we're running our global success callback:
cb.call();
} else {
updateStoreFromWMC(GEOR.config.DEFAULT_WMC());
updateStoreFromWMC(GEOR.config.DEFAULT_WMC);
}
};

Expand Down Expand Up @@ -524,6 +524,16 @@ GEOR.mapinit = (function() {
layerStore = ls;
tr = OpenLayers.i18n;
cb = callback || OpenLayers.Util.Void;

// the default WMC is either the one provided by the admin in GEOR.custom,
// or the first one publicized by mapfishapp's ContextController.java
// in GEOR.config.CONTEXTS
GEOR.config.DEFAULT_WMC = GEOR.custom.DEFAULT_WMC ||
// first context publicized by ContextController:
(GEOR.config.CONTEXTS[0] && GEOR.config.CONTEXTS[0]["wmc"]) ||
// this last one should not happen
"context/default.wmc";

var url;
// POSTing a content to the app (which results in GEOR.initstate
// being set) has priority over everything else:
Expand Down Expand Up @@ -589,7 +599,7 @@ GEOR.mapinit = (function() {
// this is so that the map object and fake base layer are
// properly configured when adding the other layers
// to the map
updateStoreFromWMC(GEOR.config.DEFAULT_WMC(), {
updateStoreFromWMC(GEOR.config.DEFAULT_WMC, {
success: function() {
loadLayers(initState);
}
Expand Down

0 comments on commit c6a1d2f

Please sign in to comment.