Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datails info abou gym #42

Closed
wants to merge 1 commit into from
Closed
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
33 changes: 28 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var forts = [];
var info_windows = [];
var outArray = [];
var numTrainers = [
177,
177,
109
];
var teams = [
Expand Down Expand Up @@ -185,17 +185,40 @@ var trainerFunc = function(data, user_index) {
icon: 'image/forts/' + teams[(fort.owned_by_team || 0)] + '.png'
});
}
fortName = '';
fortPoints = '';
fortTeam = '';
fortType = 'PokeStop';
pokemonGuard = '';
fortMembers = '';
if (fort.guard_pokemon_id != undefined) {
fortPoints = 'Points: ' + fort.gym_points;
fortTeam = 'Team: ' + teams[fort.owned_by_team] + '<br>';
fortType = 'Gym';
pokemonGuard = 'Guard Pokemon: ' + (pokemonArray[fort.guard_pokemon_id-1].Name || "None") + '<br>';
if(fort.gym_details.result == 1) {
fortName = fort.gym_details.name;
fortMembers = '<table style="text-align: center"><tr><th>Pokemon</th><th>CP</th><th>Owner</th><th>Level</th></tr>'
for (var m = 0; m < fort.gym_details.gym_state.memberships.length; m++) {
var member = fort.gym_details.gym_state.memberships[m];
fortMembers += '<tr>';
fortMembers += '<th>' + pokemonArray[member.pokemon_data.pokemon_id-1].Name+'</th>';
fortMembers += '<th>' + member.pokemon_data.cp + '</th>';
fortMembers += '<th>' + member.trainer_public_profile.name + '</th>';
fortMembers += '<th>' + member.trainer_public_profile.level + '</th>';
fortMembers += '</tr>';
}
fortMembers += '</table>';
}
}
var contentString = 'Id: ' + fort.id + '<br>Type: ' + fortType + '<br>' + pokemonGuard + fortPoints;
var contentString = 'Id: ' + fort.id
if(fortName != '') {
contentString += '<br>Name: ' + fortName;
}
contentString += '<br>Type: ' + fortType + '<br>' + pokemonGuard + fortPoints;
if(fortMembers != '') {
contentString += '<br>'+ fortMembers;
}
info_windows[fort.id] = new google.maps.InfoWindow({
content: contentString
});
Expand All @@ -216,7 +239,7 @@ var trainerFunc = function(data, user_index) {
}
} else {
pathcoords[users[user_index]].push({lat: parseFloat(data.lat), lng: parseFloat(data.lng)})
}
}
if (user_data[users[user_index]].hasOwnProperty('marker') === false) {
buildTrainerList();
addInventory();
Expand Down Expand Up @@ -514,7 +537,7 @@ function buildMenu(user_id, menu) {
'<br>Kilometers Walked: ' +
(parseFloat(current_user_stats.km_walked).toFixed(2) || 0) +
'</div></div>';

document.getElementById('subcontent').innerHTML = out;
}
if (menu == 2) {
Expand Down Expand Up @@ -723,7 +746,7 @@ function sortAndShowPokedex(sortOn, user_id) {
' ' +
pkmnName +
'</b><br>Times Seen: ' +
pkmnEnc +
pkmnEnc +
'<br>Times Caught: ' +
pkmnCap +
'<br>Candy: ' +
Expand Down