Unit IWMAPVIEWCTRLLib_1_0_TLB;
// Imported IWMAPVIEWCTRLLib on 30.05.2017 16:41:28 from C:\Program Files (x86)\infoware\mapsuite_3.9\GIS-Tools\lib\iwMapViewCtrl.ocx
{$mode delphi}{$H+}
interface
// Dependency: IWGEOOBJECTSLib v1.0 (C:\Program Files (x86)\infoware\mapsuite_3.9\GIS-Tools\lib\iwGeoObjects.dll)
// Dependency: stdole v2 (stdole2.pas)
Uses
Windows,ActiveX,Classes,Variants,IWGEOOBJECTSLib_1_0_TLB,stdole2,ActiveXContainer,
EventSink;
Const
IWMAPVIEWCTRLLibMajorVersion = 1;
IWMAPVIEWCTRLLibMinorVersion = 0;
IWMAPVIEWCTRLLibLCID = 0;
LIBID_IWMAPVIEWCTRLLib : TGUID = '{85062597-A349-4A8F-8F70-46942316BF76}';
IID__DiwMapViewCtrl : TGUID = '{357CEE48-2FD4-4311-9E92-1050A4429D8C}';
IID__DiwMapViewCtrlEvents : TGUID = '{764407BA-4EE6-4571-B735-B125470009DA}';
CLASS_iwMapViewCtrl : TGUID = '{50025AF2-1959-4417-B9F3-42B54C24BF55}';
//Enums
//Forward declarations
Type
_DiwMapViewCtrl = dispinterface;
_DiwMapViewCtrlEvents = dispinterface;
//Map CoClass to its default interface
iwMapViewCtrl = _DiwMapViewCtrl;
//records, unions, aliases
//interface declarations
// _DiwMapViewCtrl : Dispatch-Schnittstelle für iwMapView Control
_DiwMapViewCtrl = dispinterface
['{357CEE48-2FD4-4311-9E92-1050A4429D8C}']
// ZoomIn :
function ZoomIn:Integer;dispid 101;
// ZoomOut :
function ZoomOut:Integer;dispid 102;
// ZoomToPoints :
function ZoomToPoints(geopoints:IiwGeoPoints;xMarginPercent:Integer;yMarginPercent:Integer;minWidth:Double;minHeight:Double):Integer;dispid 103;
// ZoomByFactor :
function ZoomByFactor(factor:Double):Integer;dispid 104;
// Pan :
function Pan(geopoint:IiwGeoPoint):Integer;dispid 105;
// ToMapPoint :
function ToMapPoint(xval:Integer;yval:Integer;geopoint:IiwGeoPoint):Integer;dispid 106;
// FromMapPoint :
function FromMapPoint(geopoint:IiwGeoPoint;xval:Integer;yval:Integer):Integer;dispid 107;
// SetFullExtent :
function SetFullExtent:Integer;dispid 108;
// ActivateDynamicLayer :
function ActivateDynamicLayer(key:WideString;keyvalue:WideString):Integer;dispid 109;
// DeactivateDynamicLayer :
function DeactivateDynamicLayer(key:WideString):Integer;dispid 110;
// PrintMap :
function PrintMap(hdc:OLE_HANDLE;x:Integer;y:Integer;width:Integer;height:Integer):Integer;dispid 111;
// RefreshMap :
function RefreshMap:Integer;dispid 112;
// GetErrorDesc :
function GetErrorDesc(error:Integer;description:WideString):Integer;dispid 113;
// IdentifyVisibleObjects :
function IdentifyVisibleObjects(identifyX:Smallint;identifyY:Smallint;radiusInPixel:Integer;IdentifyLayerNames:WideString;getBorderPolygons:Smallint;xmlResult:WideString):Integer;dispid 114;
// IdentifyVisibleObjects1 :
function IdentifyVisibleObjects1(maprect:IiwGeoRect;viewWidth:Smallint;viewHeight:Smallint;identifyX:Smallint;identifyY:Smallint;radiusInPixel:Integer;IdentifyLayerNames:WideString;getBorderPolygons:Smallint;xmlResult:WideString):Integer;dispid 115;
// GetDataProjectionName :
function GetDataProjectionName(name:WideString):Integer;dispid 116;
// OutputMap :
function OutputMap(hdc:OLE_HANDLE;x:Integer;y:Integer;width:Integer;height:Integer):Integer;dispid 117;
// EventHandled :
function EventHandled:Integer;dispid 118;
// GetMapDC :
function GetMapDC(hdc:OLE_HANDLE):Integer;dispid 119;
// ReleaseMapDC :
function ReleaseMapDC(hdc:OLE_HANDLE):Integer;dispid 120;
// SetNextDrawMode :
function SetNextDrawMode(mode:Integer):Integer;dispid 121;
// SetSecurityKey :
function SetSecurityKey(filename:WideString;key:WideString):Integer;dispid 10000;
// SetRotationCenterAndAngle :
function SetRotationCenterAndAngle(x:Double;y:Double;angle:Double):Integer;dispid 10100;
// SetLayerVisibility :
function SetLayerVisibility(layername:WideString;value:Integer):Integer;dispid 10300;
// SetWaitCursorMode :
function SetWaitCursorMode(value:Integer):Integer;dispid 10301;
// SetErrorHandlingMode :
function SetErrorHandlingMode(mode:Integer):Integer;dispid 10304;
// SetLayerGroupVisibility :
function SetLayerGroupVisibility(groupvalue:WideString;value:Integer):Integer;dispid 10305;
// SetImageQuality :
function SetImageQuality(mode:Integer):Integer;dispid 10306;
// CreateMap :
function CreateMap(hdc:OLE_HANDLE;dpi:Integer;Extent:IiwGeoRect;width:Integer;height:Integer):Integer;dispid 10500;
// AboutBox :
procedure AboutBox;dispid -552;
// MapDescriptionFilename :
property MapDescriptionFilename:WideString dispid 1;
// FullExtent :
property FullExtent:IiwGeoRect dispid 2;
// Extent :
property Extent:IiwGeoRect dispid 3;
// Appearance :
property Appearance:Smallint dispid -520;
// BackColor :
property BackColor:OLE_COLOR dispid 4;
// BorderStyle :
property BorderStyle:Smallint dispid 5;
// ZoomFactor :
property ZoomFactor:Double dispid 6;
// Scale :
property Scale:Integer dispid 7;
// MouseMode :
property MouseMode:Smallint dispid 8;
// MapLimits :
property MapLimits:IiwGeoRect dispid 9;
// MapLimitMode :
property MapLimitMode:Smallint dispid 10;
// IdentifyRadius :
property IdentifyRadius:Double dispid 11;
// IdentifyRadiusUnit :
property IdentifyRadiusUnit:Smallint dispid 12;
// IdentifyLayerNames :
property IdentifyLayerNames:WideString dispid 13;
// IdentifyGetBorderPolygons :
property IdentifyGetBorderPolygons:Smallint dispid 14;
// RefreshCount :
property RefreshCount:Integer dispid 15;
// Enabled :
property Enabled:ShortInt dispid -514;
// BorderStyleCE :
property BorderStyleCE:Smallint dispid -504;
end;
// _DiwMapViewCtrlEvents : Ereignisschnittstelle für iwMapView Control
_DiwMapViewCtrlEvents = dispinterface
['{764407BA-4EE6-4571-B735-B125470009DA}']
// AfterAllLayerDraw :
procedure AfterAllLayerDraw(hdc:OLE_HANDLE);dispid 1;
// PopupMenu :
procedure PopupMenu(hmenu:OLE_HANDLE);dispid 2;
// CustomMenuCommand :
procedure CustomMenuCommand(menuid:Smallint;mousex:Integer;mousey:Integer);dispid 3;
// MapViewError :
procedure MapViewError(errorcode:Smallint;errortext:WideString);dispid 4;
// FireIdentifyResult :
procedure FireIdentifyResult(IdentifyResult:WideString);dispid 5;
// SetCursor :
procedure SetCursor;dispid 6;
// MeasureDistance :
procedure MeasureDistance(currSegmentLength:Double;totalLength:Double);dispid 7;
// AfterUserDraw :
procedure AfterUserDraw(hdc:OLE_HANDLE);dispid 8;
// Progress :
procedure Progress(statusCode:Integer;cancel:Integer);dispid 9;
// MouseDown :
procedure MouseDown(nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer);dispid -605;
// MouseUp :
procedure MouseUp(nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer);dispid -607;
// MouseMove :
procedure MouseMove(nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer);dispid -606;
end;
//CoClasses
T_DiwMapViewCtrlEventsAfterAllLayerDraw = procedure(Sender: TObject;hdc:OLE_HANDLE) of object;
T_DiwMapViewCtrlEventsPopupMenu = procedure(Sender: TObject;hmenu:OLE_HANDLE) of object;
T_DiwMapViewCtrlEventsCustomMenuCommand = procedure(Sender: TObject;menuid:Smallint;mousex:Integer;mousey:Integer) of object;
T_DiwMapViewCtrlEventsMapViewError = procedure(Sender: TObject;errorcode:Smallint;errortext:WideString) of object;
T_DiwMapViewCtrlEventsFireIdentifyResult = procedure(Sender: TObject;IdentifyResult:WideString) of object;
T_DiwMapViewCtrlEventsSetCursor = procedure(Sender: TObject) of object;
T_DiwMapViewCtrlEventsMeasureDistance = procedure(Sender: TObject;currSegmentLength:Double;totalLength:Double) of object;
T_DiwMapViewCtrlEventsAfterUserDraw = procedure(Sender: TObject;hdc:OLE_HANDLE) of object;
T_DiwMapViewCtrlEventsProgress = procedure(Sender: TObject;statusCode:Integer;cancel:Integer) of object;
T_DiwMapViewCtrlEventsMouseDown = procedure(Sender: TObject;nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer) of object;
T_DiwMapViewCtrlEventsMouseUp = procedure(Sender: TObject;nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer) of object;
T_DiwMapViewCtrlEventsMouseMove = procedure(Sender: TObject;nButton:Smallint;nShiftState:Smallint;x:Integer;y:Integer) of object;
CoiwMapViewCtrl = Class
Public
Class Function Create: _DiwMapViewCtrl;
Class Function CreateRemote(const MachineName: string): _DiwMapViewCtrl;
end;
TAxciwMapViewCtrl = Class(TActiveXContainer)
Private
FServer:_DiwMapViewCtrl;
FOnAfterAllLayerDraw:T_DiwMapViewCtrlEventsAfterAllLayerDraw;
FOnPopupMenu:T_DiwMapViewCtrlEventsPopupMenu;
FOnCustomMenuCommand:T_DiwMapViewCtrlEventsCustomMenuCommand;
FOnMapViewError:T_DiwMapViewCtrlEventsMapViewError;
FOnFireIdentifyResult:T_DiwMapViewCtrlEventsFireIdentifyResult;
FOnSetCursor:T_DiwMapViewCtrlEventsSetCursor;
FOnMeasureDistance:T_DiwMapViewCtrlEventsMeasureDistance;
FOnAfterUserDraw:T_DiwMapViewCtrlEventsAfterUserDraw;
FOnProgress:T_DiwMapViewCtrlEventsProgress;
FOnMouseDown:T_DiwMapViewCtrlEventsMouseDown;
FOnMouseUp:T_DiwMapViewCtrlEventsMouseUp;
FOnMouseMove:T_DiwMapViewCtrlEventsMouseMove;
FEventSink:TEventSink;
procedure EventSinkInvoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word;
Params: tagDISPPARAMS; VarResult, ExcepInfo, ArgErr: Pointer);
Public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
property OleServer:_DiwMapViewCtrl read FServer;
Published
property Align;
property Anchors;
property AutoSize;
property BorderSpacing;
property ChildSizing;
property ClientHeight;
property ClientWidth;
property Constraints;
property DockSite;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property UseDockManager default True;
property Visible;
property OnContextPopup;
property OnDockDrop;
property OnDockOver;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnGetSiteInfo;
property OnGetDockCaption;
property OnResize;
property OnStartDock;
property OnStartDrag;
property OnStatusText;
property OnUnDock;
property OnAfterAllLayerDraw : T_DiwMapViewCtrlEventsAfterAllLayerDraw read FOnAfterAllLayerDraw write FOnAfterAllLayerDraw;
property OnPopupMenu : T_DiwMapViewCtrlEventsPopupMenu read FOnPopupMenu write FOnPopupMenu;
property OnCustomMenuCommand : T_DiwMapViewCtrlEventsCustomMenuCommand read FOnCustomMenuCommand write FOnCustomMenuCommand;
property OnMapViewError : T_DiwMapViewCtrlEventsMapViewError read FOnMapViewError write FOnMapViewError;
property OnFireIdentifyResult : T_DiwMapViewCtrlEventsFireIdentifyResult read FOnFireIdentifyResult write FOnFireIdentifyResult;
property OnSetCursor : T_DiwMapViewCtrlEventsSetCursor read FOnSetCursor write FOnSetCursor;
property OnMeasureDistance : T_DiwMapViewCtrlEventsMeasureDistance read FOnMeasureDistance write FOnMeasureDistance;
property OnAfterUserDraw : T_DiwMapViewCtrlEventsAfterUserDraw read FOnAfterUserDraw write FOnAfterUserDraw;
property OnProgress : T_DiwMapViewCtrlEventsProgress read FOnProgress write FOnProgress;
property OnMouseDown : T_DiwMapViewCtrlEventsMouseDown read FOnMouseDown write FOnMouseDown;
property OnMouseUp : T_DiwMapViewCtrlEventsMouseUp read FOnMouseUp write FOnMouseUp;
property OnMouseMove : T_DiwMapViewCtrlEventsMouseMove read FOnMouseMove write FOnMouseMove;
property Active;
end;
implementation
uses comobj;
Class Function CoiwMapViewCtrl.Create: _DiwMapViewCtrl;
begin
Result := CreateComObject(CLASS_iwMapViewCtrl) as _DiwMapViewCtrl;
end;
Class Function CoiwMapViewCtrl.CreateRemote(const MachineName: string): _DiwMapViewCtrl;
begin
Result := CreateRemoteComObject(MachineName,CLASS_iwMapViewCtrl) as _DiwMapViewCtrl;
end;
constructor TAxciwMapViewCtrl.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FServer:=CoiwMapViewCtrl.Create;
ComServer:=FServer;
FEventSink:=TEventSink.Create(Self);
FEventSink.OnInvoke:=EventSinkInvoke;
FEventSink.Connect(FServer,_DiwMapViewCtrlEvents);
end;
destructor TAxciwMapViewCtrl.Destroy;
begin
FEventSink.Destroy;
inherited destroy;
end;
procedure TAxciwMapViewCtrl.EventSinkInvoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
VarResult, ExcepInfo, ArgErr: Pointer);
begin
case DispID of
1: if assigned(OnAfterAllLayerDraw) then
OnAfterAllLayerDraw(Self, OleVariant(Params.rgvarg[0]));
2: if assigned(OnPopupMenu) then
OnPopupMenu(Self, OleVariant(Params.rgvarg[0]));
3: if assigned(OnCustomMenuCommand) then
OnCustomMenuCommand(Self, OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
4: if assigned(OnMapViewError) then
OnMapViewError(Self, OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
5: if assigned(OnFireIdentifyResult) then
OnFireIdentifyResult(Self, OleVariant(Params.rgvarg[0]));
6: if assigned(OnSetCursor) then
OnSetCursor(Self);
7: if assigned(OnMeasureDistance) then
OnMeasureDistance(Self, OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
8: if assigned(OnAfterUserDraw) then
OnAfterUserDraw(Self, OleVariant(Params.rgvarg[0]));
9: if assigned(OnProgress) then
OnProgress(Self, OleVariant(Params.rgvarg[1]), Params.rgvarg[0].plVal^);
-605: if assigned(OnMouseDown) then
OnMouseDown(Self, OleVariant(Params.rgvarg[3]), OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
-607: if assigned(OnMouseUp) then
OnMouseUp(Self, OleVariant(Params.rgvarg[3]), OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
-606: if assigned(OnMouseMove) then
OnMouseMove(Self, OleVariant(Params.rgvarg[3]), OleVariant(Params.rgvarg[2]), OleVariant(Params.rgvarg[1]), OleVariant(Params.rgvarg[0]));
end;
end;
end.