File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -485,19 +485,22 @@ React hook to use the [Maximum Zoom Imagery Service](https://developers.google.c
485485
486486#### Usage
487487
488- ``` jsx
489- import React from ' react' ;
488+ ``` tsx
489+ import React , { useEffect } from ' react' ;
490490import {useMaxZoomService } from ' @ubilabs/google-maps-react-hooks' ;
491491
492492const MyComponent = () => {
493493 const maxZoomService = useMaxZoomService ();
494-
495- maxZoomService .getMaxZoomAtLatLng (
496- LatLng,
497- (result : google .maps .MaxZoomResult ) => {
498- // Do something with result
499- }
500- );
494+ const location = /** google.maps.LatLng */ ;
495+
496+ useEffect (() => {
497+ maxZoomService ?.getMaxZoomAtLatLng (
498+ location ,
499+ (result : google .maps .MaxZoomResult ) => {
500+ // Do something with result
501+ }
502+ );
503+ }, [location ]);
501504
502505 return (... );
503506};
You can’t perform that action at this time.
0 commit comments