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.
This has two nice consequences that can be seen in the wms-image.js and mapbuide-untiled.js examples:
* no images are requested when you browse outside of the layer extent
* when the layer extent is within the viewport extent, cached images are used since the intersecting extent is the same for multiple viewport extents
This adds a new ol.source.MapGuide class that is initialized with an options object that can contain the following values:
- projection: The projection of the Map Definition in EPSG format
- url: The mapagent URL
- useOverlay: Determines whether the GETMAPIMAGE (false) or GETDYNAMICMAPOVERLAYIMAGE (true) will be used for requesting the map image. When using GETMAPIMAGE, you must include a valid MAPDEFINITION parameter in the 'params' option property. When using GETDYNAMICMAPOVERLAYIMAGE, you must include a valid SESSION and MAPNAME parameters in the 'params' option property.
- metersPerUnit: A required value used for calculating the map scale needed by the image request. This value can be calculated using the MapGuide Web API or obtained through the new CREATERUNTIMEMAP operation in MapGuide Open Source 2.6
- params: A set of key-value pairs to append to the mapagent request
- extent: The bounds of the layer
An example is included to demonstrate this new layer source. Like ol2, this example uses the MapGuide Server on data.mapguide.com