Skip to content

Commit

Permalink
Use short and readable map URL
Browse files Browse the repository at this point in the history
  • Loading branch information
bchartier committed Feb 8, 2019
1 parent bbaecc5 commit c0c1caa
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions js/mviewerstudio.js
Expand Up @@ -463,11 +463,16 @@ var saveApplicationParameters = function (option) {

} else {
// Preview the map
if (data.success && data.filepath) {
console.log(data.filepath);
var url = _conf.mviewer_instance + '?config=' + _conf.conf_path_from_mviewer + data.filepath;
window.open(url,'mvs_vizualize');
}
if (data.success && data.filepath) {
console.log(data.filepath);
// Build a short and readable URL for the map
var filePathWithNoXmlExtension = data.filepath;
if (filePathWithNoXmlExtension.endsWith(".xml")) {
filePathWithNoXmlExtension = filePathWithNoXmlExtension.substring(0, filePathWithNoXmlExtension.length-4);
}
var url = _conf.mviewer_instance + '#' + filePathWithNoXmlExtension;
window.open(url,'mvs_vizualize');
}
}

},
Expand Down

0 comments on commit c0c1caa

Please sign in to comment.