-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added GeoTIFFTileLayer * ApiKey * Update Playwright Snapshots --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6e6212a
commit ed26819
Showing
10 changed files
with
166 additions
and
623 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) QuantStack | ||
// Distributed under the terms of the Modified BSD License. | ||
import { DOMWidgetModel, ISerializers } from '@jupyter-widgets/base'; | ||
import WebGLTileLayer from 'ol/layer/WebGLTile.js'; | ||
import GeoTIFF from 'ol/source/GeoTIFF.js'; | ||
import { MODULE_NAME, MODULE_VERSION } from './version'; | ||
import { LayerModel, LayerView } from './layer'; | ||
|
||
export class GeoTIFFTileLayerModel extends LayerModel { | ||
defaults() { | ||
return { | ||
...super.defaults(), | ||
_model_name: GeoTIFFTileLayerModel.model_name, | ||
_model_module: GeoTIFFTileLayerModel.model_module, | ||
_model_module_version: GeoTIFFTileLayerModel.model_module_version, | ||
_view_name: GeoTIFFTileLayerModel.view_name, | ||
_view_module: GeoTIFFTileLayerModel.view_module, | ||
_view_module_version: GeoTIFFTileLayerModel.view_module_version, | ||
source: [], | ||
}; | ||
} | ||
|
||
static serializers: ISerializers = { | ||
...DOMWidgetModel.serializers, | ||
// Add any extra serializers here | ||
}; | ||
|
||
static model_name = 'GeoTIFFTileLayerModel'; | ||
static model_module = MODULE_NAME; | ||
static model_module_version = MODULE_VERSION; | ||
static view_name = 'GeoTIFFTileLayerView'; | ||
static view_module = MODULE_NAME; | ||
static view_module_version = MODULE_VERSION; | ||
} | ||
|
||
export class GeoTIFFTileLayerView extends LayerView { | ||
render() { | ||
super.render(); | ||
this.sourcesChanged(); | ||
this.model.on('change:sources', this.sourcesChanged, this); | ||
} | ||
|
||
create_obj() { | ||
const sources = this.model.get('sources').map((source: any) => ({ | ||
url: source.url, | ||
})); | ||
|
||
this.obj = this.tileLayer = new WebGLTileLayer({ | ||
source: new GeoTIFF({ | ||
sources: sources, | ||
}), | ||
}); | ||
} | ||
|
||
sourcesChanged() { | ||
const newSources = this.model.get('sources').map((source: any) => ({ | ||
url: source.url, | ||
})); | ||
|
||
if (newSources) { | ||
const newSource = new GeoTIFF({ | ||
sources: newSources, | ||
}); | ||
this.tileLayer.setSource(newSource); | ||
} | ||
} | ||
|
||
tileLayer: WebGLTileLayer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+23 KB
(2000%)
...s/tests/ipyopenlayers.test.ts-snapshots/light-map-update-ipynb-cell-0-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-8.17 KB
(75%)
...s/tests/ipyopenlayers.test.ts-snapshots/light-map-update-ipynb-cell-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters