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

Add fetch_options for VectorTileLayer #1097

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 ipyleaflet/leaflet.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,8 @@ class VectorTileLayer(Layer):
Vector tile service attribution.
vector_tile_layer_styles: dict, default {}
CSS Styles to apply to the vector data.
fetch_options: dict, default {}
Options passed to `fetch`, e.g. {credentials: 'same-origin'} to send cookie for the current domain.
"""

_view_name = Unicode('LeafletVectorTileLayerView').tag(sync=True)
Expand All @@ -973,6 +975,8 @@ class VectorTileLayer(Layer):

vector_tile_layer_styles = Dict().tag(sync=True, o=True)

fetch_options = Dict().tag(sync=True, o=True)

def redraw(self):
"""Force redrawing the tiles.

Expand Down
1 change: 1 addition & 0 deletions js/src/layers/VectorTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class LeafletVectorTileLayerModel extends layer.LeafletLayerModel {
_model_name: 'LeafletVectorTileLayerModel',
url: '',
vectorTileLayerStyles: {},
fetchOptions: {},
};
}
}
Expand Down