地图缩放控件无法正确显示 [英] Map zoom controls not displaying correctly

查看:149
本文介绍了地图缩放控件无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用API​​3创建了一个简单的地图。但是,左上角的缩放控件看起来像压扁 - 它们没有正确显示。地图的其余部分没有问题。奇怪的是,我已经使用了与以前的网站相同的方法,在那里工作很好。

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.

以下是一些代码:

Here's some code:

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%; }

The issue should be because of universal img { max-width: 100%; }

试试这一个到你的css

.gmnoprint img {
    max-width: none; 
}

这篇关于地图缩放控件无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆