gpt4 book ai didi

jquery - 谷歌地图标记奇怪地拉伸(stretch)问题

转载 作者:行者123 更新时间:2023-12-03 22:34:53 25 4
gpt4 key购买 nike

我遇到了谷歌地图的奇怪行为(参见附图)有人知道这是怎么发生的吗?有人以前经历过吗?

after dragging close代码如下

<script>
<!--
var map_geolocation;

function savePosition_geolocation(point)
{
var input = document.getElementById("id_geolocation");
input.value = point.lat().toFixed(6) + "," + point.lng().toFixed(6);
map_geolocation.panTo(point);
}

function load_geolocation() {
var point = new google.maps.LatLng(50.728632, 9.111587);

var options = {
zoom: 13,
center: point,
mapTypeId: google.maps.MapTypeId.ROADMAP
// mapTypeControl: true,
// navigationControl: true
};

map_geolocation = new google.maps.Map(document.getElementById("map_geolocation"), options);

var marker = new google.maps.Marker({
map: map_geolocation,
position: new google.maps.LatLng(50.728632, 9.111587),
draggable: true

});
google.maps.event.addListener(marker, 'dragend', function(mouseEvent) {
savePosition_geolocation(mouseEvent.latLng);
});

google.maps.event.addListener(map_geolocation, 'click', function(mouseEvent){
marker.setPosition(mouseEvent.latLng);
savePosition_geolocation(mouseEvent.latLng);
});

}

$(function() {
load_geolocation();
});

//-->
</script>
<input type="hidden" name="geolocation" value="50.728632,9.111587" id="id_geolocation" /><div id="map_geolocation" style="width: 400px; height: 300px"></div>

最佳答案

我见过各种形式的拉伸(stretch)图 block 和扭曲控件,但这是我第一次看到拉伸(stretch)标记和阴影。如果幸运的话,将这些行添加到 CSS 或样式中将会拉伸(stretch) map 和标记。

 #map_geolocation label { width: auto; display:inline; }
#map_geolocation img { max-height: none; max-width: none; }

我尝试了您附加的代码,看起来没问题。

关于jquery - 谷歌地图标记奇怪地拉伸(stretch)问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10821304/

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