我从服务器上读的地图,显示没有水面问题,就是有的土层没有加上去,什么原因 ??????????????
我代码如下: public void init()
{
try
{
var0 = this.getParameter("URLPath", "http://hilinker-rhl0mk");
}
catch(Exception e)
{
e.printStackTrace();
} this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
//the next is used to connect ArcIMS server
try
{
String urltext = var0;
int layid=-1;
connection = new ArcIms4Connection(urltext);
source = SourceCache.getSource(connection);
source.connect();if(source.isConnected())
{
Content services[] = source.getRoots(); for(int i=0;i < services.length; i++)
{
Content service = services[i];
if(service.getDescription().indexOf("Feature Service") != -1)
{
if (service.getName().equals("tba"))
{
layid=i;
}
}
}}//layid=2;//end connect ArcIMS server
//the next is used to add layer from ArcIMS serverif(source.isConnected())
{
Content services[] = source.getRoots();
Content service = services[layid];
folder = (com.esri.mo2.src.sys.Folder)service;
Content layers[] = folder.getContents(); map1.getLayerset().clear();
layerlist = new Layer[layers.length];
for(int j = 0; j < layers.length; j++)
{
Content content = layers[j];
Layer layer = (Layer)content.getData(Layer.class.getName()); layerlist[j] = layer; layerlist[j].setVisible(true);
map1.addLayer(layerlist[j]);
}
map1.setSelectedTool(zi);
map1.redraw();
setVisible(true);
}
//end add layer
}
catch (Exception exception)
{
showException(exception);
}
我代码如下: public void init()
{
try
{
var0 = this.getParameter("URLPath", "http://hilinker-rhl0mk");
}
catch(Exception e)
{
e.printStackTrace();
} this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
//the next is used to connect ArcIMS server
try
{
String urltext = var0;
int layid=-1;
connection = new ArcIms4Connection(urltext);
source = SourceCache.getSource(connection);
source.connect();if(source.isConnected())
{
Content services[] = source.getRoots(); for(int i=0;i < services.length; i++)
{
Content service = services[i];
if(service.getDescription().indexOf("Feature Service") != -1)
{
if (service.getName().equals("tba"))
{
layid=i;
}
}
}}//layid=2;//end connect ArcIMS server
//the next is used to add layer from ArcIMS serverif(source.isConnected())
{
Content services[] = source.getRoots();
Content service = services[layid];
folder = (com.esri.mo2.src.sys.Folder)service;
Content layers[] = folder.getContents(); map1.getLayerset().clear();
layerlist = new Layer[layers.length];
for(int j = 0; j < layers.length; j++)
{
Content content = layers[j];
Layer layer = (Layer)content.getData(Layer.class.getName()); layerlist[j] = layer; layerlist[j].setVisible(true);
map1.addLayer(layerlist[j]);
}
map1.setSelectedTool(zi);
map1.redraw();
setVisible(true);
}
//end add layer
}
catch (Exception exception)
{
showException(exception);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货