@abi-software/flatmap-viewer 2.2.1-beta.3 → 2.2.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.rst +1 -1
- package/package.json +1 -1
- package/src/layers.js +6 -3
- package/src/styling.js +2 -2
package/README.rst
CHANGED
|
@@ -38,7 +38,7 @@ The map server endpoint is specified as ``MAP_ENDPOINT`` in ``src/main.js``. It
|
|
|
38
38
|
Package Installation
|
|
39
39
|
====================
|
|
40
40
|
|
|
41
|
-
* ``npm install @abi-software/flatmap-viewer@2.2.1-beta.
|
|
41
|
+
* ``npm install @abi-software/flatmap-viewer@2.2.1-beta.4``
|
|
42
42
|
|
|
43
43
|
Documentation
|
|
44
44
|
-------------
|
package/package.json
CHANGED
package/src/layers.js
CHANGED
|
@@ -152,15 +152,18 @@ export class LayerManager
|
|
|
152
152
|
this.__activeLayers = [];
|
|
153
153
|
this.__activeLayerNames = [];
|
|
154
154
|
this.__rasterLayers = [];
|
|
155
|
+
const layerOptions = flatmap.options.layerOptions;
|
|
156
|
+
const fcDiagram = ('style' in layerOptions && layerOptions.style == 'fcdiagram');
|
|
155
157
|
const backgroundLayer = new style.BackgroundLayer();
|
|
156
|
-
if (
|
|
158
|
+
if (fcDiagram) {
|
|
159
|
+
this.__map.addLayer(backgroundLayer.style('black', 1));
|
|
160
|
+
}
|
|
161
|
+
else if ('background' in flatmap.options) {
|
|
157
162
|
this.__map.addLayer(backgroundLayer.style(flatmap.options.background));
|
|
158
163
|
} else {
|
|
159
164
|
this.__map.addLayer(backgroundLayer.style('white'));
|
|
160
165
|
}
|
|
161
166
|
// Add the map's layers
|
|
162
|
-
const layerOptions = flatmap.options.layerOptions;
|
|
163
|
-
const fcDiagram = ('style' in layerOptions && layerOptions.style == 'fcdiagram');
|
|
164
167
|
if (fcDiagram && flatmap.details['image_layer']) {
|
|
165
168
|
for (const layer of flatmap.layers) {
|
|
166
169
|
for (const raster_layer_id of layer['image-layers']) {
|
package/src/styling.js
CHANGED
|
@@ -674,14 +674,14 @@ export class BackgroundLayer
|
|
|
674
674
|
return this.__id;
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
-
style(backgroundColour)
|
|
677
|
+
style(backgroundColour, opacity=0.1)
|
|
678
678
|
{
|
|
679
679
|
return {
|
|
680
680
|
'id': this.__id,
|
|
681
681
|
'type': 'background',
|
|
682
682
|
'paint': {
|
|
683
683
|
'background-color': backgroundColour,
|
|
684
|
-
'background-opacity':
|
|
684
|
+
'background-opacity': opacity
|
|
685
685
|
}
|
|
686
686
|
};
|
|
687
687
|
}
|