Skip to content

stokseth/offlineonline-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

offlineonline-widget

Simple OfflineOnline widget built for version 4.x of the ArcGIS API for Javascript

share-widget-offlineshare-widget-online

Features:

  1. No required properties. Independent on MapView and SceneView
  2. Check if user has network connetion
  3. Customizable how to check online
  4. Change style using CSS

OfflineOnlineWidget

Constructor:

new OfflineOnlineWidget(properties?)

Property Overview:
Name Type Summary
offlineLabel String Offline label.
onlineLabel String Online label.
hideWhenOnline Boolean Hide Online label if online.
viewModel OfflineOnlineViewModel The view model for this widget.
useNavigatorOnline* Boolean Use browser navigator.onLine. [false]
pollingUrl* String Polling url (https://ipv4.icanhazip.com)
pollingInterval* Number Polling Interval (ms).
pollingTimeout* Number Polling Timeout (ms).
pollingResponseType* String Polling Response Type ["text"].
pollingHeaders* String Polling Headers [{}].

* = aliased

OfflineOnlineViewModel

Constructor:

new OfflineOnlineViewModel(properties?)

Property Overview:
Name Type Summary
onlineStatus Boolean Current Online Status
useNavigatorOnline Boolean Use browser navigator.onLine. [false]
pollingUrl String Polling url (https://ipv4.icanhazip.com)
pollingInterval Number Polling Interval (ms).
pollingTimeout Number Polling Timeout (ms).
pollingResponseType String Polling Response Type ["text"].
pollingHeaders String Polling Headers [{}].

Examples:

Default:
const Offlineonline = new OfflineOnlineWidget({});
view.ui.add(Offlineonline, "top-right);
Custom:
 const Offlineonline = new OfflineOnlineWidget({
     hideOnline: false,
     onlineLabel: "Connected",
     pollingUrl: "example.com/ping",
     pollingResponseType: "json"
 });
view.ui.add(Offlineonline, "top-right);

Resources

About

OfflineOnline ArcGIS Javascript API widget

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published