-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add search options from the catalog When adding a WMS layer from the catalog, MapStore will try to get a describeLayer for it, to find out if the layer can be searched via WFS. If possible, the search object is added to the layer. * DescribeLayers is implemented to avoid ogc-schemas lib (old functionality has been mantained for backward compatibility, as describeLayer with require-ensure pattern. * Add tests for the JavaScript WMS API.
- Loading branch information
1 parent
5f75fae
commit 357e2e7
Showing
13 changed files
with
706 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* Copyright 2016, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
const expect = require('expect'); | ||
const API = require('../WMS'); | ||
|
||
describe('Test correctness of the WMS APIs', () => { | ||
it('describeLayers', (done) => { | ||
API.describeLayers('base/web/client/test-resources/wms/DescribeLayers.xml', "workspace:vector_layer").then((result) => { | ||
try { | ||
expect(result).toExist(); | ||
expect(result.length).toBe(2); | ||
expect(result[0].owsType).toBe("WFS"); | ||
done(); | ||
} catch(ex) { | ||
done(ex); | ||
} | ||
}); | ||
}); | ||
it('describeLayer with OGC-SCHEMAS', (done) => { | ||
API.describeLayer('base/web/client/test-resources/wms/DescribeLayers.xml', "workspace:vector_layer").then((result) => { | ||
try { | ||
expect(result).toExist(); | ||
expect(result.owsType).toBe("WFS"); | ||
done(); | ||
} catch(ex) { | ||
done(ex); | ||
} | ||
}); | ||
}); | ||
it('GetCapabilities 1.3.0', (done) => { | ||
API.getCapabilities('base/web/client/test-resources/wms/GetCapabilities-1.3.0.xml').then((result) => { | ||
try { | ||
expect(result).toExist(); | ||
expect(result.capability).toExist(); | ||
expect(result.version).toBe("1.3.0"); | ||
expect(result.capability.layer).toExist(); | ||
done(); | ||
} catch(ex) { | ||
done(ex); | ||
} | ||
}); | ||
}); | ||
it('GetCapabilities 1.1.1', (done) => { | ||
API.getCapabilities('base/web/client/test-resources/wms/GetCapabilities-1.1.1.xml').then((result) => { | ||
try { | ||
expect(result).toExist(); | ||
expect(result.capability).toExist(); | ||
expect(result.version).toBe("1.1.1"); | ||
expect(result.capability.layer).toExist(); | ||
done(); | ||
} catch(ex) { | ||
done(ex); | ||
} | ||
}); | ||
}); | ||
it('GetRecords', (done) => { | ||
API.getRecords('base/web/client/test-resources/wms/GetCapabilities-1.3.0.xml', 0, 1, '').then((result) => { | ||
try { | ||
expect(result).toExist(); | ||
expect(result.numberOfRecordsMatched).toBe(5); | ||
done(); | ||
} catch(ex) { | ||
done(ex); | ||
} | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE WMS_DescribeLayerResponse SYSTEM "http://some.geoserver.org:80/geoserver/schemas/wms/1.1.1/WMS_DescribeLayerResponse.dtd"> | ||
<WMS_DescribeLayerResponse version="1.1.1"> | ||
<LayerDescription name="workspace:vector_layer" wfs="http://some.geoserver.org:80/geoserver/wfs?" owsURL="http://some.geoserver.org:80/geoserver/wfs?" owsType="WFS"> | ||
<Query typeName="workspace:vector_layer"/> | ||
</LayerDescription> | ||
<LayerDescription name="workspace:raster_layer" owsURL="http://demo.geo-solutions.it:80/geoserver/wcs?" owsType="WCS"> | ||
<Query typeName="workspace:raster_layer"/> | ||
</LayerDescription> | ||
</WMS_DescribeLayerResponse> |
Oops, something went wrong.