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.
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:
- Create a Custom Session Property.
- Right-click the View’s Container and select “Configure Events”.
- For Event select “onKeyPress”, and for Action select Script.
- 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.
- 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.”
Be very careful with techniques that hide content based on zoom, or you will have difficulties with disabled users’ screen readers.
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.
Could you please create a simple example to show how to do it.
It’s a little confusing for me.