Google Maps Setup
To enable location-based features in your web application, you need to set up Google Maps API. Follow these steps to configure it properly.
Obtaining a Google Maps API Key
- Visit the Google Cloud Console
- Create a new project or select an existing one
- Navigate to the APIs & Services > Credentials section
- Click "Create Credentials" and select "API Key"
- Restrict the API key for better security (optional but recommended)
- Copy your newly created API key
Adding the API Key to Your Project
- Open the
.env
file in your project's root directory - Locate the Google Maps API key variable
- Paste your API key into this variable
Enabling Required Google APIs
For full functionality, you'll need to enable these Google APIs for your project:
- Maps JavaScript API
- Places API
- Geocoding API
- Geolocation API
To enable these APIs:
- In the Google Cloud Console, go to "APIs & Services" > "Library"
- Search for each API listed above
- Select each API and click "Enable"
Verifying Setup
After configuring your Google Maps API key:
- Restart your development server
- Check if maps are displaying correctly in your application
- Test location-based features like property search by location
If you encounter any issues, verify that:
- Your API key is correctly entered in the
.env
file - You've enabled all required APIs
- Your billing is set up correctly on Google Cloud (required for API usage)