mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
Fix PNG exporter.
This commit is contained in:
parent
1256d0e218
commit
7e59b19fc0
@ -213,14 +213,10 @@ public class ExporterFactory {
|
|||||||
int index = imgUrl.lastIndexOf("/");
|
int index = imgUrl.lastIndexOf("/");
|
||||||
elem.removeAttribute("href");
|
elem.removeAttribute("href");
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
final String iconName = imgUrl.substring(index+1);
|
final String iconName = imgUrl.substring(index + 1);
|
||||||
// Hack for backward compatibility . This can be removed in 2012. :)
|
// Hack for backward compatibility . This can be removed in 2012. :)
|
||||||
String imgPath;
|
String imgPath;
|
||||||
if (imgUrl.contains("images")) {
|
imgPath = imgBaseUrl + "/" + imgUrl;
|
||||||
imgPath = imgBaseUrl + "/../icons/legacy/" + iconName;
|
|
||||||
} else {
|
|
||||||
imgPath = imgBaseUrl + "/" + imgUrl;
|
|
||||||
}
|
|
||||||
elem.setAttribute("xlink:href", imgPath);
|
elem.setAttribute("xlink:href", imgPath);
|
||||||
elem.appendChild(document.createTextNode(" "));
|
elem.appendChild(document.createTextNode(" "));
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ public class TransformView extends AbstractView {
|
|||||||
response.setContentType(contentType);
|
response.setContentType(contentType);
|
||||||
|
|
||||||
// Set file name...
|
// Set file name...
|
||||||
final String fileName = (filename != null ? filename : "map" + ".") + exportFormat.getFileExtension();
|
final String fileName = (filename != null ? filename : "map") + "." + exportFormat.getFileExtension();
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||||
|
|
||||||
// Write content ...
|
// Write content ...
|
||||||
@ -79,7 +79,7 @@ public class TransformView extends AbstractView {
|
|||||||
baseUrl = "http://www.wisemapping.com/images";
|
baseUrl = "http://www.wisemapping.com/images";
|
||||||
} else {
|
} else {
|
||||||
final ServletContext servletContext = this.getServletContext();
|
final ServletContext servletContext = this.getServletContext();
|
||||||
baseUrl = "file://" + servletContext.getRealPath("/icons/") + "/";
|
baseUrl = "file://" + servletContext.getRealPath("/");
|
||||||
}
|
}
|
||||||
properties.setBaseImagePath(baseUrl);
|
properties.setBaseImagePath(baseUrl);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user