Options
All
  • Public
  • Public/Protected
  • All
Menu

Routes offline requests through request handlers. This is done by hacking esri.request. The "Rewrite" request handler is the only handler installed by default.

Hierarchy

  • OfflineRouter

Index

Constructors

constructor

Properties

app

isReady

isReady: Observable<boolean>

Methods

_whenReady

  • _whenReady(callback: function): void
  • Parameters

    • callback: function
        • (): void
        • Returns void

    Returns void

addHandler

  • Add a request handler. The handler function will be called to handle requests when a rule matching the given name has a pattern matching the request.

    Parameters

    Returns void

clearRoutingRules

  • clearRoutingRules(): void
  • Remove all routing rules.

    Returns void

handle

  • Handles (routes) an offline request.

    Parameters

    Returns Deferred

removeHandler

  • removeHandler(handlerName: string): boolean
  • Remove a request handler.

    Parameters

    • handlerName: string

      The name of the handler.

    Returns boolean

    Whether a handler was found and removed.

rewriteUrl

  • rewriteUrl(url: string): string
  • Check the tile URL against any "Rewrite" rules in the offline manifest and return the rewritten URL if there is a match. Return null otherwise.

    Parameters

    • url: string

      The URL to rewrite.

    Returns string

    The rewritten URL or null.

setDefaultHandler

  • Set the handler to use when no other handlers match. The handler will be called with rule and matches as null, as there is no rule that matched.

    Parameters

    Returns void

setRoutingRules

  • Set the rules that determine how (offline) requests are routed.

    Parameters

    Returns void

setRoutingRulesFromPromise

  • setRoutingRulesFromPromise(routingRulesJsonStringPromise: Promise<string>): void
  • Set the rules that determine how (offline) requests are routed from a promise.

    Parameters

    • routingRulesJsonStringPromise: Promise<string>

    Returns void