Created
January 5, 2024 11:08
-
-
Save DylanCodeCabin/2edf8a16727170015cf90cfe49210402 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(($) => { | |
WPGMZA.Map.prototype.addMarker = function(marker){ | |
if(!(marker instanceof WPGMZA.Marker)) | |
throw new Error("Argument must be an instance of WPGMZA.Marker"); | |
let englishOnly = window.location.href.indexOf('/en/') !== -1 ? true : false; | |
if(englishOnly){ | |
if(marker.link.indexOf('/en/') === -1){ | |
marker.setVisible(false); | |
return; | |
} | |
} else { | |
if(marker.link.indexOf('/en/') !== -1){ | |
marker.setVisible(false); | |
return; | |
} | |
} | |
marker.map = this; | |
marker.parent = this; | |
this.markers.push(marker); | |
this.dispatchEvent({type: "markeradded", marker: marker}); | |
marker.dispatchEvent({type: "added"}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment