Skip to content

Commit

Permalink
Merge pull request #12 from maartenlterpstra/master
Browse files Browse the repository at this point in the history
Unlink the reference_time dimension by default
  • Loading branch information
maartenplieger authored Feb 7, 2018
2 parents af2456f + 9e2a862 commit d3bc35a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webmapjs/WMJSLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,14 @@ function WMJSLayer (options) {
var extents = toArray(jsonlayer.Extent);
layer.dimensions = [];
for (var j = 0; j < dimensions.length; j++) {
var dim = new WMJSDimension();
var dim;
if (dimensions[j].attr.name.toLowerCase() === 'reference_time') {
dim = new WMJSDimension({ linked: false });
} else {
dim = new WMJSDimension();
}
dim.name = dimensions[j].attr.name.toLowerCase();
dim.units = dimensions[j].attr.units;

// WMS 1.1.1 Mode:
for (var i = 0; i < extents.length; i++) {
if (extents[i].attr.name.toLowerCase() == dim.name) {
Expand Down Expand Up @@ -222,7 +226,7 @@ function WMJSLayer (options) {

if (layer.parentMaps.length > 0) {
var mapDim = layer.parentMaps[0].getDimension(dim.name);
if (isDefined(mapDim)) {
if (isDefined(mapDim) && mapDim.linked) {
if (isDefined(mapDim.currentValue)) {
defaultValue = dim.getClosestValue(mapDim.currentValue);
debug('WMJSLayer::configureDimensions Dimension ' + dim.name + ' default value [' + defaultValue + '] is based on map value [' + mapDim.currentValue + ']');
Expand Down

0 comments on commit d3bc35a

Please sign in to comment.