彩票走势图

TatukGIS Developer Kernel各种开发环境下的代码对比

原创|其它|编辑:郝浩|2012-12-26 14:55:15.000|阅读 394 次

概述:TatukGIS Developer Kernel 是全面的GIS控件(也叫GIS开发工具包),本文慧都小编列举了TatukGIS Developer Kernel在Delphi、C++ Builder、VC++、VB6、VB.NET、C#几种开发环境下的部分代码,可供对比。

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

TatukGIS Developer Kernel (简称TatukGIS DK)是全面的GIS控件(也叫GIS开发工具包),它的性能和逻辑设计非常好,符合几乎全部开放标准和许可,适合定制开发独立式、嵌入式和客户端-服务器的GIS应用程序。

TatukGIS Developer Kernel的开发平台包括:Embarcadero Delphi/C++Builder VCL、Microsoft .NET for WinForms and WPF、Microsoft ActiveX/OCX、Microsoft Compact Framework (mobile解决方案)。四种开发平台都有相似的框架、API和技术,比如.NET WinForms和Compact Framework应用程序的源代码几乎一样,因此,对已经开发或正在开发中的GIS应用程序进行开发环境间的移植(如Visual Basic、VB.NET、Visual C++、C#、.NET、Compact Framework、Delphi、C++Builder等)就不是什么难事了。

下面慧都小编列举了TatukGIS Developer Kernel在Delphi、C++ Builder、VC++、VB6、VB.NET、C#几种开发环境下的部分代码,可供对比。

Delphi - TatukGIS Developer Kernel VCL代码示例

procedure TForm1.GISMouseMove(Sender: TObject; Shift: TShiftState; Y: Integer);
var
  ptg : TGIS_Point ;
  shp : TGIS_Shape ;
begin
  if Gis.IeEmpty then exit ;

  ptg := GIS.ScreenToMap( Point(x, y ) );
  shp := TGIS_Shape( GIS.Locate( ptg, 5/GIS.Zoom ) ) ;
  if shp = nil then
    StatusBar.SimpleText := ''
  else
    StatusBar.SimpleText := shp.GetField('name'); 
end;  

C++ Builder - TatukGIS Developer Kernel VCL代码示例

void __fastcall TForm1::GISMouseDown(TObject *Sender, TMouseButton Button,
                                     TShiftState Shift, int X, int Y)
{   
   TGIS_Point   ptg  ;
   TGIS_Shape  *shp  ;

   if ( GIS->IsEmpty ) return;

   ptg = GIS->ScreenToMap( Point(X, Y) );
   shp = (TGIS_Shape *)( GIS->Locate( ptg, 5/GIS->Zoom, TRUE ) ) ; 
   if (shp == NULL)
     StatusBar->SimpleText = "" ;
   else
     StatusBar->SimpleText = shp->GetField("name") ; 
} 

VisualBasic 6 - TatukGIS Developer Kernel ActiveX代码示例

Private Sub GIS_OnMouseMove(translated As Boolean, ByVal shift As TatukGIS_DK.X_ShiftState,
                            ByVal X As Long, ByVal Y As Long)    
  Dim ptg As XGIS_Point   
  Dim shp As XGIS_Shape    

  If GIS.IeEmpty Then Exit Sub

  Set ptg = GIS.ScreenToMap(GisUtils.Point(X, Y))
  Set shp = GIS.Locate(ptg, 5 / GIS.Zoom)
  If shp Is Nothing Then
    StatusBar.SimpleText = ""
  Else
    StatusBar.SimpleText = shp.GetField("name")
  End If 
End Sub

Visual C++ - TatukGIS Developer Kernel ActiveX MFC代码示例

void CLocateDlg::OnOnMouseMove(BOOL FAR* translated, long button, 
                               long shift, long X, long Y) 
{
  IXGIS_Point ptg ;
  IXGIS_Shape shp ;

  if ( m_gis.get_IsEmpty() ) return ;

  ptg = m_gis.ScreenToMap( m_utils.Point( X, Y ) ) ;

  shp = m_gis.Locate( ptg, 5. / m_gis.get_Zoom() ) ; 
  if ( shp.m_lpDispatch != NULL ) {
    var = shp.GetField( "NAME" ) ;
    str = var.bstrVal ;
    SetDlgItemText( IDC_LABEL, str );
  }
  else {
    SetDlgItemText( IDC_LABEL, _T("") );
  }
}

VisualBasic.NET - TatukGIS Developer Kernel ActiveX代码示例

Private Sub GIS_OnMouseMoveEvent(ByVal eventSender As System.Object, 
                                 ByVal eventArgs As
                                 AxTatukGIS_DK.IXGIS_ViewerWndEvents_OnMouseMoveEvent) 
                                 Handles GIS.OnMouseMove

  Dim ptg As TatukGIS_DK.IXGIS_Point
  Dim shp As TatukGIS_DK.IXGIS_Shape

  If GIS.IeEmpty() then Exit Sub

  ptg = GIS.ScreenToMap(GisUtils.Point(eventArgs.x, eventArgs.y))
  shp = GIS.Locate(ptg, 5 / GIS.Zoom)
  If shp Is Nothing Then
    StatusBar1.Text = ""
  Else
    StatusBar1.Text = shp.GetField("name")
  End If

End Sub

C# - TatukGIS Developer Kernel ActiveX代码示例

private void GIS_OnMouseMove(object sender, AxTatukGIS_DK.IXGIS_ViewerWndEvents_OnMouseMoveEvent e)
{
  TatukGIS_DK.XGIS_Point ptg;
  TatukGIS_DK.IXGIS_Shape shp;

  if ( GIS.IsEmpty ) return ;

  ptg = GIS.ScreenToMap( GisUtils.Point(e.x, e.y ) );
  shp = ( TatukGIS_DK.IXGIS_Shape ) GIS.Locate( ptg, 5/GIS.Zoom , true); 
  if( shp == null ) 
    statusBar1.Text = "";
  else 
   statusBar1.Text = ( string ) shp.GetField("name");
}

C# - TatukGIS Developer Kernel .NET代码示例

private void GIS_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
  TGIS_Point ptg ;
  TGIS_Shape shp ;

  if ( GIS.IsEmpty ) return ;

  ptg = GIS.ScreenToMap( new Point( e.X, e.Y ) );
  shp = (TGIS_Shape)GIS.Locate( ptg, 5/GIS.Zoom ) ;
  if ( shp == null )
    statusBar1.Text = "" ;
  else
    statusBar1.Text = shp.GetField( "name" ).ToString();
}

标签:GIS

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn

文章转载自:慧都控件网

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP