設置代理調用WMTS服務

 

1、數據準備css

一、連接:http://pan.baidu.com/s/1sjzCytR 密碼:uugc,下載DotNet版本html

clip_image002

clip_image003

二、 發佈切片服務,打開ogc服務可產看到相應的符合ogc標準的服務,以下選擇WMTS服務瀏覽器

clip_image005該服務下有符合WMTS服務的描述文檔dom

clip_image007

clip_image009

2、調用

一、拷貝DottNet版本中的文件到C:\inetpub\wwwroot\proxy(部分文件須要新建)【圖1】,用記事本打開proxy.configide

clip_image010

圖1ui

二、按【圖2】添加url

<serverUrl url="http://localhost:6080/arcgis/rest/services"scala

matchAll="true"/>rest

到特定位置,保存關閉便可orm

clip_image012

三、 在C:\inetpub\wwwroot路徑下新建tests.html[可在別的IDE中新建html文檔而後發佈到IIS中也是同樣的效果],用記事本打開,寫入以下內容

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<!--The viewport meta tag is used to improve the presentation and behavior

of the samples on iOS devices-->

<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">

<title>Add WMTS Layer</title>

<link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">

<style>

html, body { height: 100%; width: 100%; margin: 0; padding: 0; }

#map{

padding: 0;

}

#citationInfo{

position:absolute;

color:black;

font-weight:bold;

font-size:12pt;

left:10px;

bottom:10px;

z-Index:999;

}

</style>

<script src="http://js.arcgis.com/3.13/"></script>

<script>

var map;

require([

"esri/map", "esri/layers/WMTSLayer", "esri/layers/WMTSLayerInfo",

"esri/config",

"dojo/domReady!"

], function(

Map, WMTSLayer, WMTSLayerInfo,

esriConfig

) {

esriConfig.defaults.io.proxyUrl = "/proxy/proxy.ashx";

map = new Map("map");

var layerInfo = new WMTSLayerInfo({

identifier: "test_MyMapService",

format: "png"

});

var options = {

serviceMode: "KVP",

layerInfo: layerInfo

};

var wmtsLayer = new WMTSLayer("http://localhost:6080/arcgis/rest/services/test/MyMapService/MapServer/WMTS", options);

map.addLayer(wmtsLayer);

});

</script>

</head>

<body>

<div id="map">

<div id="citationInfo">

</div>

</div>

</body>

</html>

開始瀏覽該服務

clip_image014

瀏覽器中顯示以下

clip_image016

相關文章
相關標籤/搜索