gpt4 book ai didi

html - 如何在中心修复谷歌地图标记?

转载 作者:行者123 更新时间:2023-11-27 23:09:58 24 4
gpt4 key购买 nike

我在谷歌地图中有一个标记,我希望它始终位于中心(左侧也是可以接受的)。现在它在右上角,在小宽度上看不到。请帮忙!

<div class="mapouter">
<div class="gmap_canvas">
<iframe width="1086" height="290" id="gmap_canvas" src="https://maps.google.com/mapsq=%E1%83%9B%E1%83%98%E1%83%AA%E1%83%99%E1%83%94%E1%83%95%E1%83%98%E1%83%A9%E1%83%98%E1%83%A1%20%E1%83%A5%E1%83%A3%E1%83%A9%E1%83%90%207%E1%83%90&t=&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0">
</iframe>
<a href="https://www.emojilib.com">emojilib.com</a>
</div>
</div>

最佳答案

这有帮助吗?

<!DOCTYPE html>
<html>
<head>
<style>
/* Set the size of the div element that contains the map */
#map {
height: 400px; /* The height is 400 pixels */
width: 100%; /* The width is the width of the web page */
}
</style>
</head>
<body>
<h3>My Google Maps Demo</h3>
<!--The div element for the map -->
<div id="map"></div>
<script>
// Initialize and add the map
function initMap() {
// The location of Uluru
var uluru = {lat: -25.344, lng: 131.036};
// The map, centered at Uluru
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 4, center: uluru});
// The marker, positioned at Uluru
var marker = new google.maps.Marker({position: uluru, map: map});
}
</script>
<!--Load the API from the specified URL
* The async attribute allows the browser to render the page while the API loads
* The key parameter will contain your own API key (which is not needed for this tutorial)
* The callback parameter executes the initMap() function
-->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
</script>
</body>
</html>

关于html - 如何在中心修复谷歌地图标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58582846/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com