内容发布更新时间 : 2024/11/13 8:42:25星期一 下面是文章的全部内容请认真阅读。
JavaScript动态创建地图及轮播图片
——Author:sunzk QQ:1131341075
body,html,#allmap {width: 100%;height:
100%;overflow: hidden;margin:0;font-family:\微软雅黑\;}
#l-map{height:100%;width:78%;float:left;border-right:2px solid #bcbcbc;}
#r-result{height:100%;width:20%;float:left;}
function dealMapAssetsInfo(data){ //处理数据
var lnt = \,longlnt = \; var arr = new Array();
var objTemp = new Object(); //当只有一个点的时候或者多个点的时候 if(data.length > 1){
for(var i=0;i if((data[i].LONGITUDE != longlnt) || (data[i].LATITUDE != lnt)){ //alert(\不相同\ longlnt = data[i].LONGITUDE; lnt = data[i].LATITUDE; obj.LONGITUDE = data[i].LONGITUDE; obj.LATITUDE = data[i].LATITUDE; obj.PHOTO_PATH = data[i].PHOTO_PATH; //alert(obj.PHOTO_PATH); obj.PHOTO_NAME = data[i].PHOTO_NAME; //获取创建人信息 if(data[i].UNAME != \){ obj.UNAME = data[i].UNAME; }elseif(data[i].USER_NAME != \){ obj.UNAME = data[i].USER_NAME; } obj.PNAME = data[i].PNAME; obj.ADDRESS = data[i].ADDRESS; obj.CREATE_TIME = data[i].CREATE_TIME; //清空数组 //alert(objTemp); if(objTemp.length != 0){ //alert(objTemp) arr.push(objTemp); } objTemp.length = 0; objTemp = obj; }else{ //alert(\相同\ obj.LONGITUDE = objTemp.LONGITUDE; obj.LATITUDE = objTemp.LATITUDE; obj.PHOTO_PATH = objTemp.PHOTO_PATH + \ + data[i].PHOTO_PATH; //alert(obj.PHOTO_PATH);