pokeminer icon indicating copy to clipboard operation
pokeminer copied to clipboard

Use larger-icons on some pokemons

Open SapitoSucio opened this issue 8 years ago • 4 comments

Used to just copy and rewrite the images from icons folder using the icons from larger-icons, but now the icon size is fixed at newmap.html ( iconSize: [30, 30],)

I commented that line but the icons are so inaccurate, specially the larger icons

Could there be a new config line (like trash_id) to specify which pokemons are "important" so they are bigger than usual?

Tried using this but it didn't work if (raw.pokemon_id == 10){ // Caterpie just for testing var bigicon = new BigPokemonIcon({iconUrl: '/static/larger-icons/' + raw.pokemon_id + '.png'}); }

SapitoSucio avatar Aug 07 '16 16:08 SapitoSucio

There's no such config yet. You'd need to create a "class" similar to PokemonIcon with different properties (like size), and then place similar if in PokemonMarker.

modrzew avatar Aug 07 '16 17:08 modrzew

I wrote this:

//This Below PokemonIcon var BigPokemonIcon = L.Icon.extend({ options: { iconSize: [80, 60], popupAnchor: [0, -16] } });

// This in Pokemon Marker if (raw.pokemon_id == 10){ var bigicon = new BigPokemonIcon({iconUrl: '/static/larger-icons/' + raw.pokemon_id + '.png'}); }

Is raw.pokemon_id the ideal way to get the ID ? I know I need to compare IDs to get working this "feature"

SapitoSucio avatar Aug 07 '16 17:08 SapitoSucio

Yeah, raw.pokemon_id contains Pokemon number. Then just use it in a marker:

var marker = L.marker([raw.lat, raw.lon], {icon: bigicon, opacity: 1});

modrzew avatar Aug 07 '16 18:08 modrzew

Done, thank you! http://i.imgur.com/pydsHmR.png

SapitoSucio avatar Aug 07 '16 18:08 SapitoSucio