Skip to content

Instantly share code, notes, and snippets.

Avatar

Carlos Moreira carmoreira

View GitHub Profile
@carmoreira
carmoreira / front.php
Created Jul 18, 2022
Add more share button to Advisor Quiz WordPress plugin
View front.php
// Replace this function in your front.php to give customers more share buttons.
function advq_get_after_results_content($id,$data,$options) {
$html = '';
if(isset($data['code_after_results']) && $data['code_after_results'] != ''){
$html .= '<div class="advq_integration_after_results">';
if( $options['render_shortcodes_integration'] ){
@carmoreira
carmoreira / pan.js
Last active Jun 22, 2022
Interactive Geo Maps - Remove Pan out limit - allow map to be dragged beyond the limits
View pan.js
// replace with your map ID.
let mapID = 877;
let mapContainer = document.getElementById('map_' + mapID);
mapContainer.addEventListener('mapready',function(ev){
iMaps.maps[mapID].map.maxPanOut = 10;
});
@carmoreira
carmoreira / reset.js
Created Jun 17, 2022
Interactive Geo Maps - Reset actions after menu filter dropdown changes
View reset.js
// 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 Jun 16, 2022
Interactive Geo Maps - Custom Solution to read from custom meta fields
View igm-custom-solution.php
<?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 / drilldownzoom.js
Created Jun 9, 2022
Show all overlay series after specific zoom level - Interactive Geo Maps
View drilldownzoom.js
let igmNow = Date.now();
let igmZoomLevel = 3;
mapContainer.addEventListener('mapready', function(ev) {
let igmap = iMaps.maps[mapID].map;
igmap.events.on("zoomlevelchanged", function(ev) {
if( Date.now() >= igmNow + 500){
let series = iMaps.maps[mapID].series;
series.forEach(function(serie) {
if( iMaps.maps[mapID].allBaseSeries.includes( serie ) ){ return; }
if (igmap.zoomLevel >= igmZoomLevel) {
@carmoreira
carmoreira / specificMap.js
Created Jun 6, 2022
Display specific map after region is clicked based on region.value parameter - Interactive Geo Maps
View specificMap.js
// 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 / WorldUSA.geojson
Created May 10, 2022
World map with USA divided by states - Compatible with Interactive Geo Maps WP Plugin
View WorldUSA.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carmoreira
carmoreira / style.css
Created May 3, 2022
Interactive Geo Maps - Choices Dropdown, change list width
View style.css
.map_wrapper .choices__list--dropdown .choices__list {
max-height:200px !important;
}
@carmoreira
carmoreira / canarias.json
Created Apr 24, 2022
Canarias Spain Municipios GeoJSON file for Interactive Geo Maps
View canarias.json
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 Apr 22, 2022
Australia geojson more detailed - Interactive Geo Maps
View australia.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.