changing css file name, commenting out the unpkg cdn call for leaflet, changing the...
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 10 Dec 2018 16:47:28 +0000 (11:47 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 10 Dec 2018 16:47:28 +0000 (11:47 -0500)
css/front.min.css [deleted file]
css/glm-county-map.min.css [new file with mode: 0644]
gulpfile.js
models/front/map/display.php
sass/front/_map.scss
views/front/map/display.html

diff --git a/css/front.min.css b/css/front.min.css
deleted file mode 100644 (file)
index 86881a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#area-map-container{padding:0 10px;text-align:center;margin-bottom:25px;width:70vw;margin:0 auto;position:relative;left:-7%}#area-map-container #area-map{z-index:0;height:550px;box-shadow:0 -5px 20px rgba(0,0,0,0.19),0 6px 6px rgba(0,0,0,0.23)}.glm-theme-map-label{display:block;width:105px}@media (max-width: 1024px){#area-map-container{overflow:hidden;min-height:420px}#area-map-container #area-map{position:relative}}
diff --git a/css/glm-county-map.min.css b/css/glm-county-map.min.css
new file mode 100644 (file)
index 0000000..cfd80bb
--- /dev/null
@@ -0,0 +1 @@
+#area-map-container{padding:0 10px;text-align:center;margin-bottom:25px;width:100%;margin:0 auto;position:relative}#area-map-container #area-map{z-index:0;height:550px;box-shadow:0 -5px 20px rgba(0,0,0,0.19),0 6px 6px rgba(0,0,0,0.23)}.glm-theme-map-label{display:block;width:105px}@media (max-width: 1024px){#area-map-container{overflow:hidden;min-height:420px}#area-map-container #area-map{position:relative}}
index 92795ab..fd95bb0 100644 (file)
@@ -28,7 +28,7 @@ gulp.task('front-sass', function() {
         // includePaths: sassPaths ,
         outputStyle: 'compressed'
     })).on('error', swallowError)
-    .pipe(rename('front.min.css'))
+    .pipe(rename('glm-county-map.min.css'))
     .pipe(gulp.dest('css'))
 });
 
index 8bdc7ba..abb4363 100644 (file)
@@ -114,7 +114,14 @@ class GlmMembersFront_map_display extends GlmDataMapSettings
             $pages[$page->ID]['name'] = $page->post_title;
             $pages[$page->ID]['url'] = get_permalink($page->ID);
         }
-        wp_enqueue_style('admin-css', GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'css/front.min.css');
+        add_action( 'wp_enqueue_scripts', 'register_plugin_styles' );
+
+        function register_plugin_styles() {
+          
+               wp_register_style('front-css', GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'css/glm-county-map.min.css');
+               wp_enqueue_style('front-css');
+        }
+        
         // Compile template data
         $templateData = array(
             'assets'    => GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'assets/',
index e178904..b6e391e 100644 (file)
@@ -2,10 +2,10 @@
     padding: 0 10px;
     text-align: center;
     margin-bottom: 25px;
-    width: 70vw;
+    width: 100%;
     margin: 0 auto;
     position: relative;
-    left: -7%;
+    // left: -7%;
     #area-map{
         z-index: 0;
         height: 550px;
index adc56ce..16e7c8e 100644 (file)
@@ -2,19 +2,19 @@
     <div id="area-map"></div>
 </div>
 
-<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.3/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
-<script src="https://unpkg.com/leaflet@1.3.3/dist/leaflet.js" integrity="sha512-tAGcCfR4Sc5ZP5ZoVz0quoZDYX5aCtEm/eu1KhSLj2c9eFrylXZknQYmxUssFaVJKvvc0dJQixhGjG2yXWiV9Q==" crossorigin=""></script>
-<link rel="stylesheet" href="//unpkg.com/leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css" type="text/css">
-<script src="//unpkg.com/leaflet-gesture-handling"></script>
+<!-- <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.3/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/> -->
+<!-- <script src="https://unpkg.com/leaflet@1.3.3/dist/leaflet.js" integrity="sha512-tAGcCfR4Sc5ZP5ZoVz0quoZDYX5aCtEm/eu1KhSLj2c9eFrylXZknQYmxUssFaVJKvvc0dJQixhGjG2yXWiV9Q==" crossorigin=""></script> -->
+<!-- <link rel="stylesheet" href="//unpkg.com/leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css" type="text/css">
+<script src="//unpkg.com/leaflet-gesture-handling"></script> -->
 
 <script>
     jQuery(function($){
 
         // Create map with default center and size
-        var countyMap = L.map('area-map').setView([46.5, -87.0], 8);
+        var countyMap = L.map('area-map').setView([46.6, -87.0], 8);
         var countiesDirectory = '{$assets}/counties/';
             // Tile Server URL
-            tileServer = 'https://maps.gaslightmedia.com/12312029-NoPlaceNames-95bfebd37e9e7d649daafa8762629084/'+ {literal}'{z}/{x}/{y}.png'{/literal};
+            var tileServer = 'https://maps.gaslightmedia.com/12312029-NoPlaceNames-95bfebd37e9e7d649daafa8762629084/'+ {literal}'{z}/{x}/{y}.png'{/literal};
             
             // Create Tile layer
             L.tileLayer(tileServer, {
@@ -97,7 +97,8 @@
                 var page = "#";
                 var location = areas.filter( function(area){
                     return area.area_name == county;
-                })
+                });
+   
                 location = location[0];
                 if(parseInt(location.page_id)){
                     page = pages[location.page_id]['url'];