Oskari API Documentation

Select bundle

admindown-arrow
cataloguedown-arrow
  • metadata
    Generic functionality to display metadata from a CSW-service
  • metadatasearch
    Provides metadata catalogue search user-interface for an application.
frameworkdown-arrow
  • announcements
    Bundle for displaying announcements made with admin-announcements.
  • Core services
    Provided by the framework
  • layeranalytics
    Map layer problem tracker
  • layerlist
    A layer listing functionality for the geoportal.
  • mydata
    Provides generic container for listing user data and offers other functionalities a way to present user-specific information.
  • Map Publisher 2
    Allows creation of embedded maps
  • RPC
  • Search
    Provides basic search functionality without any UI
  • Selected-featuredata
    Allows infobox opening in new flyout
  • statehandler
    History functionality and state saving.
  • usagetracker
    Pings the server when any of the configured events occur.
mappingdown-arrow
statisticsdown-arrow
  • statsgrid2016
    Statistics data display. This will replace the statsgrid bundle specification when the implementation has the comparable functionalities as the current one. The bundle depends on mapstats-bundle that provides support for statslayer layertype.
uidown-arrow

guidedtour

Description

Shows a series of dialogs on startup to instruct user on map functionalities. The content of the dialogs is supplied from the bundles that the guided tour describes. Any bundle can register itself to the guided tour.

Without configuration, the tour shows dialogs for all bundles that have registered themselves, in the order determined by a priority value given by the bundles.

With configuration, the tour can be specified to show only a subset of the registered bundles and/or change the order of the dialogs. It's also possible to override the text content of the dialogs by giving Oskari GetArticlesByTag-API tags in the configuration.

Screenshot

screenshot

Bundle configuration

Configuration is optional. See description above for default behavior.

Which dialogs to show and their order is defined with an Array in the property "steps". The order is the same as the order of elements in the Array. Only dialogs for bundles that are referenced in the Array will be shown. Allowed fields for an array element (dialog configuration) are:

bundleNameRequired. The name of the bundle registered to the guide. From bundle getName() method. If a bundle registers more than one dialog, the different dialogs are referenced by adding a number after underscore, "MainMapModule_1", "MainMapModule_2", etc.
contentOptional. Tags used to retrieve dialog content from GetArticlesByTag-API. Retrieved html replaces default dialog content.

To replace the content of the first "Welcome" dialog, add element with bundleName "GuidedTour" and with content tags.

{  
   steps:[
      {  
         "bundleName": "GuidedTour",
         "content": "tour_welcome"
      },
      {  
         "bundleName": "Search"
      },
      {  
         "bundleName": "PersonalData"
      },
      {  
         "bundleName": "MainMapModule_1"
      },
      {  
         "bundleName": "MainMapModule_2",
         "content": "tour_zoom"
      }
   ]
}

Requests the bundle handles

RequestHow does the bundle react
Guidedtour.AddToGuidedTourRequestAdds the requesting bundle to the guided tour. The request parameter is a delegate object that has configuration and methods for generating the content of the dialog.

The delegate object field specification:

bundleNameRequired. The name of the bundle registered to the guide. Should come from bundle getName() method. If a bundle registers more than one dialog, the different dialogs should be referenced by adding a number after underscore, "MainMapModule_1", "MainMapModule_2", etc.
getTitleRequired. Method for retrieving dialog title. Returns String.
getContentRequired. Method for retrieving dialog content. Returns jQuery object.
getLinksOptional. Method for retrieving links shown below main content. Returns Array of jQuery objects.
priorityOptional. Positive integer representing ordering priority. Larger numbers mean lower priority and come after smaller numbers. If priority is not given, dialog is added at priority of the largest already registered priority +1 (at the end of guided tour)
getPositionRefOptional. Method returning jQuery object represening element the dialog should align itself to. Used to call dialog.moveTo(...)
positionAlignOptional. Dialog alignment in reference to positionRef. One of 'left', 'right', 'top', 'bottom', 'center'. Used to call dialog.moveTo(...)
showOptional. Method that is called when step is shown in the tour. Typicaly used to activate Tiles etc.
hideOptional. Method that is called when step is no longer shown in the tour. Typicaly used to close Tiles etc.

Example:

var me = this;
function updateExtension(payload) {
    me.sandbox.postRequestByName('userinterface.UpdateExtensionRequest', payload);
}
var requestBuilder = Oskari.requestBuilder('Guidedtour.AddToGuidedTourRequest');
if (requestBuilder) {
    var delegate = {
        priority: 10,
        show: function () {
            updateExtension([null, 'attach', 'Search']);
        },
        hide: function () {
            updateExtension([null, 'close', 'Search']);
        },
        getTitle: function () {
            return me.localization.guidedTour.title;
        },
        getContent: function () {
            var content = jQuery('<div></div>');
            content.append(me.localization.guidedTour.message);
            return content;
        },
        getLinks: function () {
            var loc = me.localization.guidedTour;
            var linkTemplate = jQuery('<a href="#"></a>');
            var openLink = linkTemplate.clone();
            openLink.append(loc.openLink);
            openLink.bind('click',
                function () {
                    updateExtension([null, 'attach', 'Search']);
                    openLink.hide();
                    closeLink.show();
                });
            var closeLink = linkTemplate.clone();
            closeLink.append(loc.closeLink);
            closeLink.bind('click',
                function () {
                    updateExtension([null, 'close', 'Search']);
                    openLink.show();
                    closeLink.hide();
                });
            closeLink.show();
            openLink.hide();
            return [openLink, closeLink];
        },
        getPositionRef: function () {
            return jQuery('.panbuttonDiv');
        },
        positionAlign: 'left'
    };
    me.sandbox.request(me, requestBuilder(delegate));
}

Dependencies

DependencyLinked fromPurpose
jQuery Linked in portal theme Used to create the component UI from begin to end