Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 822 Bytes

useMaxZoomService.md

File metadata and controls

34 lines (25 loc) · 822 Bytes

useMaxZoomService Hook

React hook to use the Maximum Zoom Imagery Service in any component.

Usage

import React, {useEffect} from 'react';
import {useMaxZoomService} from '@ubilabs/google-maps-react-hooks';

const MyComponent = () => {
  const maxZoomService = useMaxZoomService();
  const location = /** google.maps.LatLng */;

  useEffect(() => {
    maxZoomService?.getMaxZoomAtLatLng(
      location,
      (result: google.maps.MaxZoomResult) => {
        // Do something with result
      }
    );
  }, [location]);

  return (...);
};

Return value

Returns a Max Zoom Service instance to use directly.

google.maps.MaxZoomService