如何获取server的服务信息
解析server服务地址时,未获得返回值。
方案1
var url=http://localhost:6080/arcgis/r ... on%3B
$.getJSON(url,function(data){
alert(ddd);
alert(data);
});
方案2
var url=http://localhost:6080/arcgis/rest/services;
$.getJSON(url,{f:pjson},function(data){
alert(ddd);
alert(data);
});
上述两种方案均失败。
方案1
var url=http://localhost:6080/arcgis/r ... on%3B
$.getJSON(url,function(data){
alert(ddd);
alert(data);
});
方案2
var url=http://localhost:6080/arcgis/rest/services;
$.getJSON(url,{f:pjson},function(data){
alert(ddd);
alert(data);
});
上述两种方案均失败。
1 个回复
徐鸿至
赞同来自:
请参见参考文档,具体地址如下:
http://resources.arcgis.com/en/help/rest/apiref/
以服务目录 http://services.arcgisonline.c ... ices/为例,利用http://services.arcgisonline.c ... pjson 即可获取该server的服务描述信息
server 10.1 的话支持CORS可以不配置代理:
具体参考如下链接: https://developers.arcgis.com/ ... .html
esriConfig.defaults.io.corsEnabledServers 这一段,把你只需要将自己的server地址push进去即可:
require([esri/config], function(esriConfig) {
esriConfig.defaults.io.corsEnabledServers.push(localhost:6080);
});
如果还不行,就需要配置代理,请参考如下文档:
https://developers.arcgis.com/ ... .html
要回复问题请先登录或注册