daily pastebin goal
8%
SHARE
TWEET

gmap

a guest Apr 16th, 2018 630 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function gmap_test_shortcode($atts){
  2.  
  3.         $styled_map_markup =
  4.         '<div id="map"></div>';
  5.  
  6.         $styled_map_markup .=
  7.         '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCcq_0Mx_FjdHdR-1NdnMobAPiOhZCaxig&region=US&callback=initMap""></script>';
  8.         $styled_map_markup .=
  9.         '<script>
  10.             function initMap() {
  11.                 var map = new google.maps.Map(document.getElementById('map'), {
  12.                   center: {lat: -34.397, lng: 150.644},
  13.                   zoom: 8
  14.                 });
  15.               }
  16.         </script>';
  17.         return $styled_map_markup;
  18.     }
  19.  
  20.     add_shortcode('gmap_test','gmap_test_shortcode');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top