1
我正在创建一个小地图应用程序,为您提供有关大学不同校区的信息,视频和图像。谷歌地图Flash API自定义内容问题
我使用customContent方法将视频播放器对象插入到infoWindow中,但是当我这样做时,它将摆脱我的文本内容并成为用户唯一可见的东西。
如何解决此问题,并在infoWindow中同时显示文本和视频?
public function createMarker(latlng:LatLng, name:String, address:String, video:String):Marker
{
var marker:Marker=new Marker(latlng);
marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void
{
//marker.openInfoWindow(new InfoWindowOptions({contentHTML:html + moulVid}));
var infoWindow:InfoWindowOptions = new InfoWindowOptions();
infoWindow.title = name;
var videoPlayer:VideoPlayer = new VideoPlayer();
videoPlayer.source = '../assets/video/' + video.toLocaleLowerCase();
videoPlayer.autoPlay = false;
videoPlayer.alpha = 0.8;
titleFormat = new TextFormat();
titleFormat.font = "Arial";
titleFormat.size = 14;
titleFormat.bold = true;
contentFormat = new TextFormat();
contentFormat.font = "Arial";
contentFormat.size = 12;
infoWindow.drawDefaultFrame = true;
infoWindow.titleFormat = titleFormat;
if (video != "") {
infoWindow.customContent = videoPlayer;
infoWindow.height = 300;
}
infoWindow.width = 380;
infoWindow.content = address;
infoWindow.contentFormat = contentFormat;
infoWindow.padding = 10;
marker.openInfoWindow(infoWindow);
});
非常感谢。这解决了我的问题 – XGreen 2010-11-05 13:58:17