gi-nx / updateLayer
ts
function updateLayer(layerPatch: Omit<Partial<LayerPost> & {
id: number;
}, "vector_source">): Promise<
| void
| EsriSceneServerLayer
| LayerWithGiraffeStyle<
| MapboxStyleLayer
| MapboxStyleLayer[]>
| LayerWithMapboxStyle<
| MapboxStyleLayer
| MapboxStyleLayer[]>>;Update a layer's configuration (excluding vector source).
Parameters
| Parameter | Type | Description |
|---|---|---|
layerPatch | Omit<Partial<LayerPost> & { id: number; }, "vector_source"> | LayerPatch object with updated properties |
Returns
Promise< | void | EsriSceneServerLayer | LayerWithGiraffeStyle< | MapboxStyleLayer | MapboxStyleLayer[]> | LayerWithMapboxStyle< | MapboxStyleLayer | MapboxStyleLayer[]>>
Promise that resolves when the update is complete
Example
typescript
rpc.invoke("updateLayer", [{
id: "layer-123",
name: "Updated Layer Name",
visibility: true
}]);