Skip to content

Commit

Permalink
Fix region mappings for map widget where possible (#15168)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl authored and tsteur committed Nov 28, 2019
1 parent 6dbd892 commit 736afbe
Show file tree
Hide file tree
Showing 106 changed files with 119 additions and 106 deletions.
15 changes: 14 additions & 1 deletion plugins/UserCountryMap/javascripts/visitor-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,20 @@
}

$.each(data.reportData, function (i, row) {
regionDict[data.reportMetadata[i].region] = $.extend(row, data.reportMetadata[i], {

var region = data.reportMetadata[i].region;

if (!regionExistsInMap(region)) {
var q = {
'p': region
};

if (map.getLayer('regions').getPaths(q).length) {
region = map.getLayer('regions').getPaths(q)[0].data.fips.substr(2);
}
}

regionDict[region] = $.extend(row, data.reportMetadata[i], {
curMetric: quantify(row, metric)
});
});
Expand Down
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/AFG.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/AGO.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/ALB.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/ARE.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/ARG.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/ARM.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/AUS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/AUT.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/AZE.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/BDI.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/BEL.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/BEN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/BFA.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/BGD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/BGR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 736afbe

Please sign in to comment.