Package Exports
- angular2-esri-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular2-esri-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
angular2-esri-loader
An Angular 2 service to help you load ArcGIS API for JavaScript Modules
Usage
Example of using the loader service in a resolver to lazy load the ArcGIS API and
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
import { EsriLoaderService } from 'angular2-esri-loader/angular2-esri-loader';
@Injectable()
export class EsriMapResolveService implements Resolve<any> {
constructor(private esriLoader: EsriLoaderService) { }
resolve() {
// only load the ArcGIS API for JavaScript when we get to this route
return this.esriLoader.load({
// use a specific version of the API instead of the latest
url: '//js.arcgis.com/3.18/'
}).then(() => {
// load the map class needed to create a new map
// and make it available in the route's data
return this.esriLoader.loadModules(['esri/map']);
});
}
}