zjs_project 1 year ago
parent
commit
90d2621902

+ 5 - 0
src/components/krpanoVideo/index.vue

@@ -234,8 +234,13 @@
 			},
 			setPosition(position){
 				let video = this.panoramicKrpano.get("hotspot[video]");
+				let image_hotspot = this.panoramicKrpano.get("hotspot[image_hotspot]");
 				video.ath = position.ath;
 				video.atv = position.atv;
+				if(image_hotspot){
+					image_hotspot.ath = position.ath;
+					image_hotspot.atv = position.atv;
+				}
 				console.warn("***setPosition***",position);
 			},
 			//设置全景图图片地址

+ 11 - 3
src/components/krpanoVideo/panoramic.xml

@@ -71,6 +71,7 @@
 			<layer  name="title2_line2_hottiyan" style="text" align="top center" x="0" y="0" css="background-color:#fff;width:6px;height:6px;border-radius:50%;"  />
 		</plugin> -->
 		<!-- <preview url="test3333.png"/> 			onloaded.addevent="sceneload();"-->
+		
 		<hotspot name="video"
 			ath="50.082" 
 			atv="14"
@@ -95,7 +96,13 @@
 			cursor="grab"
 			ondown.addevent="set(cursor,grabbing);"
 			onup.addevent="set(cursor,grab);"
-		/>
+			zorder="2"
+		>
+		</hotspot>
+		
+		<hotspot name="image_hotspot" ath="50.082" atv="14" rotate="-45.0" zorder="1"
+			distorted="true" scale="0.5" alpha="0.5"
+			url="https://dm.static.elab-plus.com/miniProgram/grass.jpg" keep="true"></hotspot>
 		<action name="draghotspot">
 			spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, calc(mouse.stagex LT stagewidth/2 ? 'l' : 'r'));
 			sub(drag_adjustx, mouse.stagex, hotspotcenterx);
@@ -104,8 +111,9 @@
 				sub(dx, mouse.stagex, drag_adjustx);
 				sub(dy, mouse.stagey, drag_adjusty);
 				screentosphere(dx, dy, ath, atv);
-		
-			  );
+				set(hotspot[image_hotspot].ath, get(ath));
+				set(hotspot[image_hotspot].atv, get(atv));
+			);
 		</action>
 		<action name="mobilescale" autorun="preinit" devices="mobile">
 		    mul(stagescale,0.5);

+ 3 - 1
src/components/krpanoVideo/panoramic_no_drag.xml

@@ -66,7 +66,9 @@
 			onclick="togglepause();" enabled="false"
 			ondown.addevent="set(cursor,grabbing);" onup.addevent="set(cursor,grab);" >
 		</hotspot>
-		
+		<hotspot name="image_hotspot" ath="50.082" atv="14" rotate="-45.0" zorder="1"
+			distorted="true" scale="0.5" alpha="0.5"
+			url="https://dm.static.elab-plus.com/miniProgram/grass.jpg" keep="true"></hotspot>
 		<action name="mobilescale" autorun="preinit" devices="mobile">
 			mul(stagescale,0.5);
 		</action>