Skip to content

Commit a8d267a

Browse files
committed
try to call hello world
1 parent 0328647 commit a8d267a

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

lonboard/_layer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
Union,
2222
)
2323

24+
import anywidget
2425
import ipywidgets
2526
import traitlets
2627
from arro3.core import Table
@@ -538,6 +539,10 @@ def _handle_anywidget_dispatch(
538539
self.on_msg(_handle_anywidget_dispatch)
539540
super().__init__(**kwargs) # type: ignore
540541

542+
@anywidget.experimental.command
543+
def helloworld(self, msg, buffers):
544+
return "hello world", buffers
545+
541546
_layer_type = traitlets.Unicode("bitmap-tile").tag(sync=True)
542547

543548
data = traitlets.Union(

lonboard/_map.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pathlib import Path
66
from typing import IO, TYPE_CHECKING, Optional, Sequence, TextIO, Union, overload
77

8+
import anywidget
89
import ipywidgets
910
import traitlets
1011
from ipywidgets.embed import embed_minimal_html
@@ -96,6 +97,10 @@ def __init__(
9697

9798
super().__init__(layers=layers, **kwargs)
9899

100+
@anywidget.experimental.command
101+
def helloworld(self, msg, buffers):
102+
return "hello world from top-level map component", buffers
103+
99104
_esm = bundler_output_dir / "index.js"
100105
_css = bundler_output_dir / "index.css"
101106

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/model/layer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,13 @@ export class BitmapTileModel extends BaseLayerModel {
284284
}
285285

286286
async getTileData(tile: TileLoadProps) {
287+
console.log("in getTileData");
287288
const { invoke } = this.anywidgetExperimental;
289+
288290
console.log(invoke);
291+
console.log("calling invoke");
289292
const out = await invoke("helloworld");
293+
console.log("returned from invoke");
290294
console.log(out);
291295

292296
// const { data, getTileData, fetch } = this.props;

0 commit comments

Comments
 (0)