b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

mapxtreme 2008破解_mapxtreme_mapxtreme编程(5)

电脑杂谈  发布时间:2017-01-22 16:01:47  来源:网络整理

第二步,点击放大后可看到主要城市的图层信息,效果如下:

2.jpg

进一步放大后,能看到更多的图层信息,效果如下:

3.jpg

第三步:查询图层信息(根据客户端点击的地图位置,展现不通的图层信息)

CODE:

PrintWriter out = response.getWriter();
        HttpSession session = request.getSession();
        String xmlInfo = "";
        xmlInfo +="<LAYERS><CITY>";
        try {
               int    xpoint=Integer.parseInt(request.getParameter("xpoint"));
              int    ypoint=Integer.parseInt(request.getParameter("ypoint"));         
            MapJ mainMap = (MapJ) session.getAttribute("worldMap");            
            FeatureLayer layer = (FeatureLayer) mainMap.getLayers().get("CHCTY_2K");
//创建一个图原层           
            if (layer.isVisibleAtCurrentZoom()) {       
                ArrayList columns = new ArrayList();
                columns.add("lace_Name");
                columns.add("Latitude");
                columns.add("Longitude");
                DoubleRect rect = mainMap.transformScreenToNumeric(new DoubleRect(new DoublePoint(xpoint-100, ypoint-100), new DoublePoint(xpoint+100, ypoint+100)));
                FeatureSet fs = layer.searchWithinRectangle(columns, rect, QueryParams.EMPTY_PARAMS);//得到图元集
                         Feature f;                    
                         while ((f = fs.getNextFeature()) != null ) {   
                                for (int i = 0; i < f.getAttributeCount(); i++) {                          
                                              switch (i)
                                              {
                                                     case 0:
                                                            xmlInfo +="<LACENAME>"+f.getAttribute(i)+"</PLACENAME>";
                                                            break;
                               case 1:
                                      xmlInfo +="<LATITUDE>"+f.getAttribute(i)+"</LATITUDE>";
                                                            break;     
                               case 2:
                                      xmlInfo +="<LONGITUDE>"+f.getAttribute(i)+"</LONGITUDE>";
                                      break;                                     
                                              }
                                              
                                }                              
                         }         
                fs.dispose();                
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        xmlInfo +="</CITY></LAYERS>";
out.print(xmlInfo);


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-28076-5.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 曾俣杰
      曾俣杰

      拉起了我的手

    • 水树奈奈
      水树奈奈

      马云还没有死呀

    • 唐德宗
      唐德宗

      随着排水量达12000吨的055型驱逐舰的建造服役

    热点图片
    拼命载入中...