我正在尝试使用Aptana IDE从arcgis服务器获取并显示地图。它说l未定义。
获取https://gistest2.xxx.xxx/arcgis/rest/info?f=json
200 OK 27ms TypeError:l未定义
... X)LT = p.dx)及;&安培; q._addFrameInfo(H,P); this.setExclusionAreas(this.exclusionAreas);此...
以下是除我尝试访问的网址之外的整个代码。
<!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>BGSU Memorial Trees Location</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<script src="http://js.arcgis.com/3.10/">
</script>
<script>
var map;
require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "dojo/domReady!"],
function (Map, ArcGISTiledMapServiceLayer ) {
map = new Map("map", {
center: [-76.756, 40.241],
zoom: 8
});
var customBasemap = new ArcGISTiledMapServiceLayer(
"https://XXX/");
map.addLayer(customBasemap);
});
</script>
</head>
<body class="claro">
<div align="center"><strong>BGSU Memorial Trees Listing </strong><hr>
<i><a target="_self" href="listingtrees.html">Listing</a> | <a target="_self" href="locationtrees.html">Locations </a></i>
</div>
<br>
<div id="map" >
</div>
</body>
</html>
非常感谢任何帮助。
提前致谢!
答案 0 :(得分:0)
在ArcGISTiledMapServiceLayer的构造函数中,您必须指定ArcGIS平铺地图服务的URL。 URL示例:
http://myserver/arcgis/rest/services/map_service_name/MapServer
您指定的地址(arcgis / rest / info?f = json)是ArcGIS Server的REST服务的地址,但未指向地图服务。