How to use the esri-loader.isLoaded 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 luiguild / arceasy / src / map.js View on Github external
return new Promise((resolve, reject) => {
    const cdn = global.options.cdn

    if (cdn !== undefined && global.loaded) {
      // Has the ArcGIS API been added to the page?
      if (!esriLoader.isLoaded()) {
        // No, lazy load it the ArcGIS API before using its classes
        esriLoader.bootstrap(err => {
          if (err) {
            logger.error(err)
          }
          // Once it's loaded, create the map
          logger.log(`Waiting ESRI server...`)
          dojoLoader(resolve, reject)
        }, {
          // Use a specific version instead of latest 4.x
          url: cdn
        })
      } else {
        // ArcGIS API is already loaded, just create the map
        logger.log(`Waiting ESRI server...`)
        dojoLoader(resolve, reject)
github Esri / ember-esri-loader / addon / services / esri-loader.js View on Github external
unknownProperty (key) {
    if (key === 'isLoaded') {
      return esriLoader.isLoaded();
    }
  },

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