Skip to content

Commit

Permalink
Fixed typeof in interactive legend
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jan 14, 2014
1 parent 8dca812 commit 93a8193
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions site/js/FeatureInfoDisplay.js
Expand Up @@ -128,7 +128,7 @@ function showFeatureInfoHover(evt) {
else if (tooltipTemplates && tooltipTemplates.hasOwnProperty(layerNodes[i].getAttribute("name"))){
templateText = tooltipTemplates[layerNodes[i].getAttribute("name")].template;
tooltipText = templateText.replace(/<%(\w*)%>/g,function(m,key){
var value = attributesDict.hasOwnProperty(key)?attributesDict[key]:"";
var value = attributesDict.hasOwnProperty(key) ? attributesDict[key] : "";
return value.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
Expand All @@ -142,7 +142,7 @@ function showFeatureInfoHover(evt) {
var ttmatch;
while(ttmatch = re.exec(tooltipAttributeName)){
var key = ttmatch[1];
var val = attributesDict.hasOwnProperty(key)?attributesDict[key]:"";
var val = attributesDict.hasOwnProperty(key) ? attributesDict[key] : "";
tooltipText = tooltipText.replace(ttmatch[0], val);
}
text += tooltipText+"<br/>";
Expand Down
4 changes: 4 additions & 0 deletions site/js/GlobalOptions.js
Expand Up @@ -132,6 +132,10 @@ var tooltipTemplates = {
// can slow down the application.
var mapSearchPanelOutputRegion = 'popup' ; // Possible values: default,right,bottom,popup

// Interactive legend. This is based on PHP get_legend.php script.
// You can define here an alternate URL for this service
//var interactiveLegendGetLegendURL = '../php/get_legend.php?map=' + project_map + '&';


//define whether you want to display a map theme switcher
//note that you have to also link a gis-project-listing.js file containing a valid
Expand Down
2 changes: 1 addition & 1 deletion site/js/LegendAndMetadataDisplay.js
Expand Up @@ -21,7 +21,7 @@ function showInteractiveLegendAndMetadata(layertitle) {
legendMetadataWindow.show();
}
//create legend URI from GlobalOptions.js interactiveLegendGetLegendURL
if (typeof('interactiveLegendGetLegendURL') == 'undefined'){
if (typeof(interactiveLegendGetLegendURL) == 'undefined'){
Ext.MessageBox.alert('Configuration error', 'interactiveLegendGetLegendURL is not defined. Set it in GlobalOptions.js');
return;
}
Expand Down
2 changes: 1 addition & 1 deletion site/js/WebgisInit.js
Expand Up @@ -1633,7 +1633,7 @@ function addInfoButtonsToLayerTree() {
});

Ext.get(buttonId).on('click', function(e) {
if(typeof('interactiveLegendGetLegendURL') == 'undefined'){
if(typeof(interactiveLegendGetLegendURL) == 'undefined'){
showLegendAndMetadata(n.text);
} else {
showInteractiveLegendAndMetadata(n.text);
Expand Down

0 comments on commit 93a8193

Please sign in to comment.