Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to set preserveDrawingBuffer in the options #199

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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