Fixed problem with map reverting to address location each time member profile loads.
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 24 Aug 2017 16:22:28 +0000 (12:22 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 24 Aug 2017 16:22:28 +0000 (12:22 -0400)
Made map show all of the time, removed map show/hide button, and fixed some minor possitioning issues with map related elements.

views/admin/member/memberInfo.html
views/admin/member/memberInfo/editProfileAddress.html

index d8dc229..58be0ac 100644 (file)
             /*
              * Map Display Toggle
              */
+/*             
             $("#locationMapToggle").click(function() {
                 var mapC = "#locationMapContainer";
                 var map = "#locationMap";
                 var mapOverflow = 'hidden';
                 var mapBtnTxt = 'View Map';
                 if ($(mapC).height() == 0) {
-                    mapNewH = 400;
+                    mapNewH = 460;
                     mapV = 'visible';
                     mapBtnTxt = 'Hide Map';
                 }
-                initMap();
                 $(mapC).animate({
                     overflow: mapOverflow,
                     height: mapNewH
                 });
                 $(this).html(mapBtnTxt);
             });
+*/
 
             /*
              * Map operations
                     // Assign it to the lat/lon fields for submission
                     $('#glmLat').val(glmLat.toFixed(6));
                     $('#glmLng').val(glmLng.toFixed(6));
+                    
+                    glmPageUpdateRequired();
 
                 });
 
                 // When estimate location button is clicked, geocode using address
-
-                $(document).on('click','#locationMapToggle', glmEstimateLocation);
+//                $(document).on('click','#locationMapToggle', glmEstimateLocation);
                 $(document).on('click','#glm-estimate-location', glmEstimateLocation);
 
                 function glmEstimateLocation() {
             }
             checkLiveCamType();
 
+            // Initialize map on load
+            initMap();
+
         });
     </script>
 
index 67d8fae..d240f91 100644 (file)
                         <div class="glm-row">
                             {if $memberInfo.fieldRequired.lat}<h4 class="emRequiredInputField">{else}<h4>{/if}Location:</h4>
                             <div class="glm-small-12">
-                                <div id="glm-estimate-location" class="button button-secondary glm-left">Map Location Using Above Address</div>
-                                <div id="locationMapToggle" class="button button-secondary glm-right">View Map</div>
-                                <div id="locationMapContainer" style="height: 0;">
-                                    <p>
-                                        AP USE: Drag the pointer to the desired location for this {$terms.term_member}.
-                                        Use + and - buttons or the mouse wheel to zoom in or out.
-                                        Click and drag anywhere else on the map to move to another area.
-                                    </p>
-                                    <div id="locationMap" class="glm-map-edit-small">(map loads here)</div>
-                                </div>
-                                <p>
-                                    <b>Selected Position:</b>
-                                    &nbsp;&nbsp;Latitude <input id="glmLat" name="lat" type="text" value="{$memberInfo.fieldData.lat}" class="glm-form-text-input-veryshort">
-                                    &nbsp;&nbsp;Longitude <input id="glmLng" name="lon" type="text" value="{$memberInfo.fieldData.lon}" class="glm-form-text-input-veryshort">
-                                    &nbsp;&nbsp;<span id="latLonRecenter" class="button button-secondary">Update pointer with new lat/lon postion.</span>
+                               <p>
+                                    Drag the pointer to the desired location for this {$terms.term_member}.
+                                    Use + and - buttons or the mouse wheel to zoom in or out.
+                                    Click and drag anywhere else on the map to move to another area.
                                 </p>
+                                <p><div id="glm-estimate-location" class="button button-secondary">Map Location Using Above Address</div></p>
+                                <div id="locationMap" class="glm-map-edit-small" style="height: 400">(map loads here)</div>
+                                <p>
+                                    <h4>Specify Position Using Lattitude and Longitude:</h4>
+                                       Latitude <input id="glmLat" name="lat" type="text" value="{$memberInfo.fieldData.lat}" class="glm-form-text-input-veryshort">
+                                       &nbsp;&nbsp;Longitude <input id="glmLng" name="lon" type="text" value="{$memberInfo.fieldData.lon}" class="glm-form-text-input-veryshort">
+                                    <p><span id="latLonRecenter" class="button button-secondary">Update pointer after entering new lat/lon postion.</span></p>
+                               </p>
                             </div>
                         </div>
                     </div>