How to use the esri-loader.loadCss 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 Esri / arcgis-rest-js / demos / webmap-checker-sapper / src / components / WebMap.html View on Github external
intializeWebMap() {
        // get the id of the webmap from the component
        const { itemId } = this.get();

        // set the session from the global store
        const { session } = this.store.get();

        // load the CSS dynamically with Esri Loader
        loadCss("https://js.arcgis.com/4.10/esri/css/main.css");

        // load JS API modules with Esri Loader
        loadModules([
          "esri/views/MapView",
          "esri/WebMap",
          "esri/identity/IdentityManager"
        ])
          .then(([MapView, WebMap, esriId]) => {
            // since our webmap might be private we can pass teh credentials
            // from the ArcGIS REST JS session to the JS API Identity Manager
            // the JS API will then use these credentials for future requests
            esriId.registerToken(session.toCredential());

            // then we load a web map from an id
            var webmap = new WebMap({
              portalItem: {
github vannizhang / wayback / src / components / Map / index.tsx View on Github external
async initMap() {
        loadCss();

        const { defaultExtent } = this.props;

        try {
            const container = this.mapDivRef.current;

            type Modules = [
                typeof IMapView,
                typeof IMap,
                typeof IVectorTileLayer
            ];

            const [MapView, Map, VectorTileLayer] = await (loadModules([
                'esri/views/MapView',
                'esri/Map',
                'esri/layers/VectorTileLayer',
github Esri / ember-esri-loader / addon / services / esri-loader.js View on Github external
loadCss (...args) {
    return esriLoader.loadCss(...args);
  }
});
github agrc / atlas / src / components / esrijs / MapView.js View on Github external
async componentDidMount() {
    loadCss('https://js.arcgis.com/4.9/esri/css/main.css');
    const mapRequires = [
      'esri/Map',
      'esri/views/MapView',
      'esri/layers/FeatureLayer',
      'esri/geometry/Polygon'
    ];
    const selectorRequires = [
      'esri/layers/support/LOD',
      'esri/layers/support/TileInfo',
      'esri/layers/WebTileLayer',
      'esri/Basemap'
    ];

    const [Map, MapView, FeatureLayer, Polygon, LOD, TileInfo, WebTileLayer, Basemap] = await loadModules(mapRequires.concat(selectorRequires));

    this.map = new Map();

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