00:00 / 06:01
连播
清屏
智能
倍速
点赞6
00:00 / 06:33
连播
清屏
智能
倍速
点赞13
00:00 / 01:19
连播
清屏
智能
倍速
点赞29
00:00 / 02:38
连播
清屏
智能
倍速
点赞2
00:00 / 13:16
连播
清屏
智能
倍速
点赞5
00:00 / 14:06
连播
清屏
智能
倍速
点赞14
00:00 / 09:03
连播
清屏
智能
倍速
点赞12
00:00 / 18:36
连播
清屏
智能
倍速
点赞8
00:00 / 08:44
连播
清屏
智能
倍速
点赞7
Q 谷歌地图API v3 - 标记不显示 javascript google-maps google-maps-api-3 2 我试图在地图上显示标记,但它不显示。我试过这个代码在谷歌地图API v3 - 标记不显示 <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyC9XWl7H7Q7t6XWJ7W7X7Z7m7X7d7X7W7X7&sensor=false"> </script> <script type="text/javascript"> function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(-34.397, 150.644), map: map, title: 'Hello World!' }); } </script> </head> <body onload="initialize()"> <div id="map_canvas" style="width:100%; height:100%"> </div> </body> </html> 我也试过在http://jsfiddle.net/但没有标记显示。 回答 10 你需要调用 initialize函数在地图API加载后: <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyC9XWl7H7Q7t6XWJ7W7X7Z7m7X7d7X7W7X7&sensor=false&callback=initialize"> </script> ,并删除 onload="initialize()"从身体标签。 这里是一个工作示例:http://jsfiddle.net/upsidown/5cX79/ 它的工作原理!非常感谢你! – 你是男人!非常感谢你! – 2 我有同样的问题,我发现了另一个解决方案,它的工作原理。 <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyC9XWl7H7Q7t6XWJ7W7X7Z7m7X7d7X7W7X7&sensor=false"> </script> <script type="text/javascript"> function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(-34.397, 150.644), map: map, title: 'Hello World!' }); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="map_canvas" style="width:100%; height:100%"> </div> </body> </html> 这将在窗口加载时执行初始化函数。(【退款规则】到店核销:随时可退,过期未核销自动退)#抖音美食推荐官 #美食推荐 #美食vlog #美食探店日记 #早餐
00:00 / 00:32
连播
清屏
智能
倍速
点赞3
00:00 / 01:20
连播
清屏
智能
倍速
点赞13
00:00 / 08:14
连播
清屏
智能
倍速
点赞35