Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@esri/application-base-js

Package Overview
Dependencies
Maintainers
8
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esri/application-base-js

A core class for creating a configurable application using JavaScript/TypeScript

  • 0.0.31
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
47
increased by104.35%
Maintainers
8
Weekly downloads
 
Created
Source

ApplicationBase

A class designed to handle common tasks of configurable ArcGIS Web Applications.

See Configurable App Examples using this class.

Purpose

The purpose of this ApplicationBase is to handle fetching and managing ArcGIS Online information used in configurable applications. The ApplicationBase queries and maintains:

  • Portal information
  • User information
  • Item data (webscenes, webmaps, group information, group items)
  • Configured application information
  • URL parameters

The ApplicationBase will handle fetching this information, store it, and perform setup when necessary.

API

This is the API for the ApplicationBase class. ApplicationBase.js

Constructor

new ApplicationBase(ApplicationConfig: ApplicationConfig, ApplicationBaseConfig: ApplicationBaseConfig)

Constructor Options

See ApplicationConfig and ApplicationBaseConfig for more information.

ApplicationConfig

propertydescriptiontypedefault
appidApplication ID for querying application configurationstring""
groupGroup ID for querying a portal groupstring or string[]""
websceneWebScene ID for querying a webscenestring or string[]"19faa71a3bf6468cae35b4fce9393a7d"
webmapWebMap ID for querying a webmapstring or string[]""
titleTitle of the applicationstring""
portalUrlURL to the ArcGIS Portalstring"https://www.arcgis.com"
oauthappidoAuth authentication IDstring""
proxyUrlEnter the url to the proxy if needed by the application. See the Using the proxy page help topic for details.string""
unitsApplication measurement unitsstring""
helperServicesObject containing URLs to various helper servicesHelperServicesnull

Example:

{
  "appid": "",
  "group": "",
  "title": "",
  "webmap": "default",
  "webscene": "",
  "portalUrl": "https://www.arcgis.com",
  "oauthappid": "",
  "proxyUrl": "",
  "units": "",
 }

ApplicationBaseConfig

propertydescriptiontypedefault
webscene.defaultThe default id to query when not setstring""
webscene.fetchWhen true the application will query for a websceneBooleantrue
webscene.fetchMultipleWhen true the application will query for multiple webscenes if necessaryBooleantrue
webmap.defaultThe default id to query when not setstring""
webmap.fetchWhen true the application will query for a webmapBooleanfalse
webmap.fetchMultipleWhen true the application will query for multiple webmaps if necessaryBooleantrue
group.fetchInfoWhen true the application will query for a group's informationBooleanfalse
group.fetchItemsWhen true the application will query for a group's itemsBooleanfalse
group.itemParamsDefines query paramaters for fetching group itemsitemParams{}
group.fetchMultipleWhen true the application will query for multiple groups if necessaryBooleantrue
portal.fetchWhen true the application will query arcgis.com for default settings for helper services, units etc. If you want to use custom settings for units or any of the helper services set this to false then enter default values for any items you need using the helper services and units properties.Booleantrue
urlParamsDefines which URL parameters should be captured and stored into the config for use within the applicationString[]See below
environment.webTierSecuritySupport sending credentials with AJAX requests to specific domains. This will allow editing of feature services secured with web-tier authenticationBooleanfalse
environment.isEsriMost users will not need to modify this value. For Esri hosting environments only. Will automatically create a portalUrl and proxyUrl for the application. Only set this is to true if the app is going to be stored on Esri's hosting servers. If you are using your own custom hosted portal, set the portalUrl in instead of setting this to true.Booleanfalse

Example:

{
  "environment": {
    "isEsri": false,
    "webTierSecurity": false
  },
  "localStorage": {
    "fetch": true
  },
  "group": {
    "default": "908dd46e749d4565a17d2b646ace7b1a",
    "fetchInfo": false,
    "fetchItems": false,
    "itemParams": {
      "sortField": "modified",
      "sortOrder": "desc",
      "num": 9,
      "start": 0
    }
  },
  "portal": {
    "fetch": true
  },
  "urlParams": [
    "appid",
    "center",
    "components",
    "embed",
    "extent",
    "find",
    "group",
    "level",
    "marker",
    "oauthappid",
    "portalUrl",
    "viewpoint",
    "webmap",
    "webscene"
  ],
  "webmap": {
    "default": "1970c1995b8f44749f4b9b6e81b5ba45",
    "fetch": true
  },
  "webscene": {
    "default": "e8f078ba0c1546b6a6e0727f877742a5",
    "fetch": false
  }
}
itemParams

See PortalQueryParams

Example:

{
  "query": "group:\"{groupid}\" AND -type:\"Code Attachment\"",
  "sortField": "modified",
  "sortOrder": "desc",
  "num": 9,
  "start": 0
}

Properties

propertydescriptiontypereadonly
configConfig createdApplicationConfigtrue
directionLanguage directionstringtrue
localeLocale stringstringtrue
isIETrue when IE11 and older booleanbooleantrue
portalPortal created by ApplicationBasePortaltrue
resultsApplicationBase query resultsApplicationBaseResultstrue
settingsConfig createdApplicationBaseConfigtrue
unitsAppropriate units of measurementstringtrue

ApplicationBaseResult

propertydescriptiontype
errorThe error returned from the queryError
valueThe value returned from the queryany
promiseThe query promisePromise<any>

ApplicationBaseResults

propertydescriptiontype
applicationItem?The application item resultApplicationBaseResult
applicationData?The application data resultApplicationBaseResult
groupInfos?The restults from querying group infosApplicationBaseResult[]
groupItems?The results from querying group itemsApplicationBaseResult[]
localStorage?The local storage configuration resultApplicationConfig
portal?The Portal instance resultPortal
urlParams?The results from URL parametersApplicationConfig
webMapItems?The restults from querying webmap itemsApplicationBaseResult[]
webSceneItems?The restults from querying webscene itemsApplicationBaseResult[]

Methods

load(): Promise<ApplicationBase>

Loads the requested ApplicationBase resources and returns the class once complete.

queryGroupItems(groupId: string, itemParams: itemParams, portal?: Portal) : Promise<any>

Query a group by parameters. ApplicationBase.queryGroupItems("myid", {}, myPortal).

Support Modules

There are helper modules and utilities you can use that contain common application functionality. See the following documentation:

Requirements

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

Copyright 2017 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.

Keywords

FAQs

Package last updated on 17 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc