mappView landing page revision

Today I want to share with you my experience with a not often used feature of mappView: the landing page.

Help reference: be7948ef-7b28-4228-899a-04547e22ef94

What does this feature do?
This feature was designed to show a waiting page at system startup when mappView server is not ready yet.

When should it be used?
This can be usefull when your client system is faster than AR, as it prevents the client from showing an error page in the first seconds after a reboot.
In my personal use case, I was developing an application based on hypervisor with Linux as GPOS and it turns out that Linux was indeed faster than AR to boot. For this reason, I was experiencing that behavior at each restart of the system.

How it works?
This feature is basically a local HTML page called mappViewInit.html, which consists of a loading animation and a background polling process linked to your mappView visualization. This process detects when the visualization is ready and redirects you to it. What you have to do is configure your system to open that local page at startup inserting as URL arguments the ip address target and the visualization id.

These two arguments are mandatory. Avoiding one of them results in this error:

My solution
Being forced to insert the visualization id is inconsistent with newer versions of mappView where, as you probably already know, you can set a default visualization and be able to open it without writing the visualization id in the URL.

Down here you can find a new version of mappViewInit.html which I’ve edited in order to make it works with or without visualization id. (1.7 KB)

Here an overview of the few easy changes I’ve introduced (new on the right):

The code is quite readable. On the bottom there is a control condition which prevents the execution of the script in case of some arguments lack. I’ve removed the condition which checks the visuId presence. On the top there is the creation of the redirect URL and there I’ve managed the two conditions with/without the visuId parameter.

Used versions:
mappView 5.24.2

Hope this can help someone out there.


Thanks Andrea :slight_smile:

1 Like