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

Function customizePokemonMarker

static/js/map.js:533–561  ·  view source on GitHub ↗
(marker, item, skipNotification)

Source from the content-addressed store, hash-verified

531}
532
533function customizePokemonMarker (marker, item, skipNotification) {
534 marker.addListener('click', function () {
535 this.setAnimation(null)
536 this.animationDisabled = true
537 })
538
539 if (!marker.rangeCircle && isRangeActive(map)) {
540 marker.rangeCircle = addRangeCircle(marker, map, 'pokemon')
541 }
542
543 marker.infoWindow = new google.maps.InfoWindow({
544 content: pokemonLabel(item['pokemon_name'], item['pokemon_rarity'], item['pokemon_types'], item['disappear_time'], item['pokemon_id'], item['latitude'], item['longitude'], item['encounter_id']),
545 disableAutoPan: true
546 })
547
548 if (notifiedPokemon.indexOf(item['pokemon_id']) > -1 || notifiedRarity.indexOf(item['pokemon_rarity']) > -1) {
549 if (!skipNotification) {
550 if (Store.get('playSound')) {
551 audio.play()
552 }
553 sendNotification('A wild ' + item['pokemon_name'] + ' appeared!', 'Click to load map', 'static/icons/' + item['pokemon_id'] + '.png', item['latitude'], item['longitude'])
554 }
555 if (marker.animationDisabled !== true) {
556 marker.setAnimation(google.maps.Animation.BOUNCE)
557 }
558 }
559
560 addListeners(marker)
561}
562
563function setupGymMarker (item) {
564 var marker = new google.maps.Marker({

Callers 2

processPokemonsFunction · 0.85
redrawPokemonFunction · 0.85

Calls 5

isRangeActiveFunction · 0.85
addRangeCircleFunction · 0.85
pokemonLabelFunction · 0.85
sendNotificationFunction · 0.85
addListenersFunction · 0.70

Tested by

no test coverage detected