Skip to content

Commit

Permalink
Merge pull request #199 from sheeley820/preserve-drawing-buffer-option
Browse files Browse the repository at this point in the history
Allow users to set preserveDrawingBuffer in the options
  • Loading branch information
gavinr-maps committed Oct 6, 2023
2 parents b9ec056 + 5bd9535 commit 5e6aa8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
8 changes: 6 additions & 2 deletions src/VectorTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
},

/**
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5e6aa8c

Please sign in to comment.