/* * @Author: tengmingxue 1473375109@qq.com * @Date: 2022-11-10 13:28:12 * @LastEditors: tengmingxue 1473375109@qq.com * @LastEditTime: 2022-11-10 14:55:07 * @FilePath: \mbBigScreen\src\views\dashboard\components\mapdata\esriLoaderAPI.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import esriLoader from 'esri-loader' import { loadModules } from 'esri-loader' import { esriConfig } from 'staticPub/config' // 查找静态文件下的config 地图配置 // window.apiRoot = 'https://js.arcgis.com/4.17/'; //可以写在项目的配置文件里 window.apiRoot=esriConfig.baseUrl //可以写在项目的配置文件里 window.dojoConfig = { async: true, // for jsapi ver. >= 4.9 兼容浏览器 deps: ['@dojo/framework/shim/main'], // for jsapi ver. <= 4.8 // deps: ['@dojo/shim/main'], packages: [ // { // name: 'sample', // location: 'sample/demo' // }, ], has: { 'esri-promise-compatibility': 1, // Use native Promises by default 'esri-featurelayer-webgl': 1, // Enable FeatureLayer WebGL capabilities } }; function configEsriLoader() { esriLoader.utils.Promise = Promise; } export function load(modules) { //configEsriLoader(); esri-loader 2.16.0 之前版本用这个 return loadModules(modules, { dojoConfig: window.dojoConfig, url: window.apiRoot, }); }