kopia lustrzana https://github.com/jprochazka/adsb-receiver
Can specify Google Maps API Key for portal maps.
rodzic
7aa5a9d0b8
commit
a8780e1e01
|
|
@ -192,6 +192,7 @@
|
|||
$common->updateSetting("twitterConsumerSecret", $_POST['twitterConsumerSecret']);
|
||||
$common->updateSetting("twitterAccessToken", $_POST['twitterAccessToken']);
|
||||
$common->updateSetting("twitterAccessTokenSecret", $_POST['twitterAccessTokenSecret']);
|
||||
$common->updateSetting("googleMapsApiKey", $_POST['googleMapsApiKey']);
|
||||
|
||||
// Purge older flight positions.
|
||||
if (isset($_POST['purgepositions'])) {
|
||||
|
|
@ -245,6 +246,7 @@
|
|||
$defaultPage = $common->getSetting("defaultPage");
|
||||
$dateFormat = $common->getSetting("dateFormat");
|
||||
$timeZone = $common->getSetting("timeZone");
|
||||
$googleMapsApiKey = $common->getSetting("googleMapsApiKey");
|
||||
|
||||
// Get navigation settings from settings.xml.
|
||||
$enableFlights = $common->getSetting("enableFlights");
|
||||
|
|
@ -381,6 +383,10 @@
|
|||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="googleMapsApiKey">Google Maps API Key</label>
|
||||
<input type="text" class="form-control" id="googleMapsApiKey" name="googleMapsApiKey" value="<?php echo $googleMapsApiKey; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -81,4 +81,3 @@
|
|||
|
||||
$template->display($pageData);
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -408,6 +408,7 @@ EOF;
|
|||
$common->addSetting('twitterConsumerSecret', '');
|
||||
$common->addSetting('twitterAccessToken', '');
|
||||
$common->addSetting('twitterAccessTokenSecret', '');
|
||||
$common->addSetting('googleMapsApiKey', '');
|
||||
|
||||
if ($_POST['driver'] == "xml")
|
||||
$common->addSetting('enableFlights', FALSE);
|
||||
|
|
|
|||
|
|
@ -169,6 +169,9 @@ EOF;
|
|||
$common->addSetting('twitterAccessToken', '');
|
||||
$common->addSetting('twitterAccessTokenSecret', '')
|
||||
|
||||
// Add Google Maps API Key setting.
|
||||
$common->addSetting('googleMapsApiKey', '');
|
||||
|
||||
// Update the version and patch settings..
|
||||
$common->updateSetting("version", "2.5.0");
|
||||
$common->updateSetting("patch", "");
|
||||
|
|
|
|||
|
|
@ -146,4 +146,3 @@
|
|||
|
||||
$template->display($pageData);
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -315,5 +315,5 @@
|
|||
|
||||
}
|
||||
</script>
|
||||
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAibOqEH7XseMCHOPQUdBon6LHKSlbGHj4&callback=initMap"></script>
|
||||
<script async defer src="https://maps.googleapis.com/maps/api/js?key={setting:googleMapsApiKey}&callback=initMap"></script>
|
||||
{/area}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ from xml.dom import minidom
|
|||
import xml.etree.ElementTree as ET
|
||||
|
||||
# Temporary variables for testing.
|
||||
portal_url = "http://172.17.2.148"
|
||||
portal_url = "http://localhost"
|
||||
debug_script = "true"
|
||||
send_email = "false"
|
||||
send_tweet = "false"
|
||||
|
|
@ -100,10 +100,6 @@ doc = minidom.parse("/var/www/html/data/notifications.xml")
|
|||
flights = doc.getElementsByTagName("flight")
|
||||
|
||||
|
||||
###############################################
|
||||
## SEND NOTIFICATION(S) IF FLIGHTS ARE FOUND
|
||||
|
||||
|
||||
# Get notification JSON from the portal.
|
||||
response = urllib2.urlopen(portal_url,"/api/notifications.php?type=flights")
|
||||
flights_seen = json.load(response)
|
||||
|
|
@ -152,11 +148,6 @@ Subject: ADS-B Receiver Flight Notification
|
|||
except UnicodeDecodeError:
|
||||
print "Error: unable to send tweet"
|
||||
|
||||
|
||||
###############################################
|
||||
## UPDATE THE FLIGHTS LASTMESSAGECOUNT
|
||||
|
||||
|
||||
if name.firstChild.data.strip() == i['flight']:
|
||||
update_data = [('flight',i['flight']),('messages','0')]
|
||||
update_data = urllib.urlencode(update_data)
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue