Commit bf2da0e3 authored by Caillat Michel's avatar Caillat Michel
Browse files

Take into account the urlRoot

parent b629a2f6
......@@ -857,7 +857,7 @@ var SAMPPNGPublishControl = (function (Control) {
_im_layer_1 = new ol.layer.Image({
source: new ol.source.ImageStatic({
url : window.location.origin+"/"+path_to_png,
url : "<%=urlRoot%>"+"/"+path_to_png,
projection: _projection_1,
imageExtent: _extent,
imageLoadFunction: _imageLoadFunction_1})
......@@ -907,7 +907,7 @@ var SAMPPNGPublishControl = (function (Control) {
}
_im_layer_2 = new ol.layer.Image({
source : new ol.source.ImageStatic({
url: window.location.origin+"/"+path_to_png,
url: "<%=urlRoot%>"+"/"+path_to_png,
projection : _projection_2,
imageExtent: _extent,
imageLoadFunction: _imageLoadFunction_2
......
......@@ -658,21 +658,9 @@ var _marker_styles_f = function(feature) {
_map_1.removeLayer(_box_layer_1);
_map_1.removeLayer(_marker_layer_1);
}
console.log("pathname="+window.location.pathname.split("/"));
console.log(window.location.pathname);
// Tricky part for situation where the actual server is reached
// by a redirection ( e.g. artemix.obspm.fr/fits/visit for
// juliette.obspm.fr:3021/visit
// This should be improved !
var imageURL = window.location.origin;
var pathname_a = window.location.pathname.split("/");
if (pathname_a.length > 3) {
imageURL += "/" + pathname_a[1];
}
imageURL += "/"+path_to_png;
console.log("Image's URL is " + imageURL);
_im_layer_1 = new ol.layer.Image({
var imageURL = "<%=urlRoot%>/"+path_to_png;
console.log("Image's URL is " + imageURL);
_im_layer_1 = new ol.layer.Image({
source: new ol.source.ImageStatic({
url : imageURL,
projection: _projection_1,
......
......@@ -33,14 +33,13 @@
<script type="text/javascript">
$( document ).ready(function(){
console.log(window.location.href);
document.getElementById("loading").style="block";
$.post("setData", {"fileName": "<%=path_to_fits%>"}).done(function (resp){
if (resp["status"]==false) {
alert (resp["message"]);
}
else {
document.location.replace("?path="+"<%=path_to_fits%>");
document.location.replace("<%=urlRoot%>/visit/?path=<%=path_to_fits%>");
}
document.getElementById("loading").style="none";
});
......
Supports Markdown
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