admin管理员组文章数量:1391990
I am currently creating a map with multiple markers using the API V3 of Google Map. a click on the marker triggers the display of an InfoWindow describing details of this latter.
I need to know how to make the corners of my InfoWindow round like in the API V2 of Google Map?
I am currently creating a map with multiple markers using the API V3 of Google Map. a click on the marker triggers the display of an InfoWindow describing details of this latter.
I need to know how to make the corners of my InfoWindow round like in the API V2 of Google Map?
Share Improve this question edited Oct 28, 2016 at 21:25 geocodezip 161k14 gold badges226 silver badges254 bronze badges asked Aug 16, 2012 at 14:18 user1603417user1603417 491 silver badge2 bronze badges 1- check this answer stackoverflow./questions/3860277/… – Jorge Commented Aug 16, 2012 at 14:31
3 Answers
Reset to default 1The infobubble lets you create custom infowindows and configure them (pretty much) how you like.
You can't customize the css of the existing InfoWindow, but you can replace it with something more customizable. I like InfoBox because it is very similar to the regular InfoWIndow but with more styling options. InfoBox is actually part of the same Google Maps Utility Library that geocodezip linked to. I remend downloading both and seeing which one fits your needs best.
google-maps-utility-library-v3
I've used this code as a dirty hack to achieve this:
google.maps.event.addListener(this._w, 'domready', function () {
$('#map .bubbleContent')
.parent().parent().parent().prev()
.css('borderRadius', 5);
});
This code uses jQuery (can also be done width plain JS).
The selector #map .bubbleContent
finds the wrapping div of the HTML-Content I've put into the infoWindow. #map
is my map container, just to be sure not to select any div out of the map.
Note! This code may break whenever Google changes the markup of the infowindow.
本文标签: javascripthow to make round corners of infowindow in the V3 of Google MapStack Overflow
版权声明:本文标题:javascript - how to make round corners of infowindow in the V3 of Google Map? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744693245a2620123.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论