html- /样式的谷歌地图api v3工具提示 [英] html- / styling of- tooltips in google maps api v3

查看:113
本文介绍了html- /样式的谷歌地图api v3工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚Google如何将图像和样式添加到在Google地图上出现在标记上的工具提示中。



所需行为的示例可以是看到这里:



http://maps.google.es/maps?oe=utf-8&q=hotels+in+sydney



如果您将鼠标悬停在某个酒店标记上,则会看到不同的样式(粗体文本,普通文本),段落或换行符,以及酒店星级图像。就我从文档中看到的情况而言,这些工具提示是通过给每个标记赋予一个标题属性来创建的......但是,此属性中的任何HTML都会被转义;您最终可能会看到如下所示的工具提示:

 < p class =tooltip-text> This does not' t work!< / p> < image src =/ images / myimage.png/> 

...这不是理想的结果。

任何人有任何想法? 这些工具。有和infobox定制几乎取代了默认的,但保留了它的所有属性。希望它有帮助!


I'm trying to work out how Google adds images and styling to their tooltips that appear over markers in google maps.

An example of the desired behaviour can be seen here:

http://maps.google.es/maps?oe=utf-8&q=hotels+in+sydney

If you mouseover one of the hotel markers, you will see different styles (bold text, normal text), paragraphs or line breaks, and images for the star-rating of the hotel. As far as I can see from the docs, these tooltips are created by giving each marker a 'title' attribute... however, any HTML in this attribute is escaped; you might end up with a tooltip that looks like:

<p class="tooltip-text">This doesn't work!</p> <image src="/images/myimage.png" />

... which is not the desired outcome.

Anyone have any ideas?

解决方案

Check out these tools. There's and infobox customization which pretty much replaces the default one but retains all it's properties. Hope it helps!

这篇关于html- /样式的谷歌地图api v3工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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