Skip to content

Commit

Permalink
change tilelayer to layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nour-Cheour10 committed Jun 20, 2024
1 parent 783e2be commit 3f85855
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5da4fa87ae3a4510b192c084a26a17d8",
"model_id": "d95b89900bc74b67a5364dc07061bda7",
"version_major": 2,
"version_minor": 0
},
Expand Down
12 changes: 6 additions & 6 deletions src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
unpack_models,
ViewList,
} from '@jupyter-widgets/base';
import { TileLayerModel, TileLayerView } from './tilelayer';
import { LayerModel, LayerView } from './layer';
import { BaseOverlayModel, BaseOverlayView } from './baseoverlay';
import { BaseControlModel, BaseControlView } from './basecontrol';
import { ViewObjectEventTypes } from 'ol/View';
Expand Down Expand Up @@ -124,7 +124,7 @@ export class MapView extends DOMWidgetView {
}

layersChanged() {
const layers = this.model.get('layers') as TileLayerModel[];
const layers = this.model.get('layers') as LayerModel[];
this.layerViews.update(layers);
}

Expand Down Expand Up @@ -152,7 +152,7 @@ export class MapView extends DOMWidgetView {
}
}

removeLayerView(child_view: TileLayerView) {
removeLayerView(child_view: LayerView) {
this.map.removeLayer(child_view.obj);
child_view.remove();
}
Expand All @@ -169,8 +169,8 @@ export class MapView extends DOMWidgetView {
child_view.remove();
}

async addLayerModel(child_model: TileLayerModel) {
const view = await this.create_child_view<TileLayerView>(child_model, {
async addLayerModel(child_model: LayerModel) {
const view = await this.create_child_view<LayerView>(child_model, {
map_view: this,
});
this.map.addLayer(view.obj);
Expand Down Expand Up @@ -209,7 +209,7 @@ export class MapView extends DOMWidgetView {
imageElement: HTMLImageElement;
mapContainer: HTMLDivElement;
map: Map;
layerViews: ViewList<TileLayerView>;
layerViews: ViewList<LayerView>;
overlayViews: ViewList<BaseOverlayView>;
controlViews: ViewList<BaseControlView>;
}

0 comments on commit 3f85855

Please sign in to comment.