esri-loader icon indicating copy to clipboard operation
esri-loader copied to clipboard

利用BaseTileLayer.createSubclass进行扩展,读取离线tms瓦片。

Open 694225772 opened this issue 2 years ago • 2 comments

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 avatar Mar 18 '22 02:03 694225772

™ٛmapbox1-18т׶Χ WeMap Export TMS OSGEO:41001

694225772 avatar Mar 18 '22 02:03 694225772

@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

andygup avatar Mar 18 '22 14:03 andygup

Closing for now. Need additional info.

andygup avatar Oct 24 '22 15:10 andygup