
FOB Google Maps Geocoding
FOB Google Maps Geocoding Plugin
πΊοΈ Enhance your property forms with intelligent address autocomplete and automatic coordinate generation!
This powerful plugin integrates Google Maps Places API and Geocoding API to provide seamless address input with automatic latitude/longitude population for property forms in Botble CMS.
β¨ Key Features
π― Smart Address Input
- Google Places Autocomplete: Real-time address suggestions as you type
- Instant Geocoding: Automatic coordinate population when selecting from dropdown
- Formatted Addresses: Clean, standardized address formatting from Google
- Global Coverage: Works worldwide with Google's comprehensive location database
π¨ Enhanced User Experience
- Beautiful UI: Custom-styled autocomplete dropdown with hover effects
- Responsive Design: Optimized for desktop and mobile devices
- Dark Mode Support: Automatically adapts to system color scheme
- Smooth Animations: Loading states and hover effects for better UX
βοΈ Flexible Configuration
- Admin Settings Panel: Easy configuration through Botble admin interface
- Toggle Features: Enable/disable autocomplete and auto-fill independently
- API Key Management: Secure API key storage and configuration
- Fallback Options: Manual geocoding button for custom addresses
π‘οΈ Robust & Reliable
- Error Handling: Graceful handling of API errors and edge cases
- Fallback Geocoding: Manual geocoding for addresses not in autocomplete
- Performance Optimized: Efficient API usage with smart caching
- Security: Proper API key restrictions and domain validation
π Installation
Step 1: Install the Plugin
# Copy the plugin to your Botble installation
cp -r fob-google-maps-geocoding platform/plugins/
# Activate the plugin
php artisan cms:plugin:activate fob-google-maps-geocoding
# Publish assets (CSS, JS files)
php artisan cms:plugin:assets:publish fob-google-maps-geocoding
# Clear cache
php artisan cache:clear
Step 2: Configure Google Maps API
π Get Your API Key
- Visit Google Cloud Console
- Create a new project or select an existing one
- Enable the required APIs:
- Geocoding API (Required)
- Places API (Required for autocomplete)
- Maps JavaScript API (Optional, for enhanced features)
π‘οΈ Secure Your API Key
- Create credentials (API Key)
- Restrict by HTTP referrers (websites):
yourdomain.com/* *.yourdomain.com/*
- Restrict by API: Select only the APIs you enabled above
Step 3: Plugin Configuration
-
Navigate to Settings:
Admin Panel β Settings β Others β FOB Google Maps Geocoding
-
Configure the Plugin:
- β API Key: Paste your Google Maps API key
- β Enable Geocoding: Turn on the plugin functionality
- β Auto-fill Coordinates: Enable automatic coordinate population
-
Save Settings and you're ready to go!
π How to Use
π Creating/Editing Properties
When you're in the property form (Create or Edit):
Method 1: Autocomplete (Recommended)
- π€ Start typing in the "Location" field
- π Select from dropdown: Choose an address from the suggestions
- β¨ Auto-population: Latitude and longitude fill automatically
- β Done! Your property now has precise coordinates
Method 2: Manual Entry
- β¨οΈ Type your address without selecting from dropdown
- π― Auto-geocoding: Coordinates populate when you leave the field (if enabled)
- π Manual button: Click "Get Coordinates" for on-demand geocoding
π¨ User Interface Features
Smart Autocomplete Dropdown
- π Real-time suggestions as you type
- π Global coverage with Google's location database
- π― Precise results with formatted addresses
- π±οΈ Hover effects for better interaction
- π± Mobile-friendly responsive design
Enhanced Button Design
- π Map pin icon with proper SVG graphics
- β³ Loading animation during geocoding
- π¨ Smooth hover effects and transitions
- π« Disabled state with visual feedback
Visual Feedback
- β Success notifications when coordinates are found
- β Error messages for failed requests
- π Loading states during API calls
- π Dark mode support for better accessibility
π§ Technical Features
API Integration
- Dual API Support: Uses both Places API and Geocoding API
- Smart Fallbacks: Geocoding API as backup for manual entries
- Error Handling: Graceful handling of API limits and errors
- Performance: Optimized API calls with debouncing
Browser Compatibility
- β Chrome 60+
- β Firefox 55+
- β Safari 12+
- β Edge 79+
- π± Mobile browsers (iOS Safari, Chrome Mobile)
π Requirements
System Requirements
- ποΈ Botble CMS: Version 7.5.0 or higher
- π Internet Connection: Required for API calls
- π» Modern Browser: JavaScript ES6+ support
Google Cloud Requirements
- π Google Cloud Account: Free tier available
- πΊοΈ Google Maps API Key with enabled APIs:
- Geocoding API (Required)
- Places API (Required)
- Maps JavaScript API (Optional)
API Quotas & Pricing
- π Places API: $17 per 1,000 requests (first 1,000/month free)
- π Geocoding API: $5 per 1,000 requests (first 40,000/month free)
- π‘ Tip: Set up billing alerts and quotas in Google Cloud Console
π§ Troubleshooting
Common Issues & Solutions
π« "API request denied" Error
β Problem: API key is invalid or restricted
β
Solution:
1. Check your API key in Google Cloud Console
2. Ensure APIs are enabled (Geocoding + Places)
3. Verify domain restrictions match your site
π« "Quota exceeded" Error
β Problem: You've hit your API usage limits
β
Solution:
1. Check usage in Google Cloud Console
2. Increase quotas or upgrade billing plan
3. Implement request caching if needed
π« Autocomplete Not Working
β Problem: Dropdown doesn't appear when typing
β
Solution:
1. Ensure Places API is enabled
2. Check browser console for JavaScript errors
3. Verify plugin is activated and assets published
4. Clear browser cache and try again
π« Coordinates Not Populating
β Problem: Lat/lng fields remain empty
β
Solution:
1. Check if "Auto-fill Coordinates" is enabled
2. Verify Geocoding API is enabled
3. Try clicking "Get Coordinates" button manually
4. Check browser console for errors
Debug Mode
Enable debug mode to see detailed error messages:
// Add to browser console for debugging
window.GoogleMapsGeocodingConfig.debug = true;
β FAQ
General Questions
Q: Does this work with other form types besides properties? A: Currently optimized for PropertyForm, but can be extended to other forms with minor modifications.
Q: Can I customize the autocomplete behavior? A: Yes! The plugin supports various Google Places API options. Contact support for customization.
Q: Does it work offline? A: No, internet connection is required for Google Maps API calls.
Q: Is there a rate limit? A: Yes, Google Maps APIs have usage quotas. See pricing section above.
Technical Questions
Q: Can I use my existing Google Maps API key? A: Yes, as long as it has Geocoding and Places APIs enabled.
Q: Does it support multiple languages? A: Yes, Google Places API returns results in the user's browser language automatically.
Q: Can I restrict results to specific countries? A: Yes, this can be configured in the Google Places API options.
Q: Is the plugin GDPR compliant? A: The plugin itself doesn't store personal data, but Google's APIs may. Review Google's privacy policy.
π€ Support & Contributing
Getting Help
- π Documentation: This README covers most use cases
- π Bug Reports: Open an issue with detailed reproduction steps
- π‘ Feature Requests: Suggest improvements via GitHub issues
- π¬ Community: Join the Friends of Botble community
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Development Setup
# Clone the repository
git clone https://github.com/friendsofbotble/fob-google-maps-geocoding
# Install in your Botble development environment
cp -r fob-google-maps-geocoding platform/plugins/
# Activate and test
php artisan cms:plugin:activate fob-google-maps-geocoding
π License
This plugin is open-sourced software licensed under the MIT License.
π Credits
- Developed by: Friends of Botble
- Built for: Botble CMS
- Powered by: Google Maps Platform
Made with β€οΈ by the Friends of Botble community
If this plugin helps your project, please consider giving it a β star on GitHub!
Support me β€οΈ
- Bank Information: TECHCOMBANK | 8080777777
- PayPal ID: [email protected]
-
Bank QR Code: