esri / application-base-js Goto Github PK
View Code? Open in Web Editor NEWA core class for creating a configurable application using JavaScript/TypeScript
Home Page: https://developers.arcgis.com/javascript/
License: Apache License 2.0
A core class for creating a configurable application using JavaScript/TypeScript
Home Page: https://developers.arcgis.com/javascript/
License: Apache License 2.0
previous: Esri/application-boilerplate-3x-js#110
We should be able to replace the following with esri/kernel and not have any dojo used.
import kernel = require("dojo/_base/kernel");
Org users can opt-in to displaying vector basemaps so we should add support to check the self for vector basemap support and if there get the vector basemap group otherwise get the default basemap group.
In urlUtils, may I suggest renaming tiltAndHeading variables and functions to headingAndTilt? That way, _getTiltAndHeading(tiltAndHeading: string)
is closer to self-documenting that it expects “<tilt>,<heading>”.
Document support utilities
Wait for map.basemap.load() then replace proxies
Document settings interface
There's a lot of nested promises in this method that could be improved by using async/await.
Testing out the boilerplate on dev and if I set isEsri to true then the code below executes but it looks like there is an issue setting the value of appLocationIndex. I think the conditional true value should be isEsriAppsPath and the conditional false should be isEsriHomePath.
`
.....
const isEsriAppsPath = esriAppsPathIndex !== -1 ? true : false;
const isEsriHomePath = esriHomePathIndex !== -1 ? true : false;
const appLocationIndex = isEsriAppsPath ? esriAppsPathIndex : isEsriHomePath ? esriHomePathIndex : null;
if (!appLocationIndex) {
return;
}
.....
}`
Or maybe we just need to check for appLocationIndex being -1 before return? Because currently we are checking for ! (some numeric value).
ApplicationBase.json and the app have case-sensitive URL parameters. We’ve had user problems because people are used to generally ignoring case in the URL, so case-sensitive query parameters get mistyped.
Can we change map[key
] in _urlToObject()
to map[key.toLowerCase()]
and the urlParams
list in ApplicationBase.json to all lowercase?
Create an option to disable multiple webmaps,groups,scenes
@jcfranco can you review this file?
https://github.com/Esri/application-base-js/blob/master/ApplicationBase.ts
I started looking at the Esri configurable-app-examples-4x-js and found that the code would not work due to application-base-js syntax issues. The major issue is that the npm 0.0.5 @Esri application-base-js is very different to the code in the Esri git repository for application-base-js. I had to remove the npm package from the example and download the application base js files I needed and store them locally. That code now works. NPM 0.0.5 is not compatible with 4.12
urlUtils supports most of the MapViewer URL parameters, but is missing Operational Layers and Layer Visibility support.
Maybe we should consider adding these so templates can take advantage of them?
http://doc.arcgis.com/en/arcgis-online/reference/use-url-parameters.htm
I wonder if these are really an app-level or an app-base module?
urlUtils seems to be forcing the url/param structure to be a certain pattern and it should be up to the app to decide this. It's also loading libraries that I might not need to load. e.g. camera
itemUtils beyond this seems app-level too.
https://github.com/Esri/application-base-js/blob/master/support/itemUtils.js#L108
Move to app-template-examples?
Maybe we can create a structure here where components can have position?
e.g. "top-right"
https://github.com/Esri/application-base-js/blob/master/support/urlUtils.ts#L48
After updating to TS 2.4 transpiling declareDecartor.ts returns the following errors:
error TS2322: Type '(target: Functio
n) => DeclareConstructor' is not assignable to type 'ClassDecorator'.
Type 'DeclareConstructor' is not assignable to type 'void | TFunction'.
Type 'DeclareConstructor' is not assignable to type 'TFunction'.
Seems to be due to the stricter checking for generic functions that happens at 2.4 - see doc here:
https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes
Using tsc --noStrictGenericChecks clears the error and so does using any for example:
return function (target: Function) { return <any>declare(mixins, target.prototype); };
The 4.x Layer methods fromArcGISServerUrl and fromPortalItem make it easier to support adding a layer via url or portal item id. I think we should add support for these to the app base urlUtils in order to support some of the additional online url params listed here:
https://doc.arcgis.com/en/arcgis-online/reference/use-url-parameters.htm
@driskull what do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.