Using Google Maps in Abiquo
Abiquo uses Google Maps for the map display, which requires the server to have Internet access. From Abiquo 3.2.2 onwards, the map view is optional and statistics can be shown instead. In new installations, the map view is the default for Infrastructure view. In upgraded installations, to enable the map view, set the appropriate property in the client-config.json file.Abiquo uses the Google Maps Javascript API v3 to plot the datacenter locations on the map, and you cannot use an old key for the v2 API. . However, the API will function without a key up to a certain number of requests.
The Google maps API key should be added to the client-config.json file as described below.
Obtaining a Google Maps API Key
You should add a simple server key for accessing the Google Maps Javascript API v3. To obtain the key, follow the instructions at https://developers.google.com/maps/documentation/javascript/tutorial#api_key:
Now you will add the API key you copied above to the Abiquo Server.
- Log in to the Abiquo Server as root
Change to the UI directory
cd /var/www/html/ui/config
Back up the client-config-custom.json file, for example
cp client-config-custom.json ~/client-config-custom.json.backup
If necessary, edit client-config-custom.json to enable Google Maps
"client.google.maps.enabled": true,
Add the Google Maps key. For example:
"client.google.maps.key": "asdasdDryNhzxEdtfDnGQBKDAtzFqRhjeTUEh_g"
- Reload Abiquo in your browser, which will log you out.
- Confirm the installation by using "View Source" on the Abiquo login page. You should see the API key.
- When you log in to Abiquo, you should see the arrow marking the location of your datacenter.
Troubleshooting
- Improve Datacenter Location Details: If your datacenter is not correctly plotted, try adding more details of the location. For example, if your datacenter is located in Barcelona, Venezuela and you enter Barcelona, the map will show the location as Barcelona in Spain. In this case, you would enter "Barcelona, Venezuela" in the Datacenter location for a correct visualization.
- Google Maps Usage Limits: You can use the Google Maps API v3 for free up to certain usage limits. See https://developers.google.com/maps/documentation/javascript/usage#usage_limits