为什么google的infoWindow CSS没有曝光?定制太难了

tim*_*tim 6 css customization google-maps infowindow google-maps-api-3

这真让我烦恼 - 很多.

在浏览了谷歌地图v3后,在firebug中生成了客户端代码,我准备开车沿着街道行驶并给这些工程师一些心思...... arrrgh:P

infowWindow类生成HTML,我个人认为它只是坚果.也许有人可以帮助我理解它.

infowWindow HTML结构如下:

#map_canvas > div > div > div > div > div // 5 levels of elements, 
no big deal here, ok...
> div // top left corner
div // top right corner
div // bottom left corner
div // bottom right corner

// now comes fun stuff for the speech bubble arrow:

div
div
div
div
div
div
div
div
div
div

// the 10 divs above are stacked diagonally with odd sizes to make this arrow. 
i'm sorry but WHY?!? is it done like that? I suppose they wanted the user to be 
able to grab the map even right next to the arrow. Think about this: do users 
really need to be able to not grab the arrow? if grabbing the arrow causes map pan, 
as is the case for the shadow images, would that really be a problem?

div // bottom middle for image background border or something
div // top middle
div // middle
div // bottom middle, again
div // entire block of the infoWindow, probably the container
> img // close box
div // center block with the contents of the infoWindow
div // text content container
Run Code Online (Sandbox Code Playgroud)

哇 - 这太疯狂了!

请注意,没有真正的语义结构,而且 - 天哪,我敢做这样的假设 - 没有任何类名,没有.我想他们可能会有一些9片盒子然后分开制作箭头; 我的意思是,iw3.png中的图像精灵肯定不会成为问题.

我非常希望能对这个api产生影响的人遇到这个问题,希望google最终会找到解决这个问题的方法,以便自定义的infoWindow视觉效果和标记一样简单.

感谢您的调整!快乐的评论.

与此同时,我将使用黑客攻击这些疯狂的div并让他们做我的竞标.


早些时候我评论了其他一些帖子,我认为在API中要求一个方法可以让你使用自定义用户界面而不需要像现在这样需要对整个窗口对象进行近乎重复的方法(参见google扩展类v3).

google.maps.infoWindow.setStyle({
  'topleft' : {
    'background' : 'url(images/windowsprite.png) 0 0 no-repeat',
    'width' : '10px',
    'height' : '10px'
  },
  'topRight' : {
     ...etc...
  }
  ...etc...
})
Run Code Online (Sandbox Code Playgroud)

Ron*_*ieT 0

您尝试使用 CSS 进行样式设计吗?下面的例子展示了这一点。这是更改 UI 的最直接的方法。

http://code.google.com/apis/maps/documentation/javascript/overlays.html#InfoWindows