为什么元素A不可见?看来appendChild()函数被忽略。我只能看到B元素。 (元素是可见的,如果我把它控制内部):(appendChild不能在Google地图中使用
var a = document.createElement('A');
a.style.width = '50px';
a.style.height = '50px';
a.style.cursor = 'pointer';
a.style.backgroundColor = 'rgba(10,20,30,1.0)';
var b = document.createElement('B');
b.style.width = '200px';
b.style.height = '200px';
b.style.backgroundColor = 'rgba(230,230,230,0.6)';
b.appendChild(a);
map.controls[google.maps.ControlPosition.LEFT].push(b);
非常感谢你,米奇! :) – thehorseisbrown
@thehorseisbrown不客气 – Michelangelo