: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Display content below the map
function igm_display_below(id, data) {
iMapsActions.contentBelow(id, data, false);
window.dispatchEvent(new Event('resize'));
* Display content below the map and scroll
function igm_display_below_scroll(id, data) {
iMapsActions.contentBelow(id, data, true);
window.dispatchEvent(new Event('resize'));
* Display content above the map
function igm_display_above(id, data) {
iMapsActions.contentAbove(id, data, false);
window.dispatchEvent(new Event('resize'));
* Display post or page below
function igm_display_page_below(id, data) {
iMapsActions.pageBelow(id, data, false);
* Display post or page below
function igm_display_page_below_and_scroll(id, data) {
iMapsActions.pageBelow(id, data, true);
* Display content to the right of the map with 1/3 space
function igm_display_right_1_3(id, data) {
iMapsActions.contentRight(id, data, 'igm_content_left_2_3', 'igm_content_right_1_3');
window.dispatchEvent(new Event('resize'));
function igm_lightbox(id, data) {
iMapsActions.lightboxAction(id, data, 'inline');
window.dispatchEvent(new Event('resize'));
function igm_lightbox_image(id, data) {
iMapsActions.lightboxAction(id, data, 'image');
function igm_lightbox_iframe(id, data) {
iMapsActions.lightboxAction(id, data, 'external');
// check if there's a live filter
iMapsActions.init = function () {
var liveFilters = document.querySelectorAll('.igm-live-filter');
for (var i = 0; i < liveFilters.length; i++) {
iMapsActions.buildFilter(liveFilters[i]);
var liveFilterDropdowns = document.querySelectorAll('.igm-live-filter-dropdown');
for (var i = 0; i < liveFilterDropdowns.length; i++) {
iMapsActions.buildDropdownFilter(liveFilterDropdowns[i]);
var dropdowns = document.querySelectorAll('.igm_select_choices');
if (dropdowns.length > 0) {
for (var i = 0; i < dropdowns.length; i++) {
iMapsActions.buildDropdown(dropdowns[i]);
dropdowns = document.querySelectorAll('.igm_select');
for (var i = 0; i < dropdowns.length; i++) {
dropdowns[i].addEventListener('change', function (event) {
var select = event.target;
var id = select.getAttribute('data-map-id');
if (typeof iMapsManager !== 'undefined') {
iMapsManager.select(id, select.value, true);
if (select.getAttribute('data-url')) {
var hash = select.getAttribute('data-url').split('#')[1];
var tempURL = select.getAttribute('data-url').replace('#' + hash, '');
window.open(tempURL + '?mregion=' + select.value + '#' + hash, '_self');
window.open(select.getAttribute('data-url') + '?mregion=' + select.value, '_self');
var lists = document.querySelectorAll('.igm_entries_list');
for (var i = 0; i < lists.length; i++) {
iMapsActions.buildLists(lists[i]);
iMapsActions.buildDropdown = function (el) {
var noResults = el.getAttribute('data-noresults');
var select = el.getAttribute('data-select');
noResultsText: noResults,
resetScrollPosition: false,
searchFields: ['label', 'value', 'customProperties'],
var choices = new Choices(el, opts);
choices.passedElement.element.addEventListener('change', function () {
var id = el.getAttribute('data-map-id');
if (typeof iMapsManager !== 'undefined') {
iMapsManager.select(id, this.value, true);
if (el.getAttribute('data-url')) {
var hash = el.getAttribute('data-url').split('#')[1];
var tempURL = el.getAttribute('data-url').replace('#' + hash, '');
window.open(tempURL + '?mregion=' + el.value + '#' + hash, '_self');
window.open(el.getAttribute('data-url') + '?mregion=' + el.value, '_self');
iMapsActions.buildLists = function (el) {
var mapID = el.getAttribute('data-map-id');
var liEntries = el.querySelectorAll('li');
for (var index = 0; index < liEntries.length; index++) {
var liEl = liEntries[index];
liEl.addEventListener('click', function (event) {
if (typeof iMapsManager !== 'undefined') {
var entryCode = event.target.getAttribute('data-code');
iMapsManager.select(mapID, entryCode, true);
if (event.target.getAttribute('data-url')) {
event.target.getAttribute('data-url') +
event.target.getAttribute('data-code'),
liEl.addEventListener('mouseover', function (event) {
if (typeof iMapsManager !== 'undefined') {
var entryCode = event.target.getAttribute('data-code');
iMapsManager.highlight(mapID, entryCode);
liEl.addEventListener('mouseout', function (event) {
if (typeof iMapsManager !== 'undefined') {
iMapsManager.clearHighlighted(mapID);
iMapsActions.buildDropdownFilter = function (el) {
var mainID = el.getAttribute('data-base-map-id');
var keepBase = el.getAttribute('data-keep-base-map');
if (typeof keepBase !== 'undefined' && keepBase === '1') {
mainID = parseInt(mainID);
el.addEventListener('change', function (event) {
var thisMapID = event.target.value;
thisMapID = parseInt(thisMapID);
iMapsManager.filteredMap = thisMapID;
if (thisMapID === mainID) {
iMapsManager.activeMap = mainID;
if (typeof iMapsManager !== 'undefined') {
iMapsManager.filteredMap = mainID;
iMapsManager.showAllSeries(thisMapID);
if (typeof iMapsManager !== 'undefined') {
iMapsManager.hideAllSeries(mainID, keepBase);
var thisSeries = iMaps.maps[mainID].seriesById[thisMapID];
if (thisSeries && thisSeries.length > 0) {
for (var ix = 0; ix < thisSeries.length; ix++) {
var serie = thisSeries[ix];
// change this to a iMapsManager function that goes home and triggers event
// let's try to avoid using iMaps object in this file.
if (typeof iMaps.maps[thisMapID] !== 'undefined') {
iMaps.maps[thisMapID].map.goHome();
iMaps.maps[thisMapID].map.dispatchImmediately('zoomlevelchanged');
iMapsActions.buildFilter = function (el) {
var mainID = el.getAttribute('data-base-map-id');
var keepBase = el.getAttribute('data-keep-base-map');
if (typeof keepBase !== 'undefined' && keepBase === '1') {
mainID = parseInt(mainID);
var liMaps = el.querySelectorAll('li');
for (var index = 0; index < liMaps.length; index++) {
var liEl = liMaps[index];
liEl.addEventListener('click', function (element) {
// remove active from all other entries
for (var ind = 0; ind < liMaps.length; ind++) {
var otherLi = liMaps[ind];
otherLi.classList.remove('igm-live-filter-active');
// add active to this one
element.target.classList.add('igm-live-filter-active');
var thisMapID = element.target.getAttribute('data-map-id');
thisMapID = parseInt(thisMapID);
iMapsManager.filteredMap = thisMapID;
if (thisMapID === mainID) {
if (typeof iMapsManager !== 'undefined') {
iMapsManager.filteredMap = mainID;
iMapsManager.showAllSeries(thisMapID);
iMapsManager.resetDrilldown(thisMapID);
if (typeof iMapsManager !== 'undefined') {
iMapsManager.hideAllSeries(mainID, keepBase);
var thisSeries = iMaps.maps[mainID].seriesById[thisMapID];
if (thisSeries && thisSeries.length > 0) {
for (var ix = 0; ix < thisSeries.length; ix++) {
var serie = thisSeries[ix];
if (typeof iMaps.maps[mainID] !== 'undefined') {
iMaps.maps[mainID].map.goHome();
iMaps.maps[mainID].map.dispatchImmediately('zoomlevelchanged');
iMapsActions.lightbox = false;
iMapsActions.lightboxIsRunning = false;
iMapsActions.lightboxAction = function (id, data, type) {
width = iMapsActionOptions.lightboxWidth,
height = iMapsActionOptions.lightboxHeight,
data.content = '#' + iMapsActions.getIDfromData(data);
} else if (type === 'external') {
height = parseInt(window.innerHeight * 0.8);
// check if there's multiple images (divided by comma)
if (data.content !== '' && data.content.includes(',')) {
let images = data.content.split(',');
images.forEach(function (url, ix) {
keyboardNavigation: false,
closeButton: false, // changed when we added the custom close button
closeOnOutsideClick: true, // changed when we added the custom close button
// fix for lightbox closing on bigger touch devices
if (window.innerWidth > 768 && iMapsActions.isTouchScreenDevice()) {
opts.closeOnOutsideClick = false;
iMapsActions.lightbox = GLightbox(opts);
// add custom close button
iMapsActions.lightbox.on('open', function () {
let close = document.querySelector('.ginner-container .gslide-media .igm_close');
close = document.createElement('span');
close.classList.add('igm_close');
let containers = document.querySelectorAll('.ginner-container .gslide-media');
containers.forEach(function (el) {
let clone = close.cloneNode(true);
clone.addEventListener('click', function () {
iMapsActions.lightbox.close();
if (data.content !== '' && iMapsActions.lightbox && !iMapsActions.lightboxIsRunning) {
iMapsActions.lightbox.open();
iMapsActions.lightboxIsRunning = true;
console.log('Empty Action Content or Incorrect Request - Lightbox not triggered');
iMapsActions.lightbox.on('close', function () {
iMapsManager.clearSelected(id);
iMaps.maps[id].map.lastClickedEntry = false;
iMapsActions.lightboxIsRunning = false;
iMapsActions.contentBelow = function (id, data, scroll) {
// go 2 steps up to find map wrapper.
mapContainer = document.getElementById('map_' + id).parentNode.parentNode.parentNode,
mapContentContainer = mapContainer.parentNode.querySelector('.igm_content_below'),
footerContent = document.getElementById('igm-hidden-footer-content');
data.content = "[id='" + iMapsActions.getIDfromData(data) + "']";
if (mapContentContainer === null) {
mapContentContainer = document.createElement('div');
mapContentContainer.classList.add('igm_content_below');
mapContainer.parentNode.insertBefore(mapContentContainer, mapContainer.nextSibling);
what2hide = mapContentContainer.children;
if (what2hide && what2hide.length && footerContent) {
Array.from(what2hide).forEach((w2h) => {
w2h.style.display = 'none';
footerContent.appendChild(w2h);
what2display = document.querySelector(data.content);
mapContentContainer.appendChild(what2display);
if (what2display.style) {
what2display.style.display = 'block';
originalTop = Math.floor(mapContentContainer.getBoundingClientRect().top - 100);
iMapsActions.contentAbove = function (id, data, scroll) {
// go 2 steps up to find map wrapper.
var mapContainer = document.getElementById('map_' + id).parentNode.parentNode.parentNode,
mapContentContainer = mapContainer.parentNode.querySelector('.igm_content_above'),
footerContent = document.getElementById('igm-hidden-footer-content');
data.content = "[id='" + iMapsActions.getIDfromData(data) + "']";
if (mapContentContainer === null) {
mapContentContainer = document.createElement('div');
mapContentContainer.classList.add('igm_content_above');
mapContainer.parentNode.insertBefore(
mapContainer.parentNode.childNodes[0]
what2hide = mapContentContainer.firstChild;
if (what2hide && footerContent) {
what2hide.style.display = 'none';
footerContent.appendChild(what2hide);
what2display = document.querySelector(data.content);
mapContentContainer.appendChild(what2display);
what2display.style.display = 'block';
originalTop = Math.floor(mapContentContainer.getBoundingClientRect().top - 100);
iMapsActions.contentRight = function (id, data, mapClass, contentClass) {
// go 2 steps up to find map wrapper.
mapContainer = document.getElementById('map_' + id).parentNode.parentNode.parentNode,
mapContentContainer = mapContainer.parentNode.querySelector('.' + contentClass),
mapBox = mapContainer.parentNode.querySelector('.' + mapClass),
footerContent = document.getElementById('igm-hidden-footer-content');
data.content = "[id='" + iMapsActions.getIDfromData(data) + "']";
mapBox = mapContainer.parentNode.querySelector('.map_box');
mapBox.classList.add(mapClass);