UrlManager

Class

The UrlManager is used to manage URL parameters.

Methods

MethodReturnsNotes
changeDialog(dialogId)
void

Change to a dialog.

changePage(pageId)
void

Change to a page.

changeQueryObject(queryObject, options?)
void

Change the query string in URL using the queryObject, only the passed in params you need to change.

changeUrlHashObject(urlHashParametersObject, options?)
void

To change the hash string in the URL, pass in an object with the key/values that you want to change in the hash string. Hash string values that are not included in the object will stay the same.

changeView(sectionId, viewId)
void

Change to a view.

IMUrlHashParameters

Get the HashObject of the current URL.

UrlParameters

Get the QueryObject of the current URL.

init(store)
{ queryObject: UrlParameters; urlHashObject: UrlHashParameters }

Initialize QueryObject and HashObject in the URL

setWidgetUrlParams(widgetId, hashParameters, options?)
void

Set the corresponding hash parameters for a specific widget.

changeDialog

Class Method
changeDialog(dialogIdstring): void

Change to a dialog.

Parameters
ParameterTypeNotes
dialogId
string

The id of the dialog to change to

Returns 
void

changePage

Class Method
changePage(pageIdstring): void

Change to a page.

Parameters
ParameterTypeNotes
pageId
string

the id of the page to change to

Returns 
void

changeQueryObject

Class Method
changeQueryObject(queryObjectUrlParameters, options?{ isReplaceQueryObject?: boolean; replaceHistory?: boolean }): void

Change the query string in URL using the queryObject, only the passed in params you need to change.

  • To replace all query params, set replaceQueryObject=true
  • To remove a query param, set the param as null
Parameters
ParameterTypeNotes
queryObject
UrlParameters

can be partial of query object

options
{ isReplaceQueryObject?: boolean; replaceHistory?: boolean }
  • replaceHistory: replace the browser history. False means push a new history. True means replace the current history.
  • isReplaceQueryObject: replace the queryObject instead of merge
Returns 
void

changeUrlHashObject

Class Method
changeUrlHashObject(urlHashParametersObjectIMUrlHashParameters, options?{ isReplaceHashObject?: boolean; replaceHistory?: boolean }): void

To change the hash string in the URL, pass in an object with the key/values that you want to change in the hash string. Hash string values that are not included in the object will stay the same.

Parameters
ParameterTypeNotes
urlHashParametersObject
IMUrlHashParameters

can be partial of hash object

options
{ isReplaceHashObject?: boolean; replaceHistory?: boolean }
  • replaceHistory: replace the browser history. False means push a new history. True means replace the current history.
  • isReplaceHashObject: replace the urlHashObject instead of merge
Returns 
void

changeView

Class Method
changeView(sectionIdstring, viewIdstring): void

Change to a view.

Parameters
ParameterTypeNotes
sectionId
string

The id of the section that the view belongs to

viewId
string

The id of the view to change to

Returns 
void

getHashObject

Class Method
getHashObject(): IMUrlHashParameters

Get the HashObject of the current URL.

Returns 
IMUrlHashParameters

getQueryObject

Class Method
getQueryObject(): UrlParameters

Get the QueryObject of the current URL.

Returns 
UrlParameters

init

Class Method
init(storeStore<IMStateUnknownActionunknown>): { queryObject: UrlParameters; urlHashObject: UrlHashParameters }

Initialize QueryObject and HashObject in the URL

Parameters
ParameterTypeNotes
store
Store<IMStateUnknownActionunknown>

exb app store

Returns 
{ queryObject: UrlParameters; urlHashObject: UrlHashParameters }

    setWidgetUrlParams

    Class Method
    setWidgetUrlParams(widgetIdstring, hashParametersUrlWidgetSpecificParams, options?{ isReplaceHashObject?: boolean }): void

    Set the corresponding hash parameters for a specific widget.

    Parameters
    ParameterTypeNotes
    widgetId
    string

    The id of a specific widget

    hashParameters
    UrlWidgetSpecificParams

    The corresponding UrlHash parameter object

    options
    { isReplaceHashObject?: boolean }
    • isReplaceHashObject: When false by default, hashParameters will be merged into the current parameters. If set to true, only the newly passed in parameters will be used.

    Example 1: set widget-url-params

    Use dark colors for code blocksCopy
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     UrlManager.getInstance().setWidgetUrlParams(
       // 1. widgetID
       this.props.baseWidgetProps.id,
       // 2. UrlWidgetSpecificParams
       {
         p1: 'unencodedValue1',
         p2: 22,
         p3: '{"rotation":11,"scale":22,"target":{"sr":{"latestWkid":3857}}}'
       }
     )

    Example 2: remove widget-url-params

    Use dark colors for code blocksCopy
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     UrlManager.getInstance().setWidgetUrlParams(
       // 1. widgetID
       this.props.baseWidgetProps.id,
       // 2. UrlWidgetSpecificParams
       {
         p1: 'unencodedValue1',
         p2: null,
         p3: null
       }
     )

    Example 3: clear widget-url-params

    Use dark colors for code blocksCopy
    1
    2
    3
    4
     UrlManager.getInstance().setWidgetUrlParams(
       this.props.baseWidgetProps.id,
       null
     )
    Returns 
    void

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.