如何添加谷歌地图为Class到main.mxml withiout <maps:Map key="" sensor="" />
谷歌地图
像在Flash
UPDATE:
,如果我有类
package{
import com.google.maps.Map;
public function myMap extends MovieClip {
var map:Map = new Map();
map.setSize(new Point(300, 300));
this.addChild(map);
}
}
如果我在mxml中使用它
myMap:myMap = new myMap();
addChild(myMap);
返回错误
addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.
,如果我用这个
var container:UIComponent = new UIComponent();
container.width = 300;
container.height = 300;
addChild(container);
myMap:myMap = new myMap();
container.addChild(myMap);
没有什么是不添加
感谢名单
为什么你忽略错误?使用addElement()。 –