Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 在Fancybox中打开静态google地图?_Jquery_Google Maps_Fancybox - Fatal编程技术网

Jquery 在Fancybox中打开静态google地图?

Jquery 在Fancybox中打开静态google地图?,jquery,google-maps,fancybox,Jquery,Google Maps,Fancybox,我试图在点击链接时将静态谷歌地图加载到fancybox/lightbox中。 我的代码是 <a href="http://maps.googleapis.com/maps/api/staticmap? zoom=13&size=400x400&markers=color:blue|32,50&sensor=true"><img src="icon.png" /></a> 但它不会显示,iframe保持为空。我猜这是因为map应该

我试图在点击链接时将静态谷歌地图加载到fancybox/lightbox中。 我的代码是

<a href="http://maps.googleapis.com/maps/api/staticmap?
 zoom=13&size=400x400&markers=color:blue|32,50&sensor=true"><img src="icon.png" /></a>

但它不会显示,iframe保持为空。我猜这是因为map应该作为IMG元素的src加载,对吗

你知道如何解决这个问题吗

另一种方法是在ViFrame中打开一个普通的google地图,但它总是显示两个标记,一个在位置,一个是google的“最佳猜测”——有没有办法删除“最佳猜测”标记?请参见示例,单击第一篇文章标题旁边的小地图图标

谢谢

静态地图(使用Google)可以渲染为常规图像

自从你的链接:

<a class="fancybox" href="http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=400x400&markers=color:blue|32,50&sensor=true"><img src="icon.png" /></a>
注意我将
class=“fancybox”
添加到锚点,以便可以将fancybox绑定到该选择器

请参见(使用fancybox v1.3.4)

编辑:由于您使用的是fancybox WP插件,您也可以将
图像
扩展名添加到URL末尾的锚点,例如添加
&filename=image.jpg
。。。因此,您的完整URL将如下所示:

href="http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=400x400&markers=color:blue|32,50&sensor=true&filename=image.jpg"

如果这样做,就不必编辑Easyfancybox脚本。检查fancybox的哪个版本?如果使用fancybox v2.x,请检查(扩展功能-->媒体助手)。。。另外,请确保您包括我使用的媒体js文件1.3.4,是的,我知道这些示例,但这些不是静态谷歌地图。看到我的网页链接的原始文章我实际上有类fancybox和iframe添加到锚,但在复制和粘贴过程中丢失了它。。。一个问题:在哪里添加jQuery代码?实际上,我正在使用Easyfancybox插件运行Wordpress,对fancybox的设置不是很熟悉……嗯,得到一个“无法加载请求的内容。请稍后再试。”错误。请参阅blog.felixsalomon.net。我猜我一定错过了什么?不,它正在工作,忘记了“size=”参数。你知道我如何使fancybox单数化吗?也就是说,它不显示跳转到下一个贴图/图像的箭头???@Dreamingof8a只需从Gallery中想要的元素中删除
rel
属性不幸的是,没有rel属性。这些链接看起来像echo src=“/images/geotaged.png”alt=“alt”/>但它们仍然分组在一起。。。
href="http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=400x400&markers=color:blue|32,50&sensor=true&filename=image.jpg"