怎么将一个得到的feature对象定位
在xtreme for java中搜索一个建筑物,然后将其定位,结果报错,代码如下,大家帮忙看一下吧
ft是一个feature 对象
if(ft!=null)
{
Geometry ftGmt=ft.getGeometry();
DoublePoint ftPoint=null;
if(ftGmt.getType()==Geometry.TYPE_POINT)
{
PointGeometry ptGmt=(PointGeometry)ftGmt;
ptGmt.getPoint(ftPoint);
ftPoint=ptGmt.getPoint(null);
mymap.setZoomAndCenter(mymap.getZoom(),ftPoint);
}
else if(ftGmt.getType()==Geometry.TYPE_REGION)
{
VectorGeometry vtGmt=(VectorGeometry)ftGmt;
DoubleRect rect=vtGmt.getBounds();
ftPoint=rect.center();
mymap.setZoomAndCenter(mymap.getZoom(),ftPoint);
}
系统执行到DoubleRect rect=vtGmt.getBounds();就报错了,大家帮忙看看到底怎么回事啊