Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Added missing Uncontested fort icons and coverage marker #26

Closed
wants to merge 2 commits into from
Closed
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
Binary file added static/forts/Uncontested.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/forts/Uncontested_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 28 additions & 4 deletions static/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ try {
console.log(excludedPokemon);
} catch (e) {}

var d = "displayPokemons" in localStorage ? localStorage.displayPokemons : 'true';
document.getElementById('pokemon-checkbox').checked = (d === 'true');
d = "displayGyms" in localStorage ? localStorage.displayGyms : 'true';
document.getElementById('gyms-checkbox').checked = (d === 'true');
function getFromStorage(keyName) {
var res = localStorage.getItem(keyName);
if(res){
return localStorage.getItem(keyName) === 'true';
}
}

document.getElementById('pokemon-checkbox').checked = getFromStorage("displayPokemons");
document.getElementById('gyms-checkbox').checked = getFromStorage("displayGyms");
document.getElementById('coverage-checkbox').checked = getFromStorage("displayCoverage");

$.getJSON("static/locales/pokemon.en.json").done(function(data) {
var pokeList = [];
Expand Down Expand Up @@ -90,6 +96,19 @@ function initMap() {
newLocationMarker.setMap(null); //removes the marker
});
});

coverCircle = new google.maps.Circle({
strokeColor: '#FF0000',
strokeOpacity: 0.6,
strokeWeight: 1,
fillColor: '#FF0000',
fillOpacity: 0.08,
clickable: false,
map: map,
center: searchLocation,
radius: searchLocation['radius']
});
coverCircle.setVisible(document.getElementById('coverage-checkbox').checked);
};


Expand Down Expand Up @@ -329,6 +348,11 @@ $('#pokemon-checkbox').change(function() {
}
});

$('#coverage-checkbox').change(function() {
localStorage.displayCoverage = this.checked;
coverCircle.setVisible(this.checked);
});

var coverCircles = [];
/*
function displayCoverage() {
Expand Down