简体   繁体   English

如何显示底图和 TileLayer ArcGIS Javascript API

[英]How to display basemap and a TileLayer ArcGIS Javascript API

I'm using the API of ArcGIS for JavaScript to display a cached map service.我正在使用 ArcGIS 的 API for JavaScript 来显示缓存的 map 服务。 So far, I've been following the documentation and this is what I have.到目前为止,我一直在关注文档,这就是我所拥有的。

const mapLayer = new TileLayer({
  url: "https://sigmun.implanchihuahua.org/webserver/rest/services/Metrica_Chihuahua/PU023_Dosificacion_Zonificacion_Secundaria_2021_MC/MapServer",
  opacity: 0.3
});

const map = new Map({
  basemap: 'osm',
  layers: [mapLayer],
});

This code displays the next此代码显示下一个在此处输入图像描述

Even though I created the TileLayer instance it doesn't show up, but if I removed the basemap line, like this.即使我创建了 TileLayer 实例,它也不会显示,但如果我删除了底图线,就像这样。

const mapLayer = new TileLayer({
  url: "https://sigmun.implanchihuahua.org/webserver/rest/services/Metrica_Chihuahua/PU023_Dosificacion_Zonificacion_Secundaria_2021_MC/MapServer",
  opacity: 0.3
});

const map = new Map({
  // basemap: 'osm',
  layers: [mapLayer],
});

The TileLayer gets displayed. TileLayer 被显示出来。 在此处输入图像描述

What I want to do is display both things, the basemap and the tile layer.我想要做的是显示底图和瓦片图层。

Your tiled layer is not displaying on top of the OSM basemap because its tiles were created in a different spatial reference.您的切片图层未显示在 OSM 底图的顶部,因为它的切片是在不同的空间参考中创建的。

https://sigmun.implanchihuahua.org/webserver/rest/services/Metrica_Chihuahua/PU023_Dosificacion_Zonificacion_Secundaria_2021_MC/MapServer shows PROJCS["MEXICO_ITRF_2008_UTM_Zone_13N"... while the OSM basemap is in the WebMercator. https://sigmun.implanchihuahua.org/webserver/rest/services/Metrica_Chihuahua/PU023_Dosificacion_Zonificacion_Secundaria_2021_MC/MapServer显示PROJCS["MEXICO_ITRF_2008_UTM_Zone_13N"...而 WebMercator 是。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM