Created
September 22, 2015 11:11
-
-
Save designbuildtest/5a2e962fed23dde5d414 to your computer and use it in GitHub Desktop.
Google Maps example - with marker and custom controls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="map" style="height:600px"></div> | |
| <script> | |
| function initMap() { | |
| var myLatLng = { lat: <?php esc_attr_e( sing_post_latitude() ); ?>, lng: <?php esc_attr_e( sing_post_longitude() ); ?> }; | |
| var map = new google.maps.Map(document.getElementById('map'), { | |
| center: myLatLng, | |
| scrollwheel: false, | |
| disableDoubleClickZoom: true, | |
| streetViewControl: false, | |
| mapTypeControl: false, | |
| zoom: 12, | |
| }); | |
| var marker = new google.maps.Marker({ | |
| position: myLatLng, | |
| map: map, | |
| title: '<?php the_title(); ?>' | |
| }); | |
| } | |
| </script> | |
| <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment