diff --git a/README.md b/README.md index 84fb2da..f3890f1 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,10 @@ L.esri.Vector.vectorTileLayer("SERVICE_URL", { // (this may not be necessary when specifying a SERVICE_URL) portalUrl: "https://www.arcgis.com", // default value + // optional: set by default to `false` for performance reasons + // set to `true` to resolve WebGL printing issues in Firefox + preserveDrawingBuffer: false, // default value + // optional: customize the style with a function that gets the default style from the service // and returns the new style to be used style: (style) => { diff --git a/src/VectorTileLayer.js b/src/VectorTileLayer.js index fe98b0b..72d2510 100644 --- a/src/VectorTileLayer.js +++ b/src/VectorTileLayer.js @@ -5,7 +5,10 @@ import { maplibreGLJSLayer } from './MaplibreGLLayer'; export var VectorTileLayer = Layer.extend({ options: { // if portalUrl is not provided, default to ArcGIS Online - portalUrl: 'https://www.arcgis.com' + portalUrl: 'https://www.arcgis.com', + // for performance optimization default to `false` + // set to `true` to resolve printing issues in Firefox + preserveDrawingBuffer: false }, /** @@ -100,7 +103,8 @@ export var VectorTileLayer = Layer.extend({ this._maplibreGL = maplibreGLJSLayer({ style: style, pane: this.options.pane, - opacity: this.options.opacity + opacity: this.options.opacity, + preserveDrawingBuffer: this.options.preserveDrawingBuffer }); this._ready = true;