diff --git a/docs/maps/api-camera.md b/docs/maps/api-camera.md index e0b5d7f7..f78df51f 100644 --- a/docs/maps/api-camera.md +++ b/docs/maps/api-camera.md @@ -4,7 +4,7 @@ ### Listen to camera updates ``` -WA.camera.onCameraUpdate(callback: WasCameraUpdatedEventCallback): void +WA.camera.onCameraUpdate: Subscription ``` Listens to updates of the camera viewport. It will trigger for every update of the camera's properties (position or scale for instance). An event will be sent. @@ -19,5 +19,7 @@ The event has the following attributes : Example : ```javascript -WA.camera.onCameraUpdate((worldView) => console.log(worldView)); +WA.camera.onCameraUpdate.subscribe((worldView) => console.log(worldView)); +//later... +WA.camera.onCameraUpdate().unsubscribe(); ``` \ No newline at end of file