Comments (5)
Also, I'm fairly certain that this line:
esri-loader/src/esri-loader.ts
Line 34 in ff9989b
Needs to be guarded with an if (callback)
check like we do here:
esri-loader/src/esri-loader.ts
Lines 52 to 57 in ff9989b
from esri-loader.
Also, whenever we return an error b/c a script is already loading/ed, we should also pass that script as the second argument to the callback as a convenience to the caller (I know that would be helpful to me right now as I'm working through how to handle the above errors in ember-esri-loader).
from esri-loader.
Above I suggest checking whether "the user is trying to load a different version of the JSAPI."
That may be tricky, b/c when they are about to load the second script (and when the first script is still loading), all you have have is the URL, which may not be deterministic.
As a first pass, I'd say it would be sufficient to check if the user is trying to load the exact same script (i.e. same URL). Later we can refine by trying to parse the version out of the URL and if that's successful, check whether or not the user is trying to load the same version.
from esri-loader.
Ignore that last comment. I think that would be akward w/ the current boostrap() API:
esriLoader.bootstrap((err, dojoRequireOrScriptTagDependingOnWhetherOrNotThereWasAnError) => {...}, options);
A better way to achieve similar would be to export getScript()
.
from esri-loader.
I've implemented the above logic in ember-esri-loader to solve the problems I was having there:
I'd like to move all that logic into this library as the resolution to this issue.
We'll probably want to move from using script.onload = () => {}
to using addEventListenter when we do.
from esri-loader.
Related Issues (20)
- drop IE support? HOT 2
- ArcGIS JS API 4.18 Sketch Widget graphics and graphic selection often do not render in Angular 11 application HOT 4
- angular esri-loader 4.18 graphics refresh bug HOT 4
- Sketch widget: graphics not visible HOT 2
- new `esri-loader-typings-helper` plugin for VS Code HOT 2
- esri-loader dojoConfig removed not able to set has: {"csp-restrictions": true} HOT 2
- isLoaded or ready prop? HOT 2
- switch release process over to use np HOT 1
- Is it possible to have crossorigin attribute when loading ArcGIS modules? HOT 8
- Clean up dependabot PRs HOT 1
- 利用BaseTileLayer.createSubclass进行扩展,读取离线tms瓦片。 HOT 3
- Esri sources don't get loaded from our server HOT 3
- wall o compile node_module/@types errors when you run tests HOT 2
- ERROR ReferenceError: Can't find variable: document HOT 2
- qustion:how to test esri-loader with jest HOT 7
- After upgrading ESRI/Loader from 2.5.0 to 3.6, Querytask.js library file is returning 404 error HOT 2
- Update product name in error messages at 4.26 HOT 3
- Are you using esri-loader with Angular and Zone.js?
- What is the latest version that supports Angular 14 and ESRI JS API v3.x? HOT 2
- How to change the default Map Language ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esri-loader.