Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Add gym stop pics for monocle alternate (POC) #103

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Monocle_Alternate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 8 additions & 2 deletions static/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -697,6 +698,7 @@ function gymLabel(item) {
'<b style="color:rgba(' + gymColor[teamId] + ')">' + i8ln(teamName) + '</b><br>' +
'<img height="70px" style="padding: 5px;" src="static/forts/' + teamName + '_large.png">' +
raidIcon +
'<img height="70px" style="padding: 5px;" src="' + url + '">' +
'</div>' +
nameStr +
raidStr +
Expand Down Expand Up @@ -732,6 +734,7 @@ function gymLabel(item) {
'<b style="color:rgba(' + gymColor[teamId] + ')">' + i8ln('Team') + ' ' + i8ln(teamName) + '</b><br>' +
'<img height="70px" style="padding: 5px;" src="static/forts/' + teamName + '_large.png">' +
raidIcon +
'<img height="70px" style="padding: 5px;" src="' + url + '">' +
'</div>' +
nameStr +
raidStr +
Expand Down Expand Up @@ -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'
Expand All @@ -770,6 +773,7 @@ function pokestopLabel(expireTime, latitude, longitude, stopName) {
'<div>' +
'<b>' + stopName + ' (Lured)</b>' +
'</div>' +
'<img height="70px" style="padding: 5px;" align="middle" src="' + stopUrl + '">' +
'<div>' +
i8ln('Lure expires at') + ' ' + getTimeStr(expireTime) +
' <span class="label-countdown" disappears-at="' + expireTime + '">(00m00s)</span>' +
Expand All @@ -782,6 +786,7 @@ function pokestopLabel(expireTime, latitude, longitude, stopName) {
'<div>' +
'<b>' + stopName + '</b>' +
'</div>' +
'<img height="70px" style="padding: 5px;" align="middle" src="' + stopUrl + '">' +
'<div>' +
'Location: <a href="javascript:void(0)" onclick="javascript:openMapDirections(' + latitude + ',' + longitude + ')" title="' + i8ln('View in Maps') + '">' + latitude.toFixed(6) + ', ' + longitude.toFixed(7) + '</a>' +
'</div>'
Expand Down Expand Up @@ -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']),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will most likely break others scanners if they dont store this in the same way. Need to have a conditional for alt otherwise you will get undefined errors.

disableAutoPan: true
})

Expand Down Expand Up @@ -2481,6 +2486,7 @@ function showGymDetails(id) { // eslint-disable-line no-unused-vars
'<div>' +
'<img height="100px" style="padding: 5px;" src="static/forts/' + gymTypes[result.team_id] + '_large.png">' +
raidIcon +
'<img height="70px" style="padding: 5px;" src="' + result.url + '">' +
'</div>' +
raidStr +
gymLevelStr +
Expand Down