专注前端素材!
源代码:
点击运行
<html> <head> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBzE9xAESye6Kde-3hT-6B90nfwUkcS8Yw&sensor=false"> </script> <script> function initialize() { var mapProp = { center: new google.maps.LatLng(51.508742,-0.120850), zoom:9, mapTypeId: google.maps.MapTypeId.ROADMAP }; var mapProp2 = { center: new google.maps.LatLng(51.508742,-0.120850), zoom:9, mapTypeId: google.maps.MapTypeId.SATELLITE }; var mapProp3 = { center: new google.maps.LatLng(51.508742,-0.120850), zoom:9, mapTypeId: google.maps.MapTypeId.HYBRID }; var mapProp4 = { center: new google.maps.LatLng(51.508742,-0.120850), zoom:9, mapTypeId: google.maps.MapTypeId.TERRAIN }; var map = new google.maps.Map(document.getElementById("googleMap"),mapProp); var map2 = new google.maps.Map(document.getElementById("googleMap2"),mapProp2); var map3 = new google.maps.Map(document.getElementById("googleMap3"),mapProp3); var map4 = new google.maps.Map(document.getElementById("googleMap4"),mapProp4); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="googleMap" style="width:400px;height:300px;"></div> <br> <div id="googleMap2" style="width:400px;height:300px;"></div> <br> <div id="googleMap3" style="width:400px;height:300px;"></div> <br> <div id="googleMap4" style="width:400px;height:300px;"></div> </body> </html>
运行结果