Map is now working
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 18 Mar 2016 20:47:34 +0000 (16:47 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 18 Mar 2016 20:47:34 +0000 (16:47 -0400)
need to style the popup better some wierd padding going on

css/front.css
js/dashboard.js
models/front/events/detail.php
views/front/events/detail.html

index 744037c..915165f 100644 (file)
@@ -97,3 +97,7 @@
     color: #fff;
     font-weight: bold;
 }
+#eventDetail-map {
+     cursor: pointer;
+     height: 160px;
+}
index 350d33d..1136fae 100644 (file)
@@ -5,4 +5,18 @@
     $('#glm-event-detail-backtosearch').click(function(){
         window.history.back();
     });
+    if ($('#eventDetail-map').length) {
+        GLM_GeoMap.initialize();
+        $('#map-dialog').dialog({
+            height: 480,
+            width: 520,
+            modal: true,
+            autoOpen: false
+        });
+        $("#eventDetail-map").click(function(e){
+            e.preventDefault();
+            $("#map-dialog").dialog('open');
+            GLM_GeoMap.initializeLargeMap();
+        });
+    }
 }).call(this);
index b392d02..b18b9a5 100644 (file)
@@ -40,9 +40,9 @@ class GLmMembersFront_events_detail extends GlmMembersFront_events_baseAction
         } else {
             $fromDate = date('m/d/Y');
         }
-        $this->dateRange = "start_time >= '{$from}'";
+        $this->dateRange = "start_time >= '{$fromDate}'";
 
-        if ($eventId = filter_var($_REQUEST['eventId'], FILTER_VALIDATE_INT)) {
+        if ( isset($_REQUEST['eventId']) && $eventId = filter_var($_REQUEST['eventId'], FILTER_VALIDATE_INT)) {
             $search = true;
             $action = 'event-detail';
         } else {
@@ -58,6 +58,22 @@ class GLmMembersFront_events_detail extends GlmMembersFront_events_baseAction
         }
 
         $categories = $this->getCategories();
+        wp_register_script(
+            'googlemaps-js',
+            'http://maps.googleapis.com/maps/api/js?key=',
+            null,
+            GLM_MEMBERS_EVENTS_PLUGIN_VERSION,
+            true
+        );
+        wp_enqueue_script('googlemaps-js');
+        wp_register_script(
+            'event-geocoder-js',
+            GLM_MEMBERS_EVENTS_PLUGIN_BASE_URL . '/js/geoCoder.js',
+            null,
+            GLM_MEMBERS_EVENTS_PLUGIN_VERSION,
+            true
+        );
+        wp_enqueue_script('event-geocoder-js');
         wp_register_script(
             'event-dashboard-js',
             GLM_MEMBERS_EVENTS_PLUGIN_BASE_URL . '/js/dashboard.js',
index 3cc98e6..36fbeba 100644 (file)
             <div class="row">
                 {if $event.locations}
                 <div class="small-5 column">
+                    <div id="eventDetailMap">
+                        <div id="eventDetail-map" title="Click to enlarge">map...</div>
+                        <div id="map-dialog"><div id="map_canvas" style="width:500px; height:400px">Loading...</div></div>
+                    </div>
+                    <div id="event-lat" rel="{$event.locations.lat}"></div>
+                    <div id="event-lon" rel="{$event.locations.lon}"></div>
                     <form id="EventDrivingDirectionsForm" name="EventDrivingDirectionsForm" flexy:ignore="yes" method="post" action="">
-                        <img style="margin: 0 15px 15px;" src="http://placehold.it/220x220">
                         <input type="hidden" id="EventLocation" name="EventLocation" value="{$event.locations.name}">
                         <input type="hidden" id="EventLat" name="EventLat" value="{$event.locations.lat}">
                         <input type="hidden" id="EventLon" name="EventLon" value="{$event.locations.lon}">