...
Table of Contents |
---|
Using Google Maps in Abiquo
Excerpt |
---|
Abiquo uses Google Maps for the map display, which requires the server to have Internet access. From Abiquo 3.2.2 onwards, the 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-custom.json file. From 3.0 onwardsTo plot the datacenter locations on the map, Abiquo uses the Google Maps Javascript API v3 to plot the datacenter locations on the map. Abiquo 2.0 used API v2, so , and you cannot use an old key with Abiquo 3.0. You should obtain a new key for Abiquo 3.0 onwards. However, the API will function without a key up to a certain number of requests. From Abiquo 3.2.2 onwards, key for an older version. Add the Google maps API key should be added to the client-config-custom.json file as described below. |
Obtaining a Google Maps API Key
You should add a simple server browser key for accessing the Google Maps Javascript API v3. To
If you were already using Google Maps with a previous version of the API, to obtain the key, follow the instructions at: https://developerscloud.google.com/maps-platform/documentation/javascript/tutorial#api_key:
Adding the Google Maps API Key to Abiquo 3.2 or 3.2.1
Now you will add the API key you copied above to the Abiquo Server.
...
Change to the UI directory
Code Block |
---|
cd /var/www/html/ui |
...
Back up the index.html file
Code Block |
---|
cp index.html ~/index.html.backup |
Edit the index.html file and add the Google Maps key. For example
Code Block |
---|
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=AIzPSyDryNhzxEdtfDnGQBKDAtzFqRhjeTUEh_g&sensor=false&language=en"></script> |
...
Add the Google Maps key. For example:
Code Block |
---|
"client.google.maps.key": "asdasdDryNhzxEdtfDnGQBKDAtzFqRhjeTUEh_g" |
...
When you log in to Abiquo, you should see the arrow marking the location of your datacenter.
Adding the Google Maps API Key to Abiquo 3.2.2 and above
Now you will user-guide/account-changes/
If you are a new user of Google Maps, follow the instructions at: https://developers.google.com/maps/gmp-get-started
You will need to obtain a browser key that can use the Google Maps Javascript API.
To add the API key you copied above to the Abiquo Server .do these steps:
Log in to the Abiquo Server as root
Change to the UI directory
Code Block cd /var/www/html/ui/config
Back up the client-config-custom.json file, for example
Code Block cp client-config-custom.json ~/client-config-custom.json.backup
If necessary, edit client-config-custom.json to enable Google Maps
Code Block "client.google.maps.enabled": true,
Add the Google Maps key. For example:
Code Block "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
...
pins marking the
...
locations of your datacenter.
If there are no valid credentials or datacenters with locations, the map will be centred on Barcelona, Spain.
Configure map defaults
To set the default coordinates and zoom for the datacenters map:
Go to Configuration → Infrastructure
At the bottom of the page, click the pencil Edit button
Set the following coordinates
Default latitude for datacenters map: decimal value with default set to Barcelona, Spain
Default longitude for datacenters map: decimal value with default set to Barcelona, Spain
Default zoom level for datacenters map
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 charges for map usage, see https://developers.google.com/maps/documentation/javascript/usage#usage_limits
...