|
|
@@ -136,26 +136,50 @@ function sortByATime(data,time){
|
|
|
return arr2;
|
|
|
}
|
|
|
/**
|
|
|
- * 地图展示文字
|
|
|
+ * 地图展示文字
|
|
|
*/
|
|
|
-function changeFontLocation(lon,lat,imgUrl,index,t){
|
|
|
+function changeFontLocation(data,index,t){
|
|
|
let dom;
|
|
|
+ let lon=data.position[0];
|
|
|
+ let lat=data.position[1];
|
|
|
+ let imgBool=true;
|
|
|
+ if(data.time=="1978.01"&&data.place=="洛阳" ){
|
|
|
+ imgBool=false;
|
|
|
+ lon-=4.5;
|
|
|
+ lat-=0.2
|
|
|
+ }
|
|
|
+ if(data.time=="1978.01"&&data.place=="郑州" ){
|
|
|
+ imgBool=false;
|
|
|
+ lon+=1.5;
|
|
|
+ lat+=0.2
|
|
|
+ }
|
|
|
+ if(data.time=="1986.06"&&data.place=="洛阳" ){
|
|
|
+ imgBool=false;
|
|
|
+ lon-=4.5;
|
|
|
+ lat-=0.2
|
|
|
+ }
|
|
|
+ if(data.time=="1986.06"&&data.place=="郑州" ){
|
|
|
+ imgBool=false;
|
|
|
+ lon-=0.5;
|
|
|
+ lat+=0.2
|
|
|
+ }
|
|
|
+
|
|
|
if(t==RED){
|
|
|
dom=createDiv({
|
|
|
- fontImg:imgUrl,
|
|
|
- proImg:"./img/red@2x.png",
|
|
|
+ fontImg:data.imgUrl,
|
|
|
+ proImg:imgBool?"./img/red@2x.png":null,
|
|
|
style:RED
|
|
|
})
|
|
|
}else if(t==YELLOW){
|
|
|
dom=createDiv({
|
|
|
- fontImg:imgUrl,
|
|
|
- proImg:"./img/yellow@2x.png",
|
|
|
+ fontImg:data.imgUrl,
|
|
|
+ proImg:imgBool?"./img/yellow@2x.png":null,
|
|
|
style:YELLOW
|
|
|
})
|
|
|
} else{
|
|
|
dom=createDiv({
|
|
|
- fontImg:imgUrl,
|
|
|
- proImg:"./img/blue@2x.png",
|
|
|
+ fontImg:data.imgUrl,
|
|
|
+ proImg:imgBool?"./img/blue@2x.png":null,
|
|
|
style:BLUE
|
|
|
})
|
|
|
}
|
|
|
@@ -184,7 +208,8 @@ function changeFontLocation(lon,lat,imgUrl,index,t){
|
|
|
})
|
|
|
}
|
|
|
root.appendChild(dom);
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
let pixel= Cesium.SceneTransforms.wgs84ToWindowCoordinates(viewer.scene,Cesium.Cartesian3.fromDegrees(lon,lat));
|
|
|
dom.style.left=pixel.x-0.4*dom.width+"px";
|
|
|
dom.style.top=pixel.y-0.6*dom.height+"px";
|