xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Neumann <neum...@karto.baug.ethz.ch>
Subject problems with getURL in CVS build
Date Fri, 11 Feb 2005 11:26:53 GMT
Hi all,

in my mapping applications I make extensive use of getURL() to load map 
data to the current map extent. I don't load complete XML files, but 
just chunks of SVG or XML.

It worked fine in the Batik 1.5.1 official release, but does not work in 
the current CVS version. I don't know why. Using the debugger, I see 
that in the callback function of getURL() it returns data.success with 
"false" which was not the case in the 1.5.1 release (there it returned 

Here is my JS code:

function getLayers() {
        myMainMap.nrLayerToLoad = 0;
        for (i=0;i<myMainMap.dynamicLayers.length;i++) {
                if (myMainMap.dynamicLayers[i].value == "yes") {
                        if (myMainMap.nrLayerToLoad == 1) {
                        var myUrlString = 

+ myMainMap.curHeight)* 

* -1);

//add the geometry to the application
//note that empty groups in the main-map have to exist
function addGeom(data) {
        if(data.success) {
                var node = parseXML(data.content, document);
                var curDynLayer = 
                var myGeometryToAdd = document.getElementById(curDynLayer);
                if (myMainMap.dynamicLayers[curDynLayer].loaded == "yes") {
                        var tempGeometry = 
                //call function to place names
                if (curDynLayer == "elevation") {
                myMainMap.dynamicLayers[curDynLayer].loaded = "yes";
                if (myMainMap.nrLayerToLoad < 0) {
                        alert("error: this shouldn't be happening...! 
layercontext: "+curDynLayer);
                if (myMainMap.nrLayerToLoad == 0) {
                var myStatusString = 
                statusChange("loaded "+myStatusString+" elements for 
layer "+curDynLayer+"!");
                window.setTimeout("statusChange('map ready')",3000);
        else {
                alert("something went wrong with dynamic loading of 

The full code is available at 
http://www.carto.net/williams/yosemite/loaddata.js - the application is 
available at http://www.carto.net/williams/yosemite/loaddata.js - if you 
use the debugger, you'll see that in the file "loaddata.js" in the 
function "addGeom(data)" that "data.success" evaluates to false.

Did something in Batik change or is it a matter of wrong document 
encoding? Do I need to load full XML documents including a valid XML 
header instead of just "chunks"?

Thanks for any idea what might be wrong here.


Andreas Neumann - Department of Cartography 
Swiss Federal Institute of Technology (ETH) 
ETH Hoenggerberg, CH-8093  Zurich, Switzerland 
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153 
e-mail: neumann@karto.baug.ethz.ch 
www: http://www.carto.net/neumann/ 
SVG.Open: http://www.svgopen.org/ 
Carto.net: http://www.carto.net/

To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

View raw message