diff --git a/python/ipyleaflet/ipyleaflet/leaflet.py b/python/ipyleaflet/ipyleaflet/leaflet.py index 0aab6c48..fc4ac335 100644 --- a/python/ipyleaflet/ipyleaflet/leaflet.py +++ b/python/ipyleaflet/ipyleaflet/leaflet.py @@ -1114,7 +1114,7 @@ class VectorTileLayer(Layer): Engine for rendering VectorTileLayers; either 'canvas' or 'svg'. Use 'svg' for interactive layers. interactive: boolean, default False Whether the layer is interactive or not. - get_feature_id: string, default None + feature_id: string, default None Optional attribute name of a unique feature identifier. """ @@ -1133,7 +1133,7 @@ class VectorTileLayer(Layer): min_native_zoom = Int(default_value=None, allow_none=True).tag(sync=True, o=True) max_native_zoom = Int(default_value=None, allow_none=True).tag(sync=True, o=True) renderer = Unicode('svg').tag(sync=True, o=True) - get_feature_id = Unicode(allow_none=True, default_value=None).tag(sync=True, o=True) + feature_id = Unicode(allow_none=True, default_value=None).tag(sync=True, o=True) feature_style = Dict().tag(sync=True) def redraw(self): diff --git a/python/jupyter_leaflet/src/layers/VectorTileLayer.ts b/python/jupyter_leaflet/src/layers/VectorTileLayer.ts index 07c32d07..083647ae 100644 --- a/python/jupyter_leaflet/src/layers/VectorTileLayer.ts +++ b/python/jupyter_leaflet/src/layers/VectorTileLayer.ts @@ -21,7 +21,7 @@ export class LeafletVectorTileLayerModel extends LeafletLayerModel { visible: true, opacity: 1.0, rendererFactory: L.svg.tile, - get_feature_id: null, + getFeatureId: null, }; } } @@ -34,8 +34,8 @@ export class LeafletVectorTileLayerView extends LeafletLayerView { ...this.get_options(), }; - if ('getFeatureId' in options) { - let idVar = options['getFeatureId']; + if ('featureId' in options) { + let idVar = options['featureId']; options['getFeatureId'] = function (feat: any) { return feat.properties[idVar]; };