⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connectionpoolclass.java

📁 CreateMyFirstMap
💻 JAVA
字号:
package myfirstmap;
import  com.mapinfo.dp.jdbc.oraso.OraSoDataProviderHelper;
import  com.mapinfo.dp.jdbc.oraso.OraSoTableDescHelper;
import com.mapinfo.dp.RenditionType;
import com.mapinfo.coordsys.CoordSys;
import com.mapinfo.mapxtreme.client.MapXtremeDataProviderRef;
import com.mapinfo.mapxtreme.client.MapXtremeImageRenderer;
import com.mapinfo.mapj.MapJ;
import com.mapinfo.util.DoublePoint;
import com.mapinfo.util.DoubleRect;
import com.mapinfo.unit.LinearUnit;
import com.mapinfo.xmlprot.mxtj.ImageRequestComposer;
import  java.awt.Color;
public class ConnectionPoolClass
{
  public ConnectionPoolClass()
  {
  }
public void studyPool()
{
    String[] idColumns={"MI_PRINX"};
    OraSoTableDescHelper oraSoTDHelper=new OraSoTableDescHelper("POINT",//tablename
        false,idColumns,//unique key column
        "GEOLOC",//spatial column
        null,//renditionColumn
     RenditionType.none ,//rendition type
     null,//labelRenditionType
     RenditionType.none ,
     CoordSys.longLatWGS84 ,//coordinate system
     2,//dimension
     "ZP_SUCCEED");//owner
 OraSoDataProviderHelper oraSoDPHelper=new OraSoDataProviderHelper("jdbc:mipool:fuckwhy",null,null);
   String mapxtremeURL="http://901-32:8083/mapxtreme47/mapxtreme";
   try
   {
     MapXtremeDataProviderRef mxtDPRef = new MapXtremeDataProviderRef(
         oraSoDPHelper, mapxtremeURL);
    MapJ  mapj=new MapJ();
    DoublePoint point=new DoublePoint(108.9608,34.2729);
    DoubleRect bound=new DoubleRect(point,0.31,0.21);
    mapj.setBounds(bound) ;
    LinearUnit unit=LinearUnit.kilometer ;
    mapj.setDistanceUnits(unit) ;
    mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
    //
    mapj.getLayers() .insertLayer(mxtDPRef,oraSoTDHelper,0,"point");
    MapXtremeImageRenderer render=new MapXtremeImageRenderer(mapxtremeURL);
    ImageRequestComposer imageRC=ImageRequestComposer.create(mapj,256,Color.white ,"image/png");
    render.render(imageRC) ;
    render.toFile("E:\\MapInfo\\study\\png\\pool.png") ;
   }catch(java.lang.Exception  e)
   {
     System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
   }
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -