How to use the esri-loader.loadScript function in esri-loader

To help you get started, we’ve selected a few esri-loader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beginor / ng-esri-demo / projects / web / src / app / services / esri-loader-guard.ts View on Github external
public async canLoad(
        route: Route,
        segments: UrlSegment[]
    ): Promise {
        if (isLoaded()) {
            return true;
        }
        try {
            const options = this.getOptions();
            // load esri script and dojoConfig;
            await loadScript(options);
            // add cors enabled hosts
            const [config] = await loadModules(['esri/config']);
            for (const server of environment.trustedServers) {
                config.request.trustedServers.push(server);
            }
            return true;
        }
        catch (ex) {
            console.error(ex);
            return false;
        }
    }
github Esri / ember-esri-loader / addon / services / esri-loader.js View on Github external
loadScript (options) {
    return esriLoader.loadScript(options)
    .then(script => {
      // have to wrap this async side effect in Ember.run() so tests don't fail
      // may be able to remove this once we can have esriLoader use RSVP.Promise
      run(() => {
        // update the isLoaded computed property
        this.notifyPropertyChange('isLoaded');
        return script;
      });
    });
  },
github tomwayson / angular-esri-loader / src / services / esri-loader.service.ts View on Github external
load(options?: ILoadScriptOptions): Promise {
    this.loadScriptOptions = options ? options : {};
    return loadScript(options);
  }

esri-loader

A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications

Apache-2.0
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis