From: Anthony Talarico Date: Fri, 7 Dec 2018 18:12:47 +0000 (-0500) Subject: adding leaflet enqueueing to the functions file instead of each partial file, removin... X-Git-Tag: v1.0.0^2~360 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9e0e47884878034b7d72ea93c0ef983583159e33;p=WP-Themes%2Fuptravel.git adding leaflet enqueueing to the functions file instead of each partial file, removing the initmap function from being called twice --- diff --git a/functions.php b/functions.php index 257b3a7..92d2418 100644 --- a/functions.php +++ b/functions.php @@ -84,7 +84,7 @@ function glm_site_scripts() true ); - // wp_enqueue_script('slick_script', get_template_directory_uri() . '/slick/slick/slick.min.js', array('jquery'), null, false); + wp_enqueue_script('leaflet', 'https://unpkg.com/leaflet@1.3.3/dist/leaflet.js', array('jquery'), null, false); // wp_enqueue_style('slick-style', get_template_directory_uri() . '/slick/slick/slick.css'); // wp_enqueue_style('slick-theme', get_template_directory_uri() . '/slick/slick/slick-theme.css'); // wp_enqueue_style('fontAwesome', get_template_directory_uri() . '/css/font-awesome.min.css'); diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index baa33e6..cf73ac1 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -9,7 +9,7 @@ {if $settings.selected_map_interface == 1} - + @@ -581,22 +581,20 @@ function initMap() { - var leafletMap = L.map('LeafletMapContainer', { - gestureHandling: true - }); + var leafletMap = L.map('LeafletMapContainer'); leafletMap.setView([{$settings.maps_default_lat}, {$settings.maps_default_lon}], defZoom); var leafletTileServer = '{$settings.leaflet_tile_server}/{$settings.leaflet_tile_server_key}/' + {literal}'{z}/{x}/{y}.png'{/literal}; var leafletMinZoom = 3; var leafletMaxZoom = 19; var clusterRadiusMax = 40; - var geocoder; + // var geocoder; // Loading features - var loadingControl = L.Control.loading({ - separate: true, - delayIndicator: 500 - }); - leafletMap.addControl(loadingControl); + // var loadingControl = L.Control.loading({ + // separate: true, + // delayIndicator: 500 + // }); + // leafletMap.addControl(loadingControl); // Init Map L.tileLayer(leafletTileServer, { @@ -804,7 +802,7 @@ initMap(); mapInitialized = true; {/if} - initMap(); + //initMap(); {/if} // Processes click-through counts for website links