Commit 3889f9fd authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Fix bug of tiles opacity (closes #51), fix bug of *=watch tags

parent 1ae4377e
...@@ -316,7 +316,11 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService ...@@ -316,7 +316,11 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService
} }
} }
//Change background opacity
this.layers.tile.setOpacity(this.config.view.map.tiles_data_opacity); this.layers.tile.setOpacity(this.config.view.map.tiles_data_opacity);
for(var i in this.layersManager.layers.tiles) {
this.layersManager.layers.tiles[i].setOpacity(this.config.view.map.tiles_data_opacity);
}
//Hide missing images //Hide missing images
$("img").error(function () { $("img").error(function () {
...@@ -451,6 +455,10 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService ...@@ -451,6 +455,10 @@ var Main = function(divId, mode, config, rulesets, newNoteService, searchService
} }
else { else {
this.layers.tile.setOpacity(1); this.layers.tile.setOpacity(1);
for(var i in this.layersManager.layers.tiles) {
this.layersManager.layers.tiles[i].setOpacity(1);
}
this.buttons.note.disable(); this.buttons.note.disable();
//Hide eventual data layer //Hide eventual data layer
if(this.level.map != null) { if(this.level.map != null) {
......
...@@ -183,16 +183,18 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) { ...@@ -183,16 +183,18 @@ MapLayersManager.prototype.setOSMFeatures = function(f, ruleset, options) {
fIconUrl = /url\(\'(.+)\'\)/.exec(fStyle.icon_image)[1]; fIconUrl = /url\(\'(.+)\'\)/.exec(fStyle.icon_image)[1];
//Replace joker values in icon URL //Replace joker values in icon URL
while(fIconRgx.test(fIconUrl)) { while(fIconUrl && fIconRgx.test(fIconUrl)) {
//Replace tag name with actual tag value //Replace tag name with actual tag value
fIconRgxTagName = fIconRgx.exec(fIconUrl)[1]; fIconRgxTagName = fIconRgx.exec(fIconUrl)[1];
fIconRgxTagValue = feature.getTag(fIconRgxTagName); fIconRgxTagValue = feature.getTag(fIconRgxTagName);
//If an alias exists for the given value, replace //If an alias exists for the given value, replace
if(feature.style.pointStyles.default.icon_image_aliases[fIconRgxTagValue]) { if(typeof feature.style.pointStyles.default.icon_image_aliases[fIconRgxTagValue] === "string") {
fIconRgxTagValue = feature.style.pointStyles.default.icon_image_aliases[fIconRgxTagValue]; fIconRgxTagValue = feature.style.pointStyles.default.icon_image_aliases[fIconRgxTagValue];
} }
console.log(fIconUrl);
console.log(fIconRgxTagValue);
fIconUrl = fIconUrl.replace(fIconRgx, fIconRgxTagValue); fIconUrl = fIconUrl.replace(fIconRgx, fIconRgxTagValue);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment