Location Map

The Location Map component uses the Google API to add the Google Maps utility into any client-side application. You need a GoogleAPI key to work with the Location Map component. This key must be passed to the MapsContext.Provider component, which should wrap any Location component rendering.

MapsContext.Provider also supports customizing the map for a specific country or region by passing local language and region codes. If you set the language of the map, it's important to set the region to ensure that your application complies with local laws. By default, the map uses the user's preferred language setting as specified in the browser and region, defaulting to the region assigned to the user’s browser timezone offset.

Note: For security reasons, the following demos feature a development version of the Google Maps API that does not require an API key. Add protection to your API key by following the Google API key restriction guidelines.

The Location Map component provides the map view without an input field. By default, the map will center on the user's current location. Using this component independently from the Location Input component allows for greater control over the map's behavior.

When using the Location Map component, the location property becomes required. Also, any user interaction within the map will be directed through the onClick function, if provided.