Flex 3 网站中的 Google 地图 InfoWindow 问题
我正在尝试使用 Flex 3 创建一个 Google 地图来显示学校的位置。当用户将鼠标悬停在学校标记上时,信息窗口应该显示学校的名称。
标记工作正常。不幸的是,学校的名称没有显示在信息窗口中。我认为 InfoWindowOptions 存在问题。
请看下面的功能:
public function schoolMarkerBuilder():void {
var schoolArrayLength:uint = schoolPointsData.length;
var i:int;
for (i=0; i < schoolArrayLength; i++) {
schoolMarkers = new Marker(new LatLng(schoolPointsData[i].latitude, schoolPointsData[i].longitude),
new MarkerOptions({
strokeStyle: new StrokeStyle({color: 0x000000}),
fillStyle: new FillStyle({color: 0x223344, alpha: 0.8}),
radius: 12,
hasShadow: true
})
);
schoolMarkers.addEventListener(MapMouseEvent.ROLL_OVER, function(event:MapMouseEvent): void {
map.openInfoWindow(event.latLng, new InfoWindowOptions({content:schoolPointsData[i].school_name, hasCloseButton:false, hasShadow:true}));
});
map.addOverlay(schoolMarkers);
}
}
有什么建议吗?
谢谢。
-拉克斯米迪
I'm trying to create a Google Map with Flex 3 to dispaly the location of schools. When the user rolls over the school marker, the InfoWindow is supposed to show the name of the school.
The markers are working fine. Unfortunately, the name of the school is not showing in the InfoWndow. I think that I have a problem in the InfoWindowOptions.
Please see the function below:
public function schoolMarkerBuilder():void {
var schoolArrayLength:uint = schoolPointsData.length;
var i:int;
for (i=0; i < schoolArrayLength; i++) {
schoolMarkers = new Marker(new LatLng(schoolPointsData[i].latitude, schoolPointsData[i].longitude),
new MarkerOptions({
strokeStyle: new StrokeStyle({color: 0x000000}),
fillStyle: new FillStyle({color: 0x223344, alpha: 0.8}),
radius: 12,
hasShadow: true
})
);
schoolMarkers.addEventListener(MapMouseEvent.ROLL_OVER, function(event:MapMouseEvent): void {
map.openInfoWindow(event.latLng, new InfoWindowOptions({content:schoolPointsData[i].school_name, hasCloseButton:false, hasShadow:true}));
});
map.addOverlay(schoolMarkers);
}
}
Any suggestions?
Thank you.
-Laxmidi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我明白了。请看下面的代码:
谢谢。
-拉克斯米迪
Okay, I figured it out. Please see the code below:
Thank you.
-Laxmidi