From a2d1201caadeb2ebdb28bb73b72b276dc71adc6b Mon Sep 17 00:00:00 2001 From: pizzamann Date: Sun, 4 Mar 2018 13:10:44 +0100 Subject: [PATCH] add gym and pokestop pics for monocle alt (POC) --- lib/Monocle_Alternate.php | 2 ++ static/js/map.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Monocle_Alternate.php b/lib/Monocle_Alternate.php index 37df35b43..947a6bb41 100644 --- a/lib/Monocle_Alternate.php +++ b/lib/Monocle_Alternate.php @@ -165,6 +165,7 @@ public function query_stops($conds, $params) $query = "SELECT external_id AS pokestop_id, name AS pokestop_name, + url AS pokestop_url, lat AS latitude, lon AS longitude FROM pokestops @@ -246,6 +247,7 @@ public function query_gyms($conds, $params) f.lat AS latitude, f.lon AS longitude, f.name, + f.url, f.sponsor, f.park, fs.team AS team_id, diff --git a/static/js/map.js b/static/js/map.js index 6514ac7ec..27862d389 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -608,6 +608,7 @@ function gymLabel(item) { var lastScanned = item['last_scanned'] var lastModified = item['last_modified'] var name = item['name'] + var url = item['url'] var members = item['pokemon'] var raidSpawned = item['raid_level'] != null @@ -697,6 +698,7 @@ function gymLabel(item) { '' + i8ln(teamName) + '
' + '' + raidIcon + + '' + '' + nameStr + raidStr + @@ -732,6 +734,7 @@ function gymLabel(item) { '' + i8ln('Team') + ' ' + i8ln(teamName) + '
' + '' + raidIcon + + '' + '' + nameStr + raidStr + @@ -760,7 +763,7 @@ function gymLabel(item) { return str } -function pokestopLabel(expireTime, latitude, longitude, stopName) { +function pokestopLabel(expireTime, latitude, longitude, stopName, stopUrl) { var str if (stopName === undefined) { stopName = 'Pokéstop' @@ -770,6 +773,7 @@ function pokestopLabel(expireTime, latitude, longitude, stopName) { '
' + '' + stopName + ' (Lured)' + '
' + + '' + '
' + i8ln('Lure expires at') + ' ' + getTimeStr(expireTime) + ' (00m00s)' + @@ -782,6 +786,7 @@ function pokestopLabel(expireTime, latitude, longitude, stopName) { '
' + '' + stopName + '' + '
' + + '' + '
' + 'Location: ' + latitude.toFixed(6) + ', ' + longitude.toFixed(7) + '' + '
' @@ -1174,7 +1179,7 @@ function setupPokestopMarker(item) { } marker.infoWindow = new google.maps.InfoWindow({ - content: pokestopLabel(item['lure_expiration'], item['latitude'], item['longitude'], item['pokestop_name']), + content: pokestopLabel(item['lure_expiration'], item['latitude'], item['longitude'], item['pokestop_name'], item['pokestop_url']), disableAutoPan: true }) @@ -2481,6 +2486,7 @@ function showGymDetails(id) { // eslint-disable-line no-unused-vars '
' + '' + raidIcon + + '' + '
' + raidStr + gymLevelStr +