基于API开发百度地图的时候,需要做一些附加功能,比如,搜索某个关键字,显示出的标记物都是无顺序的,想要加上A-Z或者1,2,3这些标记在标注物上
var count = 0;
$.each($('.BMap_Marker').filter(".BMap_noprint"),function (index,domEle){
var title = $(this).attr("title");
if(title!="") {
var weightNew = 0-(index - count)*25;
var resWeight ="url(http://api.map.baidu.com/images/markers.png) -0px "+ weightNew +"px no-repeat";
$(this).css("background",resWeight);
} else {
count = count + 1;
}
});
});
local.setResultsHtmlSetCallback(function(result){
$.each($("ol li"),function (index,domEle){
var spanEle = $(this).find("div div span");
var spanEleMk = $(this).find("span");
var weightNew = 0-index*25;
var resWeight = "url(http://api.map.baidu.com/images/markers.png) -23px "+ weightNew +"px no-repeat";
spanEleMk.eq(0).css("background",resWeight);
});
});