Created
July 31, 2017 16:59
-
-
Save shangdev/108baf8860a8cef29260aa19e10992ce to your computer and use it in GitHub Desktop.
Google Map API 移动友好处理
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
官方文档:https://developers.google.com/maps/documentation/javascript/interaction?hl=zh-cn | |
<script> | |
/** | |
* Google Map | |
*/ | |
function initMap() { | |
var uluru = {lat: 34.318877, lng: 108.948488}; | |
var map = new google.maps.Map(document.getElementById('c_map'), { | |
center: uluru, | |
zoom: 18, | |
gestureHandling: 'cooperative' | |
}); | |
var marker = new google.maps.Marker({ | |
position: uluru, | |
map: map, | |
title: 'TianDi Times Square' | |
}); | |
} | |
</script> | |
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCvmbopjxRN7SXMf6oA247XEpy_dm_R03A&callback=initMap" defer="defer"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment