Google Maps v3 在 Wordpress 中加载后移动 [英] Google Maps v3 Shifting After Loading in Wordpress

查看:16
本文介绍了Google Maps v3 在 Wordpress 中加载后移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该页面使用 Google 地图加载,并且最初不会填充它周围的容器.半秒后,谷歌地图填满了容器.

The page loads with Google Maps and doesn't initially fill the container surrounding it. Half second later Google maps fills up the container.

问题是在正确装满容器后它会变形.由于偏移而导致的经线显示它们中的两个彼此相邻.并且地图控件也扭曲了.甚至无法分辨缩放条在那里.

The problem is it's distorted after the container is properly filled. The longitude lines because of the shift show two of them right next to each other. And the map controls are distorted as well. Can't even tell the zoom bar is there.

非常感谢任何帮助!

这是我刚开始构建的 Wordpress 插件的一部分.

This is part of a Wordpress plugin that I just started building.

我还不能发布图片,否则我会的!

I can't post pictures yet or I would!

推荐答案

问题出在 wordpress 使用的默认主题中.下面这行代码概述了它只允许它达到所需宽度的 97.5%,从而弄乱谷歌地图.

The problem was in the default theme wordpress uses. The below line of code outlines it was only allowing it to go to 97.5% of the width it needed to messing up google maps.

.entry-content img, .comment-content img, .widget img { max-width: 97.5%;}

正确的代码(或对我有用的代码):

Correct code (or what worked for me):

.entry-content img, .comment-content img, .widget img { max-width: none;}

这篇关于Google Maps v3 在 Wordpress 中加载后移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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