Perspective container for pan and zoom view

Hello
Is anyone here check the zoom and pan in perspective?
Is it possible to bind visibility property’s of component to zoom level in perspective?
Please share your experience and which contanier is best for this.
The following link show an example of it.

http://demo.i4scada.de/demos/zf/werk01.html?W=EU-GER-FRD-01&G=000&B=00&S=WEMS010000&M=EE-W&T=FRIEDRICHSHAFEN&ST=WERK%2001

Thanks.

There’s currently no easy way to manage anything based on zoom level as it’s managed by the browser - not the gateway.

There is a very convoluted way which could conceivably do what you want:

  1. Create a Custom Session Property.
  2. Right-click the View’s Container and select “Configure Events”.
  3. For Event select “onKeyPress”, and for Action select Script.
  4. You essentially want to check against each key press to see if the event.key equates to any of the “Ctrl/CMD” + “+/-” combinations, and modify the Custom Session property accordingly.
  5. You will modify the in/visible component’s visible property based off a binding against the Custom Session Property you’ve been modifying.

Even this solution only tracks a user’s changes to zoom level - if they entered the Session already at some zoom level you’d have no idea what it is.

If this sounds like a lot of trouble and you’d prefer to only modify visibility based on the size of the current display, then use the Breakpoint container, which allow you to specify “on screens wider than Xpx, use this layout, and on screens which are smaller, use this other layout.”

1 Like

Be very careful with techniques that hide content based on zoom, or you will have difficulties with disabled users’ screen readers.

2 Likes

What's being achieve in that demo could be done with the Map component in perspective - no need to worry about the browser's zoom level or manipulating the rest of the project. I'm not intimately familiar, but it looks like you would need to populate a config key on the map component with a tile provider server, and then you could add geoJSON objects for each area that needs to be interactive. Once training has had an opportunity to document things, that would be your best bet for this (fairly common) 'facility-map' style of screen layout.

2 Likes

Could you please create a simple example to show how to do it.
It’s a little confusing for me.