Skip to content

Commit 108710d

Browse files
author
Stefan Kuethe
committed
Rename call.method to call.method_name
1 parent 8345e16 commit 108710d

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

examples/standalone/gpd_multiple_layers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import openlayers as ol
2-
from openlayers.basemaps import BasemapLayer
2+
from openlayers.basemaps import CartoBasemapLayer
33
from openlayers.styles import FlatStyle
44

55
# url = "https://openlayers.org/en/v4.6.5/examples/data/geojson/countries.geojson"
@@ -12,6 +12,6 @@
1212
# countries_layer = gpd.ol.to_layer(style=style, opacity=0.5)
1313
countries_layer = gpd.ol.color_category("name").to_layer(opacity=0.5, webgl=False)
1414

15-
m = ol.Map(layers=[BasemapLayer.carto()])
15+
m = ol.Map(layers=[CartoBasemapLayer()])
1616
m.add_layer(countries_layer)
1717
m.save()

src/openlayers/anywidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(
4949
AnyWidget.__init__(self, height=height, **kwargs)
5050

5151
def add_call(self, method_name: str, *args: Any) -> None:
52-
call = dict(method=method_name, args=args)
52+
call = dict(method_name=method_name, args=args)
5353
if self.created:
5454
return self.send(call)
5555

src/openlayers/js/openlayers.anywidget.js

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/openlayers/js/openlayers.standalone.js

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/openlayers/map.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ def initial_view_state(self):
4545

4646
# 'apply_call_to_map'
4747
def add_call(self, method_name: str, *args: Any) -> None:
48-
call = dict(method=method_name, args=args)
48+
call = dict(method_name=method_name, args=args)
4949
self.calls.append(call)
5050

5151
# 'apply_call_to_layer'
5252
def add_layer_call(self, layer_id: str, method_name: str, *args: Any):
53-
layer_call = dict(method=method_name, args=args)
53+
layer_call = dict(method_name=method_name, args=args)
5454
self.add_call("applyCallToLayer", layer_id, layer_call)
5555

5656
def add_view_call(self, method_name: str, *args: Any) -> None:
57-
view_call = dict(method=method_name, args=args)
57+
view_call = dict(method_name=method_name, args=args)
5858
self.add_call("applyCallToView", view_call)
5959

6060
def fit_bounds(self, bounds: tuple[float, float, float, float]) -> None:

srcjs/ipywidget-ts/anywidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function render({ model, el }: { model: AnyModel; el: HTMLElement }): void {
3737
for (let call of calls) {
3838

3939
// @ts-expect-error
40-
mapWidget[call.method](...call.args);
40+
mapWidget[call.method_name](...call.args);
4141
}
4242

4343
const map = mapWidget.getMap();
@@ -61,7 +61,7 @@ function render({ model, el }: { model: AnyModel; el: HTMLElement }): void {
6161

6262
try {
6363
// @ts-expect-error
64-
mapWidget[msg.method](...msg.args);
64+
mapWidget[msg.method_name](...msg.args);
6565
} catch (error) {
6666
console.log("error in anywidget msg call", error);
6767
}

srcjs/ipywidget-ts/map.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export default class MapWidget {
161161
console.log("run view method", view);
162162

163163
// @ts-expect-error
164-
view[call.method](...call.args)
164+
view[call.method_name](...call.args)
165165
}
166166

167167
// --- Layer methods
@@ -204,7 +204,7 @@ export default class MapWidget {
204204
const layer = this.getLayer(layerId);
205205

206206
// @ts-expect-error
207-
layer[call.method](...call.args)
207+
layer[call.method_name](...call.args)
208208
}
209209

210210
setSource(layerId: string, sourceDef: JSONDef): void {

srcjs/ipywidget-ts/standalone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const MAP_CONTAINER = "map";
1616
if (mapOptions.calls) {
1717
for (let call of mapOptions.calls as OLAnyWidgetCall[]) {
1818
// @ts-expect-error
19-
mapWidget[call.method](...call.args);
19+
mapWidget[call.method_name](...call.args);
2020
}
2121
}
2222
};

srcjs/ipywidget-ts/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ type TypeCatalogKey = keyof TypeCatalog;
4040

4141
// ...
4242
type OLAnyWidgetCall = {
43-
method: string;
43+
method_name: string;
4444
args: any[];
4545
}

0 commit comments

Comments
 (0)