You are not logged in.

1

Friday, July 10th 2020, 8:47am

Show/Hide hotspots according to a zoom?

I want to display hotspots from the general view up to a certain zoom level (e.g. 1 screen pixel = 10 image pixels) and then hide them to display other hotspots.
I seem to have seen this in the documentation, but I can't find the information anymore. Can someone help me?

A very big thank you

herrpedro

Intermediate

Posts: 210

Location: Lisbon

Occupation: Programmer/analyst

  • Send private message

2

Sunday, July 12th 2020, 1:16pm

hi,
if they no not have anything to do with each other
you do a for loop on all hostspots and add the action on onviewchange
it mught be a good ideia to copy the current zoom to a variable and, if the zoom does not change from the previous value (the user has just made a pan) you dont call this


Source code

1
2
	<hotspot name="some1zoom" fovmin="50" fovmax="80 otherattributes />
	<hotspot name="some2zoom" fovmin="80" fovmax="10 otherattributes />


--> action code

Source code

1
2
3
4
5
6
7
8
9
10
11
for(set(i,0), i LT hotspot.count, inc(i),
	copy(ly, hotspot[get(i)]);
			
	if (ly.fovmin AND ly.fovmax  , 			
		if ((view.fov LE fovmax) AND (vide.FOV GT  ly.fovmin)  ,
			set(ly.visible , true);
		,
			set(ly.visible , false);
		);
	);
);


(this was just written so forgive some typos

3

Tuesday, August 4th 2020, 8:02am

Thanks for your help.

This post has been edited 1 times, last edit by "Barras" (Aug 4th 2020, 9:14am)