Skip to main content

Update Interval (seconds) Not Working!

Comments

4 comments

  • Permanently deleted user

    Hi Sedat,

    You are correct, HTML5 Viewer is not supporting UpdateInterval quite yet. However, the feature will be available as of version 1.1 release.

    Cheers

    Dan

    0
  • Permanently deleted user

    Thanks Dan.

    It looks like the problem is still there even in the HTML 1.1 version which I downloaded and tested today. Can anyone else confirm this?

    Regards,

    Sedat

    0
  • Permanently deleted user

    Hi Sedat,

    I apologize for causing confusion. UpdateInterval support has been implemented only for GeoRss layers and not Map Services in Html5 Viewer 1.1.

    We will try to provide support for UpdateInterval for Map Services as soon as possible.

    Dan

    0
  • Permanently deleted user

    Resolved! Here is a code snippet Geocortex support provided. I implemented it successfully in a custom module.

     

    initialize: function (config) {

     

            this.inherited(arguments);

            if (this.app.site && this.app.site.isInitialized) {

     

                this.setupInterval();

     

            }

     

            else {

     

                this.app.eventRegistry.event("SiteInitializedEvent").subscribe(this, this.setupInterval);

     

            }

        },

        setupInterval: function () {

     

            var services = null;

            // Require an initialized site

     

            if (!this.app.site || !this.app.site.isInitialized || !this.app.site.essentialsMap) {

     

                this.app.trace.error("Error - site was not initialized or map was not present.");

     

                return;

     

            }

            // This is where you select the appropriate map service.

     

            var myMapService = this.app.site.essentialsMap.mapServices[0];

            var updateIntervalInSeconds = 20;

            // Make sure that the serviceLayer exists and has a "refresh" method before applying the interval.

     

            if (myMapService.serviceLayer && myMapService.serviceLayer.refresh) {

     

                setInterval(function () {

     

                    myMapService.serviceLayer.refresh();

     

                }, updateIntervalInSeconds * 1000);

     

            }

     

        }
    0

Please sign in to leave a comment.