|
|
@@ -1,5 +1,6 @@
|
|
|
// @require WFS_URL
|
|
|
if (!WFS_URL) throw "Missing WFS_URL"
|
|
|
+var DBG = DBG || false
|
|
|
|
|
|
// wfsFeature json format:
|
|
|
/*
|
|
|
@@ -26,9 +27,10 @@ function p5WFS_ParseFeatureFieldRecurse(tagNode) { // @returns object from xml e
|
|
|
// </p5:next></p5:links>
|
|
|
for (var j = 0; j < fieldNode.children.length; j++) {
|
|
|
var p5LinkNode = fieldNode.children[j]
|
|
|
- if ('p5:next') {
|
|
|
+ if ('p5:next' === p5LinkNode.tagName) {
|
|
|
var typeName = p5LinkNode.getAttribute('p5:typeName')
|
|
|
item[ typeName ].push( {
|
|
|
+ 'type': 'next',
|
|
|
'@backRefNS': p5LinkNode.getAttribute('p5:backRefNS'),
|
|
|
'@backRefPK': p5LinkNode.getAttribute('p5:backRefPK'),
|
|
|
'@typeName': p5LinkNode.getAttribute('p5:typeName'),
|
|
|
@@ -36,7 +38,7 @@ function p5WFS_ParseFeatureFieldRecurse(tagNode) { // @returns object from xml e
|
|
|
'value': p5LinkNode.textContent
|
|
|
} )
|
|
|
} else {
|
|
|
- // Not implemented
|
|
|
+ if (DBG) console.warn("Not implemented p5:links/" + p5LinkNode.tagName)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -146,6 +148,10 @@ function p5WFS_GetFeature(typeName, query) { // @returns Promise
|
|
|
throw 'Error - wrong syntax ogc:Filter'
|
|
|
}
|
|
|
}
|
|
|
+ if ('graphql:query' in query && 'string' === typeof query['graphql:query']) { // TODO: http://graphql.org/learn/queries/
|
|
|
+ link += '&outputFormat=json'
|
|
|
+ postData = query['graphql:query']
|
|
|
+ }
|
|
|
if ('sortBy' in query) link += '&sortBy=' + query['sortBy']
|
|
|
if ('maxFeatures' in query) link += '&maxFeatures=' + query['maxFeatures']
|
|
|
if ('count' in query) link += '&count=' + query['count']
|