[OpenLayers-Dev] Format.KML and maxDepth: NetworkLinks not working?

bartvde at osgis.nl bartvde at osgis.nl
Tue Dec 9 05:14:06 EST 2008


Hi list,

reading the Format.KML code it seems NetWorkLinks are not working right
now. Can anybody confirm this before I open up a ticket?

Since parseData puts in this.maxDepth as options.depth:

        // Set default options
        var options = {
            depth: this.maxDepth,
            styleBaseUrl: this.styleBaseUrl
        };

        return this.parseData(data, options);

the check in parseLinks will always return false:

    parseLinks: function(nodes, options) {
        // Fetch external links <NetworkLink> and <Link>
        // Don't do anything if we have reached our maximum depth for
recursion
        if (options.depth >= this.maxDepth) {
            return false;
        }

so no NetWorkLinks will be fetched regardless of the maxDepth value passed
in to the Format.KML constructor.

I think the code should read:

        // Set default options
        var options = {
            depth: 0,
            styleBaseUrl: this.styleBaseUrl
        };

but I might be mistaken ....

TIA.

Best regards,
Bart




More information about the Dev mailing list