OpenLayers OpenLayers

Changeset 2397

Show
Ignore:
Timestamp:
03/06/07 15:01:57 (2 years ago)
Author:
crschmidt
Message:

A couple API changes with bounds merge affected the GML parsing for polygons.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/vector-2.4/lib/OpenLayers/Format/GML.js

    r2392 r2397  
    3939         
    4040        // Process all the featureMembers 
    41         for (var i=0; i < featureNodes.length; i++) { 
     41        for (var i = 0; i < featureNodes.length; i++) { 
    4242            var feature = this.parseFeature(featureNodes[i]); 
    4343 
     
    8282             
    8383            for (var i = 0; i < lineStrings.length; i++) { 
    84                 p=this.parseCoords(lineStrings[i]); 
     84                p = this.parseCoords(lineStrings[i]); 
    8585                if(p.points){ 
    8686                    var lineString = new OpenLayers.Geometry.LineString(p.points); 
     
    153153        for(var i = 0; i < nodes.length; i++) { 
    154154            var name = nodes[i].nodeName; 
    155             var value=OpenLayers.Util.getXmlNodeValue(nodes[i]); 
     155            var value = OpenLayers.Util.getXmlNodeValue(nodes[i]); 
    156156            // Ignore Geometry attributes 
    157157            // match ".//gml:pos|.//gml:posList|.//gml:coordinates" 
     
    163163             
    164164            // Check for a leaf node 
    165             if((nodes[i].childNodes.length==1 && nodes[i].childNodes[0].nodeName=="#text") 
    166                 || (nodes[i].childNodes.length==0 && nodes[i].nodeName!="#text")) { 
     165            if((nodes[i].childNodes.length == 1 && nodes[i].childNodes[0].nodeName == "#text") 
     166                || (nodes[i].childNodes.length == 0 && nodes[i].nodeName!="#text")) { 
    167167                attributes[name] = value; 
    168168            } 
     
    190190            ring1.extendBounds(p.bounds); 
    191191            if (polyBounds) { 
    192                 polyBounds.extendBounds(p.bounds); 
     192                polyBounds.extend(p.bounds); 
    193193            } else { 
    194                 polyBounds=p.bounds; 
     194                polyBounds = p.bounds; 
    195195            } 
    196196            rings.push(ring1); 
     
    249249                nums.pop(); 
    250250             
    251             for(i=0; i < nums.length; i = i + this.dim) { 
     251            for(i = 0; i < nums.length; i = i + this.dim) { 
    252252                x = parseFloat(nums[i]); 
    253253                y = parseFloat(nums[i+1]); 
     
    255255                 
    256256                if (!p.bounds) { 
    257                     p.bounds=new OpenLayers.Bounds(x, y, x, y); 
     257                    p.bounds = new OpenLayers.Bounds(x, y, x, y); 
    258258                } else { 
    259                     p.bounds.extendBounds(x, y); 
     259                    p.bounds.extend(x, y); 
    260260                } 
    261261            }