Skip to content

Instantly share code, notes, and snippets.

@carmoreira
carmoreira / reset.js
Created June 17, 2022 09:09
Interactive Geo Maps - Reset actions after menu filter dropdown changes
// replace 55677 with your map ID
document.addEventListener('input', function (event) {
if (event.target.id !== 'igm-live-filter-55677') return;
iMapsActions.resetActions(55677);
});
@carmoreira
carmoreira / igm-custom-solution.php
Created June 16, 2022 16:03
Interactive Geo Maps - Custom Solution to read from custom meta fields
<?php
/**
* Interactive Geo Maps Custom Solution
*
* @wordpress-plugin
* Plugin Name: Interactive Geo Maps Custom Solution
* Plugin URI: https://interactivegeomaps.com
* Description: Reads from custom meta fields
* Version: 1.0.0
* Author: Carlos Moreira
@carmoreira
carmoreira / specificMap.js
Created June 6, 2022 18:37
Display specific map after region is clicked based on region.value parameter - Interactive Geo Maps
// replace with your map ID and region code.
let mapID=3492193;
let mapContainer=document.getElementById('map_' + mapID);
mapContainer.addEventListener('mapready', function(ev) {
iMaps.maps[mapID].series[0].mapPolygons.each(function(region) {
region.events.on("hit", function(ev) {
let data=ev.target.dataItem.dataContext;
let drillTo=parseInt(data.value);
if (Array.isArray(iMapsManager.maps[mapID].seriesById[drillTo])) {
@carmoreira
carmoreira / reset.js
Last active May 16, 2022 13:51
Interactive Geo Maps - Add reset link to content that display below/side
jQuery('.igm-map-content').each(function() {
var button = jQuery('<a>Close</a>');
button.on('click', function() {
var mapID = 3492169; // replace with your map ID
iMapsManager.clearSelected(mapID);
iMapsActions.resetActions(mapID);
});
jQuery(this).prepend(button);
});
@carmoreira
carmoreira / show.js
Last active May 15, 2022 16:32
Show all marker series in map, if drilldown is enabled - Interactive Geo Maps
// added this control check, in case code was added more than once
if (typeof mapCode === 'undefined') {
let mapID = 159; // CHANGE MAP ID HERE
let mapContainer = document.getElementById('map_' + mapID);
mapContainer.addEventListener('mapready', function(ev) {
iMaps.maps[mapID].series.forEach(function(serie) {
if (serie.className === 'MapImageSeries') {
serie.show();
}
});
@carmoreira
carmoreira / WorldUSA.geojson
Created May 10, 2022 12:37
World map with USA divided by states - Compatible with Interactive Geo Maps WP Plugin
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carmoreira
carmoreira / rotate.js
Last active May 5, 2022 09:29
Rotate Globe in Interactive Geo Maps WordPress plugin - Pro
setTimeout(function ()
{
let mapAnimation;
let mapID = 21022; // CHANGE THIS WITH YOUR MAP ID
mapAnimation = iMaps.maps[mapID].map.animate(
{
property: "deltaLongitude",
to: 100000
}, 20000000);
iMaps.maps[mapID].map.seriesContainer.events.on("down", function ()
@carmoreira
carmoreira / style.css
Created May 3, 2022 14:03
Interactive Geo Maps - Choices Dropdown, change list width
.map_wrapper .choices__list--dropdown .choices__list {
max-height:200px !important;
}
@carmoreira
carmoreira / canarias.json
Created April 24, 2022 18:36
Canarias Spain Municipios GeoJSON file for Interactive Geo Maps
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carmoreira
carmoreira / australia.geojson
Created April 22, 2022 13:23
Australia geojson more detailed - Interactive Geo Maps
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.