esri-loader
esri-loader copied to clipboard
利用BaseTileLayer.createSubclass进行扩展,读取离线tms瓦片。
1、使用import {setDefaultOptions, loadCss, loadModules} from 'esri-loader';方式 在es6中, type MapModules = [ typeof import('esri/views/SceneView'), typeof import('esri/Basemap'), typeof import('esri/Map'), typeof import('esri/layers/TileLayer'), typeof import('esri/layers/WebTileLayer'), typeof import('esri/core/Collection'), typeof import('esri/layers/BaseTileLayer') ];
const [
SceneView,
Basemap,
Map,
TileLayer,
WebTileLayer,
Collection,
BaseTileLayer
] = await (loadModules([
'esri/views/SceneView',
'esri/Basemap',
'esri/Map',
'esri/layers/TileLayer',
'esri/layers/WebTileLayer',
'esri/core/Collection',
"esri/layers/BaseTileLayer"
]) as Promise<MapModules>);
利用BaseTileLayer.createSubclass进行扩展,读取离线tms瓦片。 ts报错:在ts中使用BaseTileLayer报错,Property 'createSubclass' does not exist on type 'BaseTileLayerConstructo。 通过html里通过require方式没问题。
@694225772 can you share a simple sample that reproduces the issue? For example, codepen.io is a great way to share samples.
Here is a working sample that demonstrates the use of BaseTileLayer.createSubclass()
: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=layers-custom-elevation-thematic
Closing for now. Need additional info.