@@ -219,6 +219,8 @@ var types = {
219219 DollarSignSquared : { id : 434 }
220220} ;
221221
222+ var nameToId = { } ;
223+
222224var blipCss = `.blip {
223225 background: url("${ _MAP_currentUri } ${ _MAP_iconURL } blips_texturesheet.png");
224226 background-size: ${ 1024 / 2 } px ${ 1024 / 2 } px;
@@ -229,13 +231,34 @@ var blipCss = `.blip {
229231
230232function generateBlipControls ( ) {
231233 for ( var blipName in types ) {
232- $ ( "#blip-control-container" ) . append ( `<a id="blip_${ blipName } _link" class="list-group-item d-inline-block collapsed blip-enabled" href="#"><span class="blip blip-${ blipName } "></span></a>` ) ;
234+ $ ( "#blip-control-container" ) . append ( `<a data-blip-number=" ${ nameToId [ blipName ] } " id="blip_${ blipName } _link" class="blip-button-a list-group-item d-inline-block collapsed blip-enabled" href="#"><span class="blip blip-${ blipName } "></span></a>` ) ;
233235
234236 if ( _SETTINGS_debug ) {
235237 console . log ( "Added ahref for " + blipName ) ;
236238 }
237-
238239 }
240+
241+ // Events
242+ $ ( ".blip-button-a" ) . on ( "click" , function ( e ) {
243+ var ele = $ ( e . currentTarget ) ;
244+ var blipId = ele . data ( "blipNumber" ) . toString ( ) ;
245+
246+ // Toggle blip
247+ if ( _disabledBlips . includes ( blipId ) ) {
248+ // Already disabled, enable it
249+ _disabledBlips . splice ( _disabledBlips . indexOf ( blipId ) , 1 ) ;
250+ ele . removeClass ( "blip-disabled" ) . addClass ( "blip-enabled" ) ;
251+ } else {
252+ // Enabled, disable it
253+ _disabledBlips . push ( blipId ) ;
254+ ele . removeClass ( "blip-enabled" ) . addClass ( "blip-disabled" ) ;
255+ }
256+
257+ // Refresh blips (there's probably a faster way..)
258+ clearAllMarkers ( ) ;
259+ toggleBlips ( ) ;
260+ } ) ;
261+
239262}
240263
241264function generateBlipShit ( ) {
@@ -272,6 +295,8 @@ function generateBlipShit(){
272295 origin : new google . maps . Point ( customImageWidth * currentX , customImageHeight * currentY ) ,
273296 } ;
274297
298+ nameToId [ blipName ] = currentId ;
299+
275300 // CSS GENERATOR FOR BLIP ICONS IN HTML
276301 // Just add the class "blip blip-<NAME>" to the element for blip icons
277302 // e.g. <span class="blip blip-Standard"> for a Standard blip
0 commit comments