mkgd_footer

The MK Google Directions mkgd footer function.

Description

mkgd_footer(); 

Usage

  1. if ( !function_exists( 'mkgd_footer' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'mk-google-directions/mk-google-directions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = mkgd_footer(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/mk-google-directions.php  
  1. function mkgd_footer() { 
  2. wp_enqueue_script('mkgd-google-map', plugins_url('/js/mkgd-google-map.js', __FILE__), array('jquery')); 
  3. ?> 
  4. <script type="text/javascript"> 
  5. jQuery("#btnMkgdSubmit").click(function() {  
  6. var start = document.getElementById('origin').value; 
  7. var end = document.getElementById('destination').value; 
  8. if(start == "" || end == "") { alert("Please enter start and end points of your destination."); return false;}  
  9. jQuery('#directions').html('<center><br/><img src="<?php echo plugins_url('mk-google-directions/images/loader.gif') ?>" alt="Loading Directions" title="Loading Directions"/></center>'); 
  10. jQuery.post('<?php echo plugins_url('/mkgd-ajax-handler.php', __FILE__); ?>', {origin: start, destination: end, language: '<?php echo get_option('mkgd_language', 'en'); ?>'}, function(data) { 
  11. jQuery('#directions').html(data); 
  12. }); 
  13. }); 
  14. </script> 
  15. <script type="text/javascript"> 
  16. /* 
  17. * Load the google map 
  18. */  
  19. function initialize() { 
  20. directionsDisplay = new google.maps.DirectionsRenderer(); 
  21. var chicago = new google.maps.LatLng(<?php echo get_option('mkgd_latitude', '43.6525'); ?>, <?php echo get_option('mkgd_longitude', '-79.3816667'); ?>); 
  22. var mapOptions = { 
  23. zoom:7,  
  24. mapTypeId: google.maps.MapTypeId.ROADMAP,  
  25. center: chicago 
  26. map = new google.maps.Map(document.getElementById('mkgd-map-canvas'), mapOptions); 
  27. directionsDisplay.setMap(map); 
  28.  
  29. </script> 
  30. <?php