Skip to content

Instantly share code, notes, and snippets.

View DylanCodeCabin's full-sized avatar

Dylan Auty DylanCodeCabin

View GitHub Profile
[{"featureType":"administrative.locality","elementType":"all","stylers":[{"hue":"#2c2e33"},{"saturation":7},{"lightness":19},{"visibility":"on"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"simplified"}]},{"featureType":"poi","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":-2},{"visibility":"simplified"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"hue":"#e9ebed"},{"saturation":-90},{"lightness":-8},{"visibility":"simplified"}]},{"featureType":"transit","eleme
@DylanCodeCabin
DylanCodeCabin / wpgmza-rest-htmlcomment-remove.js
Created April 7, 2025 06:49
wpgmza-rest-htmlcomment-remove.js
(function( $ ) {
var _old = $.ajax;
$.ajaxFiltering = {};
$.ajax = function(url, settings) {
settings.dataFilter = function(data, type){
return data.replace(/^(<!--(.*)-->)/g, '', data);
}
return _old(url, settings);
jQuery(($) => {
let wpgmza_last_active = false;
WPGMZA.ProMarker.prototype.__onClick = WPGMZA.ProMarker.prototype.onClick;
WPGMZA.ProMarker.prototype.onClick = function(event){
this.__onClick(event);
if(wpgmza_last_active){
wpgmzaReleaseActiveMarker();
}
jQuery(($) => {
WPGMZA.ProMarker.prototype.__onClick = WPGMZA.ProMarker.prototype.onClick;
WPGMZA.ProMarker.prototype.onClick = function(event){
this.__onClick(event);
if(WPGMZA._selectedMarker){
WPGMZA._selectedMarker.setIcon(WPGMZA._selectedMarker._prevIcon);
}
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){
@DylanCodeCabin
DylanCodeCabin / gist:c03797089b882ab8f7abd1e696690763
Created December 18, 2023 13:38
wpgmza-hover-bounce-marker.js
jQuery(($) => {
WPGMZA.ProMarker.prototype.__onMouseOver = WPGMZA.ProMarker.prototype.onMouseOver;
WPGMZA.ProMarker.prototype.onMouseOver = function(event){
this.__onMouseOver(event);
if(WPGMZA._selectedMarker){
WPGMZA._selectedMarker.setAnimation(WPGMZA.Marker.ANIMATION_NONE);
}
WPGMZA._selectedMarker = this;
@DylanCodeCabin
DylanCodeCabin / ol-geocoder-remap.js
Created August 10, 2023 13:58
Hotfix for OpenLayers Geocoding issue
jQuery(($) => {
WPGMZA.OLGeocoder.prototype.getResponseFromNominatim = function(options, callback) {
var data = {
q: options.address,
format: "json"
};
options.componentRestrictions && options.componentRestrictions.country ? data.countrycodes = options.componentRestrictions.country : options.country && (data.countrycodes = options.country),
$.ajax("https://nominatim.openstreetmap.org/search", {
data: data,
success: function(response, xhr, status) {
jQuery(function($){
$(document.body).on('markersplaced.wpgmza', () => {
for(let m in WPGMZA.maps){
for(let i in WPGMZA.maps[m].markers){
const marker = WPGMZA.maps[m].markers[i];
if(marker && marker.googleMarker){
google.maps.event.addListener(marker.googleMarker, 'mouseover', function (e) {
if(e && e.domEvent && e.domEvent.target){
try{
e.domEvent.target.removeAttribute('title');
/* Restrict autocomplete to more than one country
*
* In this case: Republic of Ireland and United Kingdom
*/
jQuery(($) => {
WPGMZA.AddressInput.prototype.loadGoogleAutocomplete = function(){
/* UK + Repuclic of Ireland */
const countries = ['ie', 'gb'];
if(WPGMZA.settings){
if(WPGMZA.settings.googleMapsApiKey || WPGMZA.settings.wpgmza_google_maps_api_key){
/**
* This script will automatically reload the marker data via the REST API
*
* It only appends new markers, meaning this is somewhat resful
*
* Currently, this does not deal with shapes or any other data (markers only)
*
* Adjust 'refresh.seconds' to change how frequently the polling request is made
*/
jQuery(($) => {