GoogleMap
A wrapper around the React Google Maps Component with styles applied. The following components are available in addition to map component:
- Autocomplete
CircleMarkerInfoWindowPolygonPolylineRectangleMarkerClustererSearchBoxStandaloneSearchBox
This map component requires that the Google Maps library be included in the <head> your HTML with a valid API key.
NOTE: If you want to have restrictions (postal_code, country) please use <Autocomplete /> Component instead of
<Searchbox />
For restriction options in <Autocomplete /> pass options prop.
const options = {types: ['(cities)'],componentRestrictions: {country: 'fr'}};
For types option you can't allow multiple restrictions
As Autocomplete for places and addresses states in general only a single type is allowed. The exception is that you can safely mix the geocode and establishment types, but note that this will have the same effect as specifying no types
Examples
Standard Map
Markers
Polygons
MapDraw
Before importing add drawing to the libraries from where you reference google API URL
Import MapDraw from real-react and place inside your GoogleMap
onComplete - Callback function executed when the drawing is complete to handle coordinates
mode - POLYGON by Default. Choose from CIRCLE, POLYGON,POLYLINE, RECTANGLE