0

为图钉指定的文本未显示在图钉上(Bing Maps Ajax 7.0 控件)。

这是从交互式 sdk 虚拟复制的代码:

var offset = new Microsoft.Maps.Point(0, 5);
alert($(".LocationPushPin a", $(this)).text());
var pushpinOptions = {text: $(".LocationPushPin a", $(this)).text(), visible: true, textOffset: offset};
var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location($(".RetailLocationLatitude", $(this)).text(), $(".RetailLocationLongitude", $(this)).text(), pushpinOptions));
BingMap.entities.push(pushpin);

警报确实显示了我认为给定此代码会出现的值(“1001”等)。Firebug 或 IE9 调试器中没有语法或其他错误。

我错过了什么?感谢你给与我的帮助。

4

1 回答 1

0

我有一个放错位置的括号(在选项之后:

var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location($(".RetailLocationLatitude", $(this)).text(), $(".RetailLocationLongitude", $(this)).text()), pushpinOptions); 

很抱歉您审核了这个问题。

于 2012-04-06T09:44:17.653 回答