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.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); | |
} | |
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){ |
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.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; |
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.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) { |
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(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'); |
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
/* 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 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
/** | |
* 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(($) => { |
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(function($){ | |
$(document.body).on('markersplaced.wpgmza', () => { | |
const titleQuery = WPGMZA.getQueryParamValue('qtitle'); | |
const zoomQuery = WPGMZA.getQueryParamValue('qzoom'); | |
if(titleQuery){ | |
const map = WPGMZA.maps[0]; | |
const markers = map.markers; | |
let matchFound = false; | |
for(let marker of markers){ | |
if(matchFound){ continue; } |
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(function($){ | |
/* Clone the original method */ | |
WPGMZA.ProInfoWindow.prototype._populatePanel = WPGMZA.ProInfoWindow.prototype.populatePanel; | |
WPGMZA.ProInfoWindow.prototype.populatePanel = function(){ | |
/* Call the original method */ | |
this._populatePanel(); | |
/* Grab a self refernce, to be used in our loop */ | |
const self = this; |
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
/* Demo of how you might replace the HTML template for Atlas Novus Panel info widnows | |
* | |
* This uses a dynamic hook, from the shortcode class, and can be applied to any module that is contained in a panel | |
* | |
* This assumes, you are targeting the "left" panel, but the same can be applied to the right panel if the anchor is set this way | |
*/ | |
add_filter('wpgmza_map_panel_elements_left', 'wpgmza_infowindow_override', 10, 1); | |
function wpgmza_infowindow_override($elements){ | |
if(is_array($elements)){ |
NewerOlder