portal ID无法调用如何解决?
通过ID调用portal发布的webscene,控制台提示Failed to load web scene,在线引用API和引用本地部署的API时错误一样,求大神指点,万分感谢,急!!!!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>加载webscene</title>
<!-- 使用本地部署的API -->
<link rel="stylesheet" type="text/css" href="http://192.168.58.159/arcgis_j ... ot%3B />
<script type="text/javascript" src="http://192.168.58.159/arcgis_j ... gt%3B
<style>
html,body,#viewDiv {
padding: 1px;
margin: 1px;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/Map",
"esri/views/SceneView",
"esri/WebScene",
"esri/config",
"dojo/dom",
"dojo/domReady!"
],function(Map,SceneView, WebScene,esriConfig,dom){
esriConfig.portalURL="http://trail.arcgisonline.cn/portal";
var scene = new WebScene({
portalItem: {
id: "497408d51d064354bb4487063a9efe7c"
}
});
var view = new SceneView({
map: scene,
container: "viewDiv",
});
})
</script>
</head>
<body></body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>加载webscene</title>
<!-- 使用本地部署的API -->
<link rel="stylesheet" type="text/css" href="http://192.168.58.159/arcgis_j ... ot%3B />
<script type="text/javascript" src="http://192.168.58.159/arcgis_j ... gt%3B
<style>
html,body,#viewDiv {
padding: 1px;
margin: 1px;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/Map",
"esri/views/SceneView",
"esri/WebScene",
"esri/config",
"dojo/dom",
"dojo/domReady!"
],function(Map,SceneView, WebScene,esriConfig,dom){
esriConfig.portalURL="http://trail.arcgisonline.cn/portal";
var scene = new WebScene({
portalItem: {
id: "497408d51d064354bb4487063a9efe7c"
}
});
var view = new SceneView({
map: scene,
container: "viewDiv",
});
})
</script>
</head>
<body></body>
</html>
2 个回复
许丹石
赞同来自:
荆雪涵 - 90后
赞同来自:
https://www.arcgis.com/sharing/rest/content/items/497408d51d064354bb4487063a9efe7c, 这个是ArcGIS Online的URL,
你的Portal Item URL 应该为
http://trail.arcgisonline.cn/portal/sharing/rest/content/items/497408d51d064354bb4487063a9efe7c
看下Portal URL有没有设置对?
要回复问题请先登录或注册
发起人
相关问题
问题状态
—— 扫技术支持中心微信服务号!
—— 让GIS知乎问答随时随地!