地图缩放控件显示不正确 [英] Map zoom controls not displaying correctly
本文介绍了地图缩放控件显示不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 API3 创建了一个简单的地图.但是,左上角的缩放控件看起来被压扁了"——因为它们没有正确显示.地图的其余部分很好.奇怪的是,我使用了与以前网站相同的方法,那里的东西运行良好.
I have created a simple map using API3. However, the zoom controls on the top left look "Squashed" - a they are not displaying properly. The rest of the map is fine. The weird thing is that I have used the same method as for previous sites, where things work well.
这是一些代码:
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;
var marker;
var markersArray=[];
var html; //to create urls
var directionsVisible = new Boolean();
directionsVisible = false;
function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer();
var orchards = new google.maps.LatLng(52.512805,-2.76007);
var myOptions = {
zoom:14,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: orchards,
panControl: false
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
addMarker(orchards);
}
推荐答案
问题应该是通用的 img { max-width: 100%;}
在你的 css 中试试这个
.gmnoprint img {
max-width: none;
}
这篇关于地图缩放控件显示不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文