Skip to content

Commit

Permalink
Merge pull request #71 from Flexberry/fix-multiclasses-gml3
Browse files Browse the repository at this point in the history
Change multiclasses toGml to gml3 syntax. fix #41
  • Loading branch information
DubrovinPavel authored Feb 28, 2018
2 parents e00ea8d + ec44282 commit 347da78
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions spec/GML/MultiPolygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ describe("L.MultiPolygon.toGml()", function () {
members = multiGml.firstChild;
});

it('should return Element object with tagName gml:MultiPolygon', function () {
it('should return Element object with tagName gml:MultiSurface', function () {
expect(multiGml).to.be.instanceOf(Element);
expect(multiGml.tagName).to.be.equal('gml:MultiPolygon');
expect(multiGml.tagName).to.be.equal('gml:MultiSurface');
});

it('should have first child element gml:polygonMembers', function () {
expect(members.tagName).to.be.equal('gml:polygonMembers');
it('should have first child element gml:surfaceMembers', function () {
expect(members.tagName).to.be.equal('gml:surfaceMembers');
});

it('should have 3 child nodes of members', function () {
Expand Down
8 changes: 4 additions & 4 deletions spec/GML/MultiPolyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ describe("L.MultiPolyline.toGml()", function () {
members = multiGml.firstChild;
});

it('should return Element object with tagName gml:MultiLineString ', function () {
it('should return Element object with tagName gml:MultiCurve', function () {
expect(multiGml).to.be.instanceOf(Element);
expect(multiGml.tagName).to.be.equal('gml:MultiLineString');
expect(multiGml.tagName).to.be.equal('gml:MultiCurve');
});

it('should have first child element gml:lineStringMembers', function () {
expect(members.tagName).to.be.equal('gml:lineStringMembers');
it('should have first child element gml:curveMembers', function () {
expect(members.tagName).to.be.equal('gml:curveMembers');
});

it('should have 3 child nodes of members', function () {
Expand Down
4 changes: 2 additions & 2 deletions spec/GML/Polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ describe("L.Polygon.toGml()", function () {
polygonGml = polygon.toGml(L.CRS.Simple, true);
});

it('should return Element object with tagName gml:MultiPolygon', function () {
it('should return Element object with tagName gml:MultiSurface', function () {
expect(polygonGml).to.be.instanceOf(Element);
expect(polygonGml.tagName).to.be.equal('gml:MultiPolygon');
expect(polygonGml.tagName).to.be.equal('gml:MultiSurface');
});
});
});
8 changes: 4 additions & 4 deletions spec/GML/Polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ describe("L.Polyline.toGml()", function () {
polylineGml = collectionGml.firstChild;
});

it('should return Element object with tagName gml:MultiLineString', function () {
it('should return Element object with tagName gml:MultiCurve', function () {
expect(multiGml).to.be.instanceOf(Element);
expect(multiGml.tagName).to.be.equal('gml:MultiLineString');
expect(multiGml.tagName).to.be.equal('gml:MultiCurve');
});

it('should have child Element with tagName gml:lineStringMembers', function () {
expect(collectionGml.tagName).to.be.equal('gml:lineStringMembers');
it('should have child Element with tagName gml:curveMembers', function () {
expect(collectionGml.tagName).to.be.equal('gml:curveMembers');
});

it('gml:lineStringMembers should have child Element with tagName gml:LineString', function () {
Expand Down
4 changes: 2 additions & 2 deletions src/GML/Polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ L.Polygon.include({
if (gmlPolygons.length === 1 && !forceMulti) return gmlPolygons[0];

// else make multipolygon
var multi = L.XmlUtil.createElementNS('gml:MultiPolygon', {srsName: crs.code, srsDimension: 2});
var collection = multi.appendChild(L.XmlUtil.createElementNS('gml:polygonMembers'));
var multi = L.XmlUtil.createElementNS('gml:MultiSurface', {srsName: crs.code, srsDimension: 2});
var collection = multi.appendChild(L.XmlUtil.createElementNS('gml:surfaceMembers'));
for (var p = 0; p < gmlPolygons.length; p++) {
collection.appendChild(gmlPolygons[p]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/GML/Polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ L.Polyline.include({
return gmlElements[0];
}

var multi = L.XmlUtil.createElementNS('gml:MultiLineString', {srsName: crs.code, srsDimension: 2});
var collection = multi.appendChild(L.XmlUtil.createElementNS('gml:lineStringMembers'));
var multi = L.XmlUtil.createElementNS('gml:MultiCurve', {srsName: crs.code, srsDimension: 2});
var collection = multi.appendChild(L.XmlUtil.createElementNS('gml:curveMembers'));
for (var lines = 0; lines < gmlElements.length; lines++) {
collection.appendChild(gmlElements[lines]);
}
Expand Down

0 comments on commit 347da78

Please sign in to comment.