When parsing GML then conversion of properties containing XML attributes
to objects with a _content_ property must occur before the handling of
multiple attributes (conversion/adding to an array), as otherwise the
_content_ property and attributes are set on the array and not on the
array element.
Prior to this change, only multiple properties without attributes could
be correctly parsed.
Example problemeatic GML section:
<Link xlink:href="http://example.com/a"/>
<Link xlink:href="http://example.com/b"/>
Resulting property as JSON extract after this change:
{
"Link": [
{
"_content_": undefined,
"xlink:href": "http://example.com/a",
},
{
"_content_": undefined,
"xlink:href": "http://example.com/b"
}
]
}
Prior to this change, the _content_ property and the properties for the
XML attributes would be set on the resulting JS Array object, with
previous entries being represented as nested arrays.
This updates ESLint and our shared eslint-config-openlayers to use Prettier. Most formatting changes were automatically applied with this:
npm run lint -- --fix
A few manual changes were required:
* In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
* In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason. While editing this, I reworked `ExampleBuilder` to be a class.
* In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.