MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / initSidebar

Function initSidebar

static/js/map.js:257–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

255}
256
257function initSidebar () {
258 $('#gyms-switch').prop('checked', Store.get('showGyms'))
259 $('#pokemon-switch').prop('checked', Store.get('showPokemon'))
260 $('#pokestops-switch').prop('checked', Store.get('showPokestops'))
261 $('#lured-pokestops-only-switch').val(Store.get('showLuredPokestopsOnly'))
262 $('#lured-pokestops-only-wrapper').toggle(Store.get('showPokestops'))
263 $('#geoloc-switch').prop('checked', Store.get('geoLocate'))
264 $('#lock-marker-switch').prop('checked', Store.get('lockMarker'))
265 $('#start-at-user-location-switch').prop('checked', Store.get('startAtUserLocation'))
266 $('#follow-my-location-switch').prop('checked', Store.get('followMyLocation'))
267 $('#scanned-switch').prop('checked', Store.get('showScanned'))
268 $('#spawnpoints-switch').prop('checked', Store.get('showSpawnpoints'))
269 $('#ranges-switch').prop('checked', Store.get('showRanges'))
270 $('#sound-switch').prop('checked', Store.get('playSound'))
271 var searchBox = new google.maps.places.SearchBox(document.getElementById('next-location'))
272 $('#next-location').css('background-color', $('#geoloc-switch').prop('checked') ? '#e0e0e0' : '#ffffff')
273
274 updateSearchStatus()
275 setInterval(updateSearchStatus, 5000)
276
277 searchBox.addListener('places_changed', function () {
278 var places = searchBox.getPlaces()
279
280 if (places.length === 0) {
281 return
282 }
283
284 var loc = places[0].geometry.location
285 changeLocation(loc.lat(), loc.lng())
286 })
287
288 var icons = $('#pokemon-icons')
289 $.each(pokemonSprites, function (key, value) {
290 icons.append($('<option></option>').attr('value', key).text(value.name))
291 })
292 icons.val((pokemonSprites[Store.get('pokemonIcons')]) ? Store.get('pokemonIcons') : 'highres')
293 $('#pokemon-icon-size').val(Store.get('iconSizeModifier'))
294}
295
296function pad (number) {
297 return number <= 99 ? ('0' + number).slice(-2) : number

Callers 1

initMapFunction · 0.85

Calls 3

updateSearchStatusFunction · 0.85
changeLocationFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected