Maps API key

This commit is contained in:
Juan 2018-08-31 08:14:47 +02:00
parent 03dd6f94e4
commit c77373e772
3 changed files with 55 additions and 62 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.406.18) stable; urgency=low hedera-web (1.406.19) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -1,44 +1,40 @@
var gmapsIsLoaded = false; var gmapsIsLoaded = false;
Hedera.Location = new Class Hedera.Location = new Class({
({
Extends: Hedera.Form Extends: Hedera.Form
,locations: null ,locations: null
,activate: function () ,activate: function() {
{
this.gui.loaderPush(); this.gui.loaderPush();
var sql = 'SELECT lat, lng, title, address, postcode, city, province, phone, language FROM location'; var sql = 'SELECT lat, lng, title, address, postcode, city, province, phone, language FROM location';
this.conn.execQuery(sql, this.onLocationsDone.bind(this)); this.conn.execQuery(sql, this.onLocationsDone.bind(this));
if (!gmapsIsLoaded) if (!gmapsIsLoaded) {
{
gmapsLoadedCallback = this.gmapsLoaded.bind(this); gmapsLoadedCallback = this.gmapsLoaded.bind(this);
Vn.includeJs ('https://maps.google.com/maps/api/js'+ Vn.includeJs('https://maps.google.com/maps/api/js'
'?sensor=false&callback=gmapsLoadedCallback', null, true); +'?sensor=false&callback=gmapsLoadedCallback'
} +'&key=AIzaSyBbunFsAFEkjtw-c7BUHNgkThSlKEKFxiE',
else null, true
);
} else
this.gmapsLoaded(); this.gmapsLoaded();
} }
,onLocationsDone: function (resultSet) ,onLocationsDone: function(resultSet) {
{
this.locations = resultSet.fetchResult(); this.locations = resultSet.fetchResult();
this.allLoaded(); this.allLoaded();
} }
,gmapsLoaded: function () ,gmapsLoaded: function() {
{
this.gui.loaderPop(); this.gui.loaderPop();
gmapsIsLoaded = true; gmapsIsLoaded = true;
this.allLoaded(); this.allLoaded();
} }
,allLoaded: function () ,allLoaded: function() {
{
if (!this.locations || !gmapsIsLoaded) if (!this.locations || !gmapsIsLoaded)
return; return;
@ -56,8 +52,7 @@ Hedera.Location = new Class
this.createMarker(this.locations, gmap); this.createMarker(this.locations, gmap);
} }
,createMarker: function (location, gmap) ,createMarker: function(location, gmap) {
{
var div = document.createElement('div'); var div = document.createElement('div');
div.className = 'marker'; div.className = 'marker';
@ -104,8 +99,7 @@ Hedera.Location = new Class
this.openInfoWindow(infoWindow, gmap, marker); this.openInfoWindow(infoWindow, gmap, marker);
} }
,openInfoWindow: function (infoWindow, gmap, marker) ,openInfoWindow: function(infoWindow, gmap, marker) {
{
if (this.openedWindow) if (this.openedWindow)
this.openedWindow.close(); this.openedWindow.close();
@ -113,4 +107,3 @@ Hedera.Location = new Class
this.openedWindow = infoWindow; this.openedWindow = infoWindow;
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "1.406.18", "version": "1.406.19",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {