最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Overlay HTML on a Google Map - Stack Overflow

programmeradmin2浏览0评论

Is there a way to add HTML content over the top of a Google Map using Google Maps API? I want to add a div with other HTML content in it.

P.S. Not looking to manipulate the Google Info Window.

Is there a way to add HTML content over the top of a Google Map using Google Maps API? I want to add a div with other HTML content in it.

P.S. Not looking to manipulate the Google Info Window.

Share Improve this question edited Sep 18, 2012 at 10:49 asked Sep 18, 2012 at 10:27 user1679934user1679934 1
  • What have you tried so far? I think it is possible, from the balloons or editing the html with javascript (something like document.getElementByID(theGoogleMapsID).innerHTML+=<div>...</div>) – Gabber Commented Sep 18, 2012 at 10:29
Add a ment  | 

3 Answers 3

Reset to default 1

You can use this nice library.

http://blog.mridey./2011/05/label-overlay-example-for-google-maps.html

With some adjustments it can be used to add what ever content you want.

This is how you add it as an overlay not InfoWindow.

I think the easiest and quickest way is to use the InfoBox library which is part of google-maps-utility-library-v3

You can find the docs under:

http://google-maps-utility-library-v3.googlecode./svn/trunk/infobox/docs/

and examples under:

http://google-maps-utility-library-v3.googlecode./svn/trunk/infobox/examples/

InfoBox extends the Google Maps JavaScript API V3 OverlayView class and allows you to adjust the layers to your needs without worrying about InfoWindows limitations.

Yes, it´s possible with infowindows.

Example: https://developers.google./maps/documentation/javascript/overlays?hl=es#InfoWindows

发布评论

评论列表(0)

  1. 暂无评论