File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -479,6 +479,39 @@ Returns the [`PlacesService`](google.maps.places.PlacesService) class to use dir
479479google .maps .places .PlacesService
480480```
481481
482+ ### useElevationService
483+
484+ React hook to use the [ Elevation Service] ( https://developers.google.com/maps/documentation/javascript/elevation ) in any component.
485+
486+ #### Usage
487+
488+ ``` jsx
489+ import React from ' react' ;
490+ import {useElevationService } from ' @ubilabs/google-maps-react-hooks' ;
491+
492+ const MyComponent = () => {
493+ const elevator = useElevationService ();
494+
495+ elevator? .getElevationForLocations (
496+ {locations: [location]},
497+ (results : google .maps .ElevationResult []) => {
498+ // Do something with results
499+ }
500+ );
501+
502+ return (... );
503+ };
504+ ` ` `
505+
506+ #### Return value
507+
508+ Returns the [` ElevationService` ](google.maps.places.ElevationService) class to use directly.
509+
510+ ` ` ` TypeScript
511+ google .maps .places .ElevationService
512+ ` ` `
513+
514+
482515## Publish (only for maintainers)
483516
484517` npm publish -- access public `
You can’t perform that action at this time.
0 commit comments