Вы находитесь на странице: 1из 124

" 2011"

1991-2012
.
www.gisinfo.ru

2011 - ,
,
, ,
, 3D , ,
,
.
.
.
, .
- .
( ),
( ), ,
,
,
.

().
,
.
,
.

,
, ,
.
-
, ,
, ,
.

.
- ,
.
.
- 02/07/2012 .

1. .....................................................................................................................5
2. ................................................................................6
2.1. ..........................................................................................6
2.2. ..................................................................................................6
2.3. ..................................................................8
2.4. ..................................................................................................9
2.5. ......................................................................9
3. ..........11
3.1. ....................................11
3.2. ....................................11
3.3. .................................11
4. ...........................................................................12
4.1. "MAPAPI"....................................................................................12
4.1.1. ..........................................................................................................12
4.1.2. ..................................................................14
4.1.3. .................................................................15
4.1.4. ...............................................................15
4.1.5. .........................................16
4.1.6. .............................................16
4.2. "MAPAPI".............................................17
4.2.1. ...........................................................................................17
4.2.2. ....................................................................................18
4.2.3. ............................................................21
4.2.4. ........................................................................23
4.2.5. .....................................................................25
4.2.6. ........................................................27
4.2.7. ............................27
4.2.8. .....................................................................29
4.2.9. ............................................................................31
4.2.10. .........................................................................35
4.2.11. .......................36
4.2.12. ....................................37
4.2.13. ...............................................................38
4.2.14. () .......................................................40
4.2.15. .....................................................................................41
4.2.16. ...........................................................................................43
4.2.17. ................................................................44
4.2.18. .....................................................................45
4.2.19. ......................46
4.2.20. ............................................................48
4.2.21. IMLAPI.........50
4.2.22. .................................................................54
4.2.23. .....................................................56
4.2.24. ..................................................................60
4.2.25. 3D- ...........................................................................................62
4.2.26. ....................................................................................65
4.2.27. ( )................................................................71
4.2.28. ....................75
4.2.29. ..............................................................76
5. ..............................79
5.1. ..................................................................................79

5.2.
............................................80
5.2.1. ....................................................................................80
5.2.2. ....................................................................................81
5.2.3. ......................................................................................81
5.2.4. .................................................................................82
5.3. ..................................................85
5.3.1. ....................................................................................85
5.3.2. ......................................................................................88
5.3.3. ...........................................................................................89
5.3.4. .......................................................................93
5.3.5. .......................................................94
6. ..............................95
6.1. ..............................................................................................................95
6.2. PANAPI........................................................96
6.2.1. ..........................................................................................................96
6.2.2. ....................................................................97
6.2.3. ..........................................................................................100
6.2.4. .............................................................102
6.2.5. ................................................104
6.3. ....................................106
7. ...............................108
7.1. Visual C++.......................................108
7.2. Visual Basic.......................................108
7.3. Embedded Visual C++......................110
7.4. .NET Framework C#....................112
7.5. Windows Mobile #...........................115
7.6. PL/SQL ..........................................120
8. ...............................................123
8.1 ..........................................................................123
8.2. Windows.........................................123
8.3. Linux Solaris................................124

1.
,

,
,
,
: ,
, ,
,
.

() Windows XP, Windows Vista, Windows Mobile, Linux, Solaris
..
Windows
Windows (,
, ..)
OLE 2.0 lipboard,
,
.

(MDI) Drag and Drop,
.
,
Windows, WYSIWYG,

.
,
Windows,
.

,
,
( , ,
..) ,
Windows.

16 .
.

ODBC IDAPI
.
SQL-.

, ,
.
: ++, #, Delphi, Builder,
Microsoft Visual Studio, .

2.
2.1.

:
;
( );
;
TIN- ( ) MTD- ( ).
.
,
, ,
, , .
2.2.
2011 ,
SXF, DXF, MIF/MID, SHP/DBF, S57, MP, KML .
SXF
( - SXF). .
4.0.
SXF
:
(, , ,
);
( );
( ).
,
, .
,
.
.

,
, (,

).
, (,
) , , , ,
,
( ) .

() , .
65536 ,
255 65536 .
2000
, 20 300 .



2011, -
.
2011


.

.

( )
. . .

. . .

...........
..

..

, , .
, ,
.
:
( , *.DAT),
( , *.SEM),
( ,
*.HDR).
- (*.MAP),
.
, ,
(
, *.RSC).
,

.
2011.

:
( );
;
() ;
;

.
2011 ,
, ,
.
,
.
2.3.

, ,
.
, , ,
.

, .
:
, ,
, ;
, ,
;

.
2011
, .
,
.
.
, .

.
.
,
.

.
,
.
SXF
.

.
, DXF, MIF/MID ..
.
.
:
( , *.SDA),
( , *.SSE),
( , *.SHD),
( , *.SGR).
- (*.SIT).

, ,
(
, *.RSC).
2.4.
2011 , RSW.
(PCX, BMP, TIFF )
RSW
2011.
:
( ,
);
;
.
:

1/1

1/M

x x

N/1

N/M

x x

N - ,
M - p .


.

,
,
.
2.5.
2011 ,
MTW.
MTW SXF


.
:
;
.
:

1/1

1/M

10

x x

N/1

N/M

x x

N - ,
M - p .
:
,
.

2011.
.
2011
, .
,
.

11

3.

3.1.

:
()
;
,
..;
, , ,
;
,
, , , ..;
, ,
..;
;
.
3.2.

:
() ;
;
;

.
3.3.

:
() ;
;
,
, ;
, ,
.

12

4.
2011 Windows
. .
:
;
;
.
Panorama.exe.
( )
.

.
.
"MAPAPI".
(, ,
, ,
)
(DLL, SO).




.
4.1. "MAPAPI"
4.1.1.
MAPAPI :
(
mapapi.h);

(sitapi.h);
(seekapi.h);
(rscapi.h);
RSC
(maprscex.h);
(logapi.h);
(alsapi.h);
GPS\ (gpsapi.h);
() (netapi.h);
\ SXF, TXF, DIR,
(vecexapi.h);
(trianapi.h);
DXF (gisdxf.h);
(listapi.h; medapi.h, objapi.h, prnapi.h);
(mathapi.h);

(mapapi.h, mapscren.h);
DBF (semdbase.h);

WMF (mapsupp.h);
S57 (s57tomap.h);
(mtrapi.h);

13

(mtrexapi.h);
(map3dapi.h);
(mtlapi.h);
(rstapi.h);
\ PCX, TIFF, JPEG, BMP
(mappicex.h, picextrs.h);
\ PCX, TIFF,
JPEG, BMP (pictrapi.h).
(*.h)
:
maptype.h
- ;
mapmacro.h - ;
mapsyst.h
- ,
;
mapcreat.h - , ;
mapgdi.h
- ;
mapvecex.h -
(GISVECEX.DLL);
mappicex.h -
(GISPICEX.DLL).

Delphi, C++, C#, Visual Basic, PL\SQL .
Borland Delphi, Builder ActiveX.

2011 ...\SDK\INCLUDE\*.h.
MAPAPI
(APILIST.DOC).

.
( , ).

mapGetLastError(). maperr.rh.
++ (Visual C++, Builder C++ )
,
MAPAPI.H,
:
#ifndef MAPAPI_H
#include mapapi.h
#endif
++,
GISACCES.DLL Windows, :
HINSTANCE libinst = ::LoadLibrary("mapacces.dll");
HMAP (WINAPI * lpmapfn)(const char *, int);
(FARPROC&) lpmapfn = ::GetProcAddress(libinst,"mapOpenData");
HMAP hmap = (*lpmapfn)("Noginsk.map",0);
if (hmap != 0)
{
//
...
}

14

::FreeLibrary(libinst);
4.1.2.

:
;
;
;
;
.
.

. .
HMAP.
mapOpen Data(...).
mapPaint95,
(HDC)
(RECT).
, ,
, mapPaint.

mapView,
(HWND).
mapSeek
mapWhat.
(HSELECT). HSELECT
mapCreateMapSelectContext mapCreateCopySelectContext.
mapSelect.
HOBJ.
mapCreateObject
mapCreateCopyObject.

mapAppend, mapUpdate, mapInsert, mapDelete ,
HOBJ.
mapCommit.
, , , ,
mapGet.
(
) ( ) ( )
. mapPlaneToGeo, mapPlaneToPicture,
mapGeoToPlane .

.
,
, , .
.

mapOpenSiteForMap.
HMAP. HSITE.
HOBJ
mapCreateSiteObject. HMAP HSITE.

15

HSELECT

mapCreateSiteSelectContext.
, Site, HMAP
HSITE , .
HSITE HMAP,
.
. MAPAPI
(APILIST.DOC).
4.1.3.
,
, ,
(, ..)
.

mapOpenRst, HMAP.

, ,
mapOpenRstForMap,
HMAP.
,
, ,
, ,
.
,
.
RSTAPI.H.
MAPACCES.DLL (.
MAPAPI, APILIST.DOC).
BMP, PCX, TIFF RSW
MAPPICEX.H, MAPPICEX.DLL.
4.2.
4.1.4.

.

mapOpenMtr, HMAP.

, ,
mapOpenMtrForMap,
HMAP.

.
mapBuildMtw
.
(mapSetMtrView).
,
mapSetMtrPalette.
3D -
mapOpenMtr3D, mapPaintMtr3D, mapCloseMtr3D.

16


( ) mapGetHeigtValue
mapGetPrecisionValue..

mapGetHeightArray.
, ,
.

.
MAPAPI
(APILIST.DOC).
4.1.5.

, , ,
.
,
,
( ,
, , ).
,
HMAP HSITE HRSC.

MAPAPI (APILIST.DOC).
4.1.6.
, MAPAPI,
(Windows, Linux, QNX, OC PB, Solaris
..).
API ANSI Windows
KO 8 UNIX .
HWND HDC Windows
. , X
Window, HWND HDC long int,
XCONTEXT.
typedef struct XCONTEXT
{
Display
xcDisplay;
Window
xcWindow;
GC
xcContext;
DRAWPOINT xcPoint;

//
//
//
//
//

-


:
,

}
XCONTEXT;
, mapPaint95(HMAP, HDC, long int, RECT
*) , Windows, Linux.
. Windows
SetViewportOrg, .
XWindow
xcPoint XCONTEXT Paint.

17

, True Type
, Windows
(mapGetMapFont, mapSetMapFont ..).
mapPaintToDib, mapPaintToEmf . . - Windows.
, XWindow, mapPaintToXImage.
( 2000) .
4.2. "MAPAPI"
4.2.1.
-
( ).
,
.

HMAP. (), , .
:
//
HMAP hMap = mapOpenData(C:\Panorama10\Data\Podolsk\Podolsk.map, 0);
//
mapAppendData(hMap, C:\Panorama10\Data\Podolsk\Podolsk.rsw, 0);
//
mapAppendData(hMap, C:\Panorama10\Data\Podolsk\Podolsk.mtw, 0);
//
mapAppendData(hMap, C:\Panorama10\Data\Podolsk\Podolsk.mtq, 0);
//
const char * name = mapGetMainName(hMap);
// INI-
const char * ininame = mapGetMapIniName(hMap);
//
mapCloseData(hMap);
hMap = 0;
(
, , ) mapOpenData.
UNICODE, mapOpenDataUn.

MAP ( ) SIT
( ).
MTW MTR.
MTQ.
MTL. RSW.
TIN- TIN, MTD.

.
.

18


( , , )
mapAppendData mapAppendDataUn ( UNICODE).

mapGetMainName.
INI-,
. INI-
mapGetMapIniName.

mapCloseData.
,
(mapOpenData).
. "ALIAS#__".
"ALIAS#" -. .
4.2.25.
. ,
mapOpenData mapAppendData.
- 10 .
HMAP
(). -
10 ( 10
HMAP ).
- .
//
HMAP hMap = mapOpenData(C:\Panorama10\Data\Podolsk\Podolsk.map,
GENERIC_READ);
,
.
,
- mapSetSiteEditFlag:
//
mapSetSiteEditFlag(hMap, hMap, 0);
,
mapCloseData,
.
,
.
mapSetStructureControlFlag:
//
mapSetStructureControlFlag(0);
4.2.2.
MAPREGISTEREX
LISTREGISTER mapCreateMapEx.
MAPREGISTEREX mapreg;
LISTREGISTER
listreg;
memcpy((void*)&mapreg, 0, sizeof(mapreg));
memcpy((void*)&listreg, 0, sizeof(listreg));

19

mapreg.Length = sizeiof(MAPREGISTEREX);
listreg.Length = sizeof(LISTREGISTER);
// 95
mapRegisterFromMapType(CK_95, mapreg);
// (-2), DOUBLE
// -3, -1
// FLOAT 20000 ( )
mapreg.DeviceCapability = -2;
// 1 : 100 000
mapreg.Scale = 100000;
// ( )
strcpy(mapreg.Name, );
// ( )
strcpy(listreg. ListName, M-36-001);
//
//
strcpy(listreg.Nomenclature, 0.M-36-001);
// 95 - M36001
mapSetFileNameFromNomenclature(listreg.FileName, sizeof(listreg.FileName),
listreg.Nomenclature);
//
//
// hMap
mapCalcTopographicSheet(0, (MAPREGISTER*)&mapreg, &listreg);
//
mapreg.DataProjection = 1;
// Topo100t.rsc
HMAP hMap = mapCreateMapEx(C:\Panorama10\Data\MyMap.map,
Topo100t.rsc,
&mapreg, &listreg);
95 (42)
.
.
MAPREGISTEREX mapreg;
LISTREGISTER
listreg;
memcpy((void*)&mapreg, 0, sizeof(mapreg));
memcpy((void*)&listreg, 0, sizeof(listreg));
mapreg.Length = sizeiof(MAPREGISTEREX);
listreg.Length = sizeof(LISTREGISTER);
// UTM WGS84

20

mapRegisterFromMapType(UTMWGS84, mapreg);
// (-2), DOUBLE
// -3, -1
// FLOAT 20000 ( )
mapreg.DeviceCapability = -2;
// 1 : 100 000
mapreg.Scale = 100000;
// ( )
strcpy(mapreg.Name, );
// ( )
strcpy(listreg. ListName, 001);
//
strcpy(listreg.Nomenclature, UTM 36-64);
//
double degreetoradian = 3.14159265358979323846 / 180.0;
//
mapreg.AxisMeridian = 36 * degreetoradian;
//
listreg.BSouthWestCoordinate = 36 * degreetoradian; // B -
listreg.LSouthWestCoordinate = 64 * degreetoradian; // L -
listreg.BNorthWestCoordinate = 37 * degreetoradian; // B -
listreg.LNorthWestCoordinate = 64 * degreetoradian; // L -
listreg.BNorthEastCoordinate = 37 * degreetoradian; // B -
listreg.LNorthEastCoordinate = 65 * degreetoradian; // L -
listreg.BSouthEastCoordinate = 36 * degreetoradian; // B -
listreg.LSouthEastCoordinate = 65 * degreetoradian; // L -
//
mapCheckAndUpdate(&mapreg, &listreg, 0);
//
mapreg.DataProjection = 1;
// Topo100t.rsc
HMAP hMap = mapCreateMapEx(C:\Panorama10\Data\MyWGSMap.map,
Topo100t.rsc,
&mapreg, &listreg);

CREATEPLANE mapCreatePlane.
CREATEPLANE createplane;
memset((void*)& createplane, 0, sizeof(createplane));
createplane.Length = sizeof(createplane);
//
strcpy(createplane.MapName, );

21

// 1 : 5 000
createplane.Scale = 5000;
createplane.List.Length = sizeof(APPENDPLANELIST);
strcpy(createplane.List.Nomenclature, 11-21);
strcpy(createplane.List.ListName, 11-21);
strcpy(createplane.List.FileName, 11-21);
//
XSouthWest = 10000; // X -
YSouthWest = 15000; // Y -
XNorthWest = 12500; // X -
YNorthWest = 15000; // Y -
XNorthEast = 12500; // X -
YNorthEast = 17500; // Y -
XSouthEast = 10000; // X -
YSouthEast = 17500; // Y -
//
HMAP hMap = mapCreatePlane(C:\Data\MyTown.map,
map5000.rsc,
&createplane);
4.2.3.
, ,
.
mapOpenData, mapAppendData
mapOpenSiteForMap. mapAppendData

mapOpenSiteForMap.
//
HSITE hSite = mapOpenSiteForMap(hMap, C:\Panorama10\Data\Podolsk\user.sit,0);
//
mapSetSiteEditFlag(hMap, hSite, 0);

, .

.
(mapMessageEnable),
. ,
.
.
mapCreateSiteEx mapCreateAndAppendSite.
//
CREATESITEEX createsite;
//
memset((void*)& createsite, 0, sizeof(createsite));
//

22

createsite.Length = sizeof(createsite);
// (!)
strcpy(createsite.MapName, My map user5);
// ( - WGS84)
// , ,
//
createsite.MapType = SEANAUTIC;
// 1:10 000
createsite.Scale = 10000;
//
HMAP hMap5 = mapCreateSiteEx(C:\Panorama10\Data\Podolsk\user5.sit
C:\Panorama10\Data\Podolsk\road10.rsc,
&createsite);
// mapCreateAndAppendSite
// CREATESITE
createsite.Length = sizeof(CREATESITE);
// (!)
strcpy(createsite.MapName, My map user7);
//

//
mapCreateAndAppendSite(hMap,
C:\Panorama10\Data\Podolsk\user7.sit,
C:\Panorama10\Data\Podolsk\road10.rsc,
(CREATESITE *)&createsite);
:
, , ,
..

mapCreateTempSite mapCreateAndAppendTempSite.
//
HMAP temp = mapCreateTempSite(C:\Panorama10\Data\Podolsk\road25.rsc);

//
mapCloseData(temp);
WGS84
.
.
//
//
HSITE tempsite =
mapCreateAndAppendTempSite(hMap, C:\Panorama10\Data\Podolsk\road25.rsc);

23

//
mapCloseSiteForMap(hMap, tempsite);
.
1 : 100 000.

.
mapSetSiteScale:
// 1 : 25 000
mapSetSiteScale(hMap, tempsite, 25000);

,
.
4.2.4.

mapSetViewScale mapChangeViewScale.

. ,
. mapChangeViewScale
. (
) 1 - ,
. 0 1 - ,
.
,
.

mapPaint mapPaint95.
mapPaint
.
Windows GDI
"SetViewportOrg" .
"Client" ( "Picture").
, Windows 95 16 .

. , mapPaint
Windows NT.
Windows
mapPaint95. , mapPaint,
.
SetViewportOrg, "Draw"
"Client" (. 4.1.). ,
(0,0),

"Client".
16 ( 32766).

:
//
void __fastcall TMDIChild::FormPaint(TObject *Sender)
{

24

//
TRect rect = Canvas->ClipRect;
LONGPOINT point;
point.X = HorzScrollBar->Position;
point.Y = VertScrollBar->Position;
HDC hdc = Canvas->Handle;
try
{
::SetViewportOrgEx(hdc, rect.left, rect.top, NULL);
rect.left += point->X;
rect.right += point->X;
rect.top += point->Y;
rect.bottom += point->Y;
mapPaint95(hMap, hdc, erase, &rect);
::SetViewportOrgEx(hdc, 0, 0, NULL);
}
catch(...)
{
//
HOBJ hobj = mapCreateObject(hMap);
if (hobj)
{
if (mapReadLastViewObject(hMap, hobj) != 0)
{
char title[260];
const char * listname = mapListName(hobj);
int key = mapObjectKey(hobj);
char keyname[32];
mapObjectKeyToString(key , keyname, sizeof(keyname), 0);
sprintf(title, "C - %s - %s",
keyname, listname);
}
mapFreeObject(hobj);
}
}
mapPaint95
mapPaintUserObject95 ..
,
, .
4.1.

Xm
(0,0)

( "Picture")
X

( "Client")
(0,0)

25

+......+
......
......
......
+
+

(Region)


(Draw)
Yo
Y
Ym
(0,0) "Plane"

mapView.
HWND.
point place. point
, place -
( , ,
..).
DOUBLEPOINT point;
point.X = HorzScrollBar->Position;
point.Y = VertScrollBar->Position;
int place = PP_PICTURE;
mapView(hMap, hwnd, erase, point, place);
4.2.5.
, ,
.
.

.

MAPREGISTEREX, DATUM ELLIPSOIDPARAM.
,
-90.02 :
MAPREGISTEREX mapreg;
memset((void*)&mapreg, 0, sizeof(mapreg));
mapreg.Length = sizeof(mapreg);
mapRegisterFromMapType(GEOGRAPHIC, &mapreg);
mapreg.EllipsoideKind = SGS_85;
mapreg.MaterialProjection = LAMBERTOBLIQUEAZIMUTHAL;
mapreg.AxisMeridian = 38.0 * M_PI / 180.0;
// 38
mapreg.MainPointParallel = 55.5 * M_PI / 180.0; // 55.5

26

DATUM datum;
datum.DX = DX_SGS85_WGS84;
datum.DY = DY_SGS85_WGS84;
datum.DZ = DZ_SGS85_WGS84;
datum.RX = RX_SGS85_WGS84;
datum.RY = RY_SGS85_WGS84;
datum.RZ = RZ_SGS85_WGS84;
datum.M = SGS85_WGS84;
datum.Count = 7;
ELLIPSOIDPARAM ellparm;
mapGetEllipsoidParameters(SGS_85, &ellparm);
mapSetDocProjection(hMap, &mapreg, &datum, &ellparm);
. ,
,
.
.
.
,
, EPSG:20007 (-95, 7).
MAPREGISTEREX mapreg;
mapGetParametersForEPSG(20007, &mapreg, &datum, &ellparam);
mapSetDocProjection(hMap, &mapreg, &datum, &ellparm);

:
double X = mapXPlane(hObj,i,j);
double Y = mapYPlane(hObj,i,j);
double H = mapHplane(hObj,i,j);
X,Y,H EPSG:20007.
. , ,
EPSG:20007.
+\- 15 .
.
,
, .
,
-90.02 (EPSG:4923).
MAPREGISTEREX mapreg;
memset((void*)&mapreg, 0, sizeof(mapreg));
mapreg.Length = sizeof(mapreg);
mapRegisterFromMapType(LATITUDELONGITUDE, &mapreg);
mapreg.EllipsoideKind = SGS_85;
HANDLE husersys = mapCreateUserSystemParameters(&mapreg, 0, 0);
// WGS-84

27

mapGeoToGeoWGS843D(hMap, &b, &l, &h);


// WGS-84
mapGeoWGS84ToUserGeo3D(husersys, &b, &l, &h);
mapDeleteUserSystemParameters(husersys);
4.2.6.

(, ),
.

mapSetupTurn (MAPAPI.H).
, ( ) ( ).

. , ,
5 ( 10
) :
// 45
// ( - 45 )
mapSetupTurn(hMap, M_PI/4, M_PI/18);
...
// 50
// ( - 45 )
mapSetupTurn(hMap, M_PI/4+M_PI/36, M_PI/18);
...
// 55
// ( - 55 )
mapSetupTurn(hMap, M_PI/4+M_PI/18, M_PI/18);
0
:
// 45
// ( - 45 )
mapSetupTurn(hMap, M_PI/4, 0);
...
// 50
// ( - 50 )
mapSetupTurn(hMap, M_PI/4+M_PI/36, 0);
mapSetupTurn
. mapSetupTurn
.
mapGetTurnAngle.
,
, .
()
mapGetPictureHeight mapGetPictureWidth mapGetPictureSize.
4.2.7.

, .

( "RSC") ,
.

28

,
("RSC"), mapPaintObject. ,
, , .
( )
,
.
mapPaintObject -
, (, ..) .

, , ..

mapPaintUserObject.

(double) (
-"PLANE", -"GEO", - "PICTURE", -"MAP").
PLACEDATA.
MAPGDI.H.
place.
" " .
(, , , )
(, , ,
..).
, mapPaintUserObject,
PAINTPARM. MAPGDI.H.
Image (,
IMG_LINE - ). Parm
( IMG_LINE - IMGLINE). Mode
, Windows GDI SetROP2(...)
(, R2_NOT, R2_XOR ..).
, (, IMGLINE ), ,
, COLORREF, ,
(, , ..), .
(, )
.

PIX2MKM(...).
, ,
:
PAINTPARM Form;
IMGDOT Image;
PLACEDATA Place;

//
//
// (double)

Form.Image = IMG_DOT;
Form.Parm = (char *)&Image;
Form.Mode = R2_XORPEN;

// . MAPGDI.H

Image.Color = RGB(255,255,255);
Image.Thick = PIX2MKM(2); // 2
Image.Dash = PIX2MKM(7); // 7
Image.Blank = PIX2MKM(3); // 3
//
long PointCount = 10;
//
DOUBLEPOINT * Points = new DOUBLEPOINT[PointCount];

29

Points[0].x = 12345.678; //
Points[0].y = 90123.456;
...
Place.Count
= 1;
//
Place.PolyCounts = &PointCount; // ( )
Place.Points = Points;
...
// ,
mapPaintUserObject95(hMap,hdc,false,rect,&Form,&Place,PP_PLANE);
mapPaintUserObject
Windows GDI SetViewportOrg, , mapPaint.
,
32766, Windows 95,
mapPaint95 mapPaintUserObject95.
SetViewportOrg "Draw"
"Client".

mapViewUserObject.
HWND.
point place.
point ,
.
place PP_PICTURE.

Windows GDI.
(, ) ()
,
MAPAPI.H.
4.2.8.
.
.
,
.
.
.
.
//
long int WINAPI CheckBreakPaint(void * parm)
{
if (parm == 0) return 0;
//
TMapWindow * mapwin = (TMapWindow*)parm;
return mapwin->CheckBreak();
}
//
int TMapWindow::CheckBreak()
{
MSG message;

30

if (IsPainting == 0) return 0;
if (::PeekMessage(&message,GetHandle(), WM_KEYDOWN, WM_KEYDOWN,
PM_NOREMOVE) != 0)
{
if ((message.wParam == 187) ||
//
(message.wParam == 188) ||
(message.wParam == 190) ||
(message.wParam == VK_TAB) || //
(message.wParam == VK_PRIOR) ||
(message.wParam == VK_NEXT) ||
(message.wParam == VK_HOME) ||
(message.wParam == VK_END))
{
// PostMessage c
//
Invalidate();
IsPainting = 0;
return 1; //
}
if ((message.wParam == VK_ESCAPE) ||
(message.wParam == VK_F10))
{
IsPainting = 0;
return 1; //
}
}
return 0;
}
//
int TMapWindow::OnPaint(HDC hdc, int erase, RECT& rect)
{

IsPainting = 1;
//
//
//
mapSetBreakCallAndParm(hMap, CheckBreakPaint, this);
//
mapPaint95(hMap, hdc, erase, &rect);
//
mapSetBreakCallAndParm(hMap, 0, 0);
IsPainting = 0;

}

mapSetBreakCallAndParm.
(

31

),
:
//
TMapWindow * mapwin = (TMapWindow*)parm;
return mapwin->CheckBreak();

.
,
,
.
4.2.9.
, , .

.
MAPAPI
.

. ,
.

, ( )
.
.
( BitBlt
Windows XPutImage Linux), .
.

,
. C#.
HIMAGE hImage = 0;
public Form1()
{

hImage = mapCreateImage(Handle);
IsUpdateImage = 1;
}

// HWND

private void Form1_FormClosing(object sender, FormClosingEventArgs e)


{

mapCloseImage(hImage);
hImage = 0;
}
mapCreateImage mapCreateImageEx
() .
:
private void Form1_Resize(object sender, EventArgs e)

32

{
mapChangeImageSize(hImage);

// -
IsUpdateImage = 1;
Invalidate();
}
,
. .
, ,
. ( ) ( )
mapClearImageObjects.
,
mapViewImageEx.
private void Form1_Paint(object sender, PaintEventArgs e)
{

if (IsUpdateImage != 0)
{

//
mapDrawImageMapEx(hImage, hMap, ref MapRect, 0, 0);
IsUpdateImage = 0;
//
ViewObject(0);
}
//
MapRect.top = 0;
MapRect.bottom = ClientRectangle.Height;
MapRect.left = 0;
MapRect.right = ClientRectangle.Width;
mapViewImageEx(hImage, Handle, ref MapRect); // mapViewImage HDC
}
:
private void viewDownMenuItem_Click(object sender, EventArgs e)
{

int x = 0;
int y = 0;
mapChangeViewScale(hMap, ref x, ref y, 0.5);
AdjustScroll();
}
private void AdjustScroll()
{

ViewSize.Width = mapGetPictureWidth(hMap);
ViewSize.Height = mapGetPictureHeight(hMap);

33

IsUpdateImage = 1;
Invalidate();

}
:
private void Scroll(int dx, int dy)
{

//
mapScrollImage(hImage, dx, dy);
RECT MapRect = new RECT();
Point point = new Point();
point.X = 0;
point.Y = 0;
//
if ((dy != 0) && (IsUpdateImage == 0))
{
if (dy > 0)
{
int pos = ClientRectangle.Height - dy;
if (pos > 0)
{
point.Y = pos;
MapRect.top = ScrollPosition.Y + pos;
MapRect.bottom = MapRect.top + dy;
}
else
{
//
IsUpdateImage = 1;
}
}
else
{
MapRect.top = ScrollPosition.Y;
MapRect.bottom = MapRect.top - dy;
}
if (IsUpdateImage == 0)
{
MapRect.left = ScrollPosition.X;
MapRect.right = MapRect.left + ClientRectangle.Width;
//
mapDrawImageMap(hImage, hMap, ref MapRect, ref point);
}
}
point.X = 0;
point.Y = 0;
if ((dx != 0) && (IsUpdateImage == 0))
{
if (dx > 0)

34

{
int pos = ClientRectangle.Width - dx;
if (pos > 0)
{
point.X = pos;
MapRect.left = ScrollPosition.X + pos;
MapRect.right = MapRect.left + dx;
}
else
{
//
IsUpdateImage = 1;
}
}
else
{
MapRect.left = ScrollPosition.X;
MapRect.right = MapRect.left - dx;
}
if (IsUpdateImage == 0)
{
MapRect.top = ScrollPosition.Y;
MapRect.bottom = MapRect.top + ClientRectangle.Height;
//
mapDrawImageMap(hImage, hMap, ref MapRect, ref point);
}
}
}

:
// (0)
// (1)
public void ViewObject(int update)
{

// ,
// ,
//
mapClearImageObjects(hImage, 0);
//
// -
mapDrawImageMapObject(hImage, hMap, 0, hObj);

if (update != 0)
Invalidate(false);
}
mapClearImageObjects .

.
Windows GDI.
:

35

HDC hdc = mapGetImageObjectDC(hImage);



, MAPGDI.H.
mapDrawImageGraphics. mapDrawImageText.
BMP ( )
mapDrawImageBitMap.
4.2.10.
,
() . ,
,
.

, SEEKAPI.H.

mapCreateMapSelectContext. ,
. , ,
, ,
. , ,
.
, , 5
:
//
mapSelectLayer(hSelect,-1,0);
// 5
mapSelectLayer(hSelect,5,1);

:
//
mapSelectObject(hSelect, -1, 0);
//
int code = mapGetRscObjectCodeByNumber(hRsc, 71111110, LOCAL_SQUARE, 1);
// code
mapSelectObject(hSelect, code, 1);

:
// ( 9),

mapSelectSemanticAppend(hSelect, CMEQUAL, 9, "*");


mapSelectSeekArea.
,
mapClearSample,
mapSelectSample, mapUnselectSample.

36

,
. mapCreateObject
(MAPAPI.H).
:
HOBJ hObj = mapCreateObject(hMap,1,IDFLOAT2,0);

mapSeekSelectObject mapSeekSiteSelectObject ( ).
,
mapWhatObjectBySelect.
, ,
mapDeleteSelectContext.

mapFreeObject (MAPAPI.H).

mapSetSiteSeekSelect (SITAPI.H).
mapTotalSeekObject.
, ,
, SELAPI.H.
selSetFilterTitle ,
. ,
, .
selSetObjectSearch
. mapTotalSeekObject.

mapReadObjectByNumber (SEEKAPI.H).
4.2.11.


, .

(HSELECT).
:
HSELECT hSelect = mapCreateSiteSelectContext(hMap, hSite);

.
,
:
//
mapGetSiteViewSelect(hMap, hSite, hSelect);
(
)
:
//
mapSelectObject(hSelect, -1, 0);
//
int code = mapObjectCode(hObj);

37

//
mapSelectObject(hSelect, code, 1);

. (
):
//
mapClearSample(hSelect);
, :
// 1
mapSetSampleAllObjects(hSelect, 1);
// 1- ( 1 )
// key
mapSelectSampleByList(hSelect, 1, key);
long key2 = mapObjectKey(hObj);
// key2
mapUnselectSampleByList(hSelect, 1, key2);
// :
mapSetSiteViewSelect(hMap, hSite, hSelect);
,
:
mapDeleteSelectContext(hSelect);

.
4.2.12.

(
), .
, LOCAL_LINE
LOCAL_SQUARE.
:

HOBJ (
), .
, ;

HOBJ,
;

HCROSS;

HOBJ,
;

.
.
, .
//

38

// info1 - ( )
// info2 - ,
//

// method - ( - LOCAL_LINE
//
- LOCAL_SQUARE)
// precision - ( ),
//
.
HCROSS hCross = mapCreateObjectsCross(info1,info2,method,precision)
if (hCross)
{
//
// hCross - .
// info - ,
//
.
// 0 :
//
// ,
//
// .
while(mapGetNextCross(hCross,info))
{
// info - " "
...
}
// .
mapFreeObjectsCross(hCross);
}

( ). ,
LOCAL_LINE LOCAL_SQUARE.
:

HOBJ;

HOBJ;

HOBJ;

:
HOBJ hObj = mapGetObjectsUnion(info1,info2,info, method, precision);
:

info1 -

info2 -

info -

method - ( - LOCAL_LINE

- LOCAL_SQUARE)

precision - ( ),
.
0,
.
4.2.13.
, LOCAL_LINE
LOCAL_SQUARE.
:

HOBJ;

39

HOBJ;

HCROSS;

CROSSPOINT,

. CROSSPOINT
maptype.h;

.
.
, .
//
// info1 -
// info2 -
HCROSS hCross = mapCreateObjectCrossPoints(info1,info2);
if (hCross)
{
//
CROSSPOINT point;
// .
int count = mapGetCrossCount(hCross);
for(int i = 1; i <= count; i++)
{
// i .
memset((char *)&point, 0, sizeof(CROSSPOINT));
if (mapGetCrossPoint(hCross,i,&point))
{
// point
//
...
}
}
// .
mapFreeCrossPoints(hCross);
}
,
.
HCROSS hCross = mapCreateObjectCrossPoints(info1,info2);
if (hCross)
{
//
mapFreeCrossPoints(hCross);
}
.

.
.
, .
//
// info1 -
// info2 -
// subject1 - info1

40

// subject2 - info2
HCROSS hCross = mapCreateSubjectCrossPoints(info1,info2,
subject1, subject2);
if (hCross)
{
//
CROSSPOINT point;
// .
int count = mapGetCrossCount(hCross);
for(int i = 1; i <= count; i++)
{
// i .
memset((char *)&point, 0, sizeof(CROSSPOINT));
if (mapGetCrossPoint(hCross,i,&point))
{
// point
//
...
}
}
// .
mapFreeCrossPoints(hCross);
}

:
int mapInsertPointCross(HOBJ info1, HOBJ info2);
0,
.

:
int mapCheckInsideObject(HOBJ info1, HOBJ info2);
:
1 - ,
2 - ,
3 - ,
4 - .
4.2.14. ()

( ) (..
),
.
- ,
( ) , , .
.
:

HOBJ (
), ;

HOBJ,
;

HCROSS;

HOBJ,
;

41

;
.
.
, .
//
// info1 - ( )
// info2 - ,
//

// method - ( - LOCAL_LINE
//
- LOCAL_SQUARE)
// precision - ( ),
//
.
HCROSS hCross = mapCreateObjectsConsent(info1,info2,method,precision)
if (hCross)
{
//
// hCross - .
// info - ,
//
.
// 0 :
// -
// .
while(mapGetNextConsent(hCross,info))
{
// info - " "
...
}
// .
mapFreeObjectsConsent(hCross);
}

4.2.15.
,
, HOBJ.
4 800 ,
.

( long int, DWORD).

(WORD/WORD), : 256/1927.

. (long int
DWORD), .

,
. , ,
- ..
:
ofstream out("maplog.txt");
HOBJ hObj = mapCreateObject(hMap,1,0,0);
if (mapSeekObject(hMap, hObj, hSelect, WO_FIRST))
{

42

out << "\n :" << mapObjectName(hObj);


out << "\n :" << mapObjectExcode(hObj);
out << "\n :" << mapObjectKey(hObj);
out << "\n :" << mapSegmentName(hObj);
out << "\n :" << mapSegmentNumber(hObj);
out << "\n :" << mapListName(hObj);
out << "\n :" << mapObjectLocal(hObj);
}
mapFreeObject(hObj);
, Name,
ANSI ,
( RSC).
().
. :
X, Y, H. X , Y , - .
(, -,
, ..),
.

:
for (int j=0; j < mapPolyCount(hObj); j++)
for (i=1; i <= mapPointCount(hObj,j); i++)
{
double X = mapXPlane(hObj,i,j);
double Y = mapYPlane(hObj,i,j);
double H = mapHplane(hObj,i,j);
}

- , ,
..

( ).
- ( ).
out << "\n :" << mapSquare(hObj);
out << "\n :" << mapPerimeter(hObj);
out << "\n :" << mapLength(hObj);
out << "\n 1- : " << mapSideLength(hObj, 1, 0);
out << "\n 2- :" << mapSideDirection(hObj, 2, 0);

(double). .

.
.
:
for (i=1; i <= mapSemanticAmount(hObj); i++)
{
out << "\n :" << mapSemanticName(hObj, i);
char String [256];
mapSemanticValueName(hObj, i, String, sizeof(String));
out << "\n :" << String;
}

43

mapSemanticValueName
mapSemanticValueFullName.
. , "205,5 ". ,
.
,

mapGetRscSegmentNameSize, mapGetRscLocalNameSize (.RSCAPI.H) ..


, 32 ( '\0').
256 .
4.2.16.

() ().
MAPAPI.H.
mapCreateObject(hMap,
kind, text). kind .
, IDDOUBLE2 - c , ; IDDOUBLE3 - c
, . ,
.
, () .
, (X,Y)
(X,Y,H).

()
,

ERRORHEIGHT (-111111.0).
text .
"", text . , ,
.., text .
.

mapAppendPointPlane,

mapInsertPointPlane.

mapUpdatePointPlane. mapDeletePointPlane .

.
,
.
"",
mapPutText. ,
.
.
.
, (,
..).
.
(4.1.2.6.).
mapRegisterObject mapDescribeObject.
mapRegisterObject(excode, local)
.
(, 31120000 - ) (, LOCAL_SQUARE).

,
.
mapDescribeObject(incode) ,
. incode
. mapDescribeObject

44


.

mapAppendSemantic (code, value, size). (value)
.
. , 4 - " ",
.
, .

mapDeleteSemantic(number).

mapSetSemanticValue mapSetSemanticCode.
- mapDeleteSemantic
mapAppendSemantic.
mapCommitWithPlace ( ) mapCommitObject,
mapRevertObject.
:
HOBJ hObj = mapCreateObject(hMap, IDDOUBLE2, 1, 0);
mapAppendSemantic(hObj, 4, "210.5");
mapAppendSemantic(hObj, 33, "100");
mapRegisterObject(hObj, 31120000, LOCAL_SQUARE);
mapAppendPointPlane(hObj, 21736.52, 34567.93);
...
mapAppendPointPlane(hObj, 98765.1, 23456.0);
mapCommitWithPlace(hObj);
mapFreeObject(hObj);
"" c 210.5 , (33)
- (100). .
(, 31120000 ),
mapRegisterObject.

(, medChoiceTypeObject),

mapDescribeObject.
:
HOBJ hObj = mapCreateObject(hMap, IDDOUBLE2, 1, 0);
int code = medChoiceTypeObject(hMap, &TaskParm, hObj);
mapDescribeObject(hObj, code);
mapAppendSemantic(hObj, 4, "210.5");
mapAppendSemantic(hObj, 33, "100");
mapAppendPointPlane(hObj, 21736.52, 34567.93);

4.2.17.
,
.
. .
:
//
HOBJ hObj = mapCreateSiteObject(hMap, hSite, IDDOUBLE2, 1, 0);
// 5

45

mapRegisterDrawObject(hObj, 5, LOCAL_LINE);
// ( , )
mapAppendSemantic(hObj, 9, " ");
//
IMGLINE parm;
// (. mapgdi.h)
parm.Thick = PIX2MKM(2);
// 2
parm.Color = RGB(250,0,0);
// RGB
// ( ,
// )
mapAppendDraw(hObj, IMG_LINE, (char*)parm);
//
mapAppendPointPlane(hObj, 26425.2, 76390.5);

mapCommitWithPlace(hObj);
mapFreeObject(hObj);
,
mapRegisterDrawObject
mapAppendDraw, .
.
4.2.18.
.
. ,
. ,
.

.
, -
mapSetChangeCallAndParm.
//
long int WINAPI PrepareEvent(void * parm, void * value)
{
TMyControl * control = (TMyControl *)parm;
if (parm != 0)
return control->PrepareEvent((CHANGEINFO *)value);
return 0;
}
//
int TMyControl::PrepareEvent(CHANGEINFO * value)
{
if (value == 0)
return 0;
if (value.Type == OO_APPEND)
{
//
HSITE hSite = value->hSite;

//

46

int Key = value->Key;


//
int List = value->List;
//
int Number = value->Object; //
int Mask = value->Mask; // (AM_METRIC)

}
return 1;
}
int TMyControl::OpenMap(string name)
{

//
mapSetChangeCallAndParm(hMap, hSite, PrepareEvent, this);
}


mapCommitObject (mapCommitWithPlace ..) -
.
.
.

:
//
mapSetChangeCallAndParm(hMap, hSite, 0, 0);

(logapi.h).
,
, mapAdjustData.
if (mapAdjustData(hMap) != 0)
{
//
Invalidate();
}
2011
,
, 2011 TCP\IP ,
.
4.2.19.


,
,
.
HRSC.
mapGetRscIdent
mapCreateRsc (RSCAPI.H).
255 .
, ().

47

:
HRSC hRsc = mapGetRscIdent(hMap);
int SegmentCount = mapGetRscSegmentCount(hRsc);
out << "\n e:" << SegmentCount;
for (int i = 0; i<SegmentCount; i++)
{
out << "\n : " << i;
out << "\n : " << mapGetRscSegmentName(i);
out << "\n : " << mapGetRscSegmentOrder(i);
}
,
. 65535.
, , ( ,
, - OLE, c
, c , ..), ,
.

.
int SemanticCount = mapGetRscSemanticCount(hRsc);
out << "\n : " << SemanticCount;
for (int i=0; i < SemanticCount; i++)
{
out << "\n : " << mapGetRscSemanticCodeByNumber(hRsc, i);
out
<<
"\n
:
"
<<
mapGetRscSemanticNameByNumber(hRsc. i);
}
,
(,
).
" " (TCODE),
,
.
. 10 (" ")
1 - , 2 - ..


, .
, c 10,
.
if (mapGetRscSemanticTypeByCode(hRsc, 10) == TCODE)
{
int ValueCount = mapGetRscSemanticClassificatorCount (hRsc, 10);
out << "\n 10: " << ValueCount;
for (int i = 0; i < ValueCount; i++)
{
out << "\n : " << mapGetRscSemanticClassificatorCode(hRsc, 10, i);
out << "\n : " <<
mapGetRscSemanticClassificatorName(hRsc, 10, i);
}
}
65535 .
(, 62310000 -

48

), (, ..), ,
, ( ),
,
.
.
int incode = mapGetRscObjectCodeByNumber (hRsc, 31120000,
LOCAL_SQUARE, 1);
out << "\n :" << incode;
out << "\n :" << mapGetRscObjectName (hRsc, incode);
RSCOBJECT object;
mapGetRscObject(hRsc, incode, &object);
out << "\n:" << object.Segment;
out << "\n :" << object.Bot;
out << "\n :" << object.Top;
out << "\n , :" <<
mapGetRscImageSemanticCount(hRsc, incode);
out << "\n :" <<
mapGetRscObjectFunction(hRsc, incode);
.
, 0 - , 1 - (: ,
) ..
4.2.20.
a pa pa
a a a apap.
, , .
,
MAPRSCEX.H.
HRSC

HRSC hRsc = mapGetRscIdent(hMap, hSite);


(
31420000) :
SERIATYPE seria;
mapSeriaDescribe(hRsc, 31420000, LOCAL_LINE, &seria);
out << "\n : " << seria.Excode;
out << "\n : " << seria.Count;
out << "\n : " << seria.FirstCode;
out << "\n : " seria.SecondCount;
out << "\n : " << seria.FirstCode;
out << "\n : " seria.SecondCount;

:
SERIATYPE seria;
RSCOBJECT object;
//
memset((char *)&object, 0, sizeof(RSCOBJECT));

49

object.Code = 555;
object.Segment = 6;
object.Length = sizeof(RSCOBJECT);
sprintf(object.Name, " ");
// -
IMGLINE line;
line.Color = 0;
line.Thick = 1;
//
SERIALIMIT first;
memset((char *)&first, 0, sizeof(SERIALIMIT));
// 8 (" ")
// 1 - , 2 -
first.Code = 8;
//
first.Count = 2;
//
//
first.Value[0] = 1; //
first.Value[2] = 2;
//
int incode = mapSeriaCreate(hRsc, &first, 0, &object);
// 1
mapSetRscObjectImage(hRsc, incode, sizeof(IMGLINE), IMG_LINE,
(char *)&line);
// 2
strcpy(object.Name, " ");
//
SERIAPLACE place;
place.FirstCode = 8;
//
place.FirstNumber = 2; // ( 1)
place.SecondCode = 0;
// ( 1 = 0 )
place.SecondNumber = 1; // ( 1)
// 2
incode = mapSeriaAppendObject(hRsc, &object, &place);
// -
line.Color = 4;
line.Thick = 2;
//
mapSetRscObjectImage(hRsc, incode, sizeof(IMGLINE), IMG_LINE,
(char *)&line);
( )
:
//
SERIALIMIT first;
first.Code = 33;
//
first.Count = 3;
//
first.Value[0] = 1;
//

50

first.Value[1] = 2;
first.Value[2] = 11;
// ( )
int incode = mapGetRscObjectCodeByNumber(hRsc, 31420000l, 0, 1);
mapGetRscObject(hRsc, incode, &object);
//
strcpy(object.Name, " ");
//
incode = mapSeriaUpdate(hRsc, object.Code, object.Local, &first, 0);
//
SERIATYPE seria;
mapSeriaDescribe(hRsc, 31420000, LOCAL_LINE, &seria);
//
SERIAPLACE place;
place.FirstCode = seria.FirstCode;
//
place.FirstNumber = 1;
// ( 1)
place.SecondCode = seria.SecondCode; //
place.SecondNumber = 2;
// ( 1)
//
incode = mapSeriaAppendObject(hRsc, &object, &place);
IMGLINE line;
line.Color = 13;
line.Thick = 2;
//
mapSetRscObjectImage(hRsc, incode, sizeof(IMGLINE), IMG_LINE,
(char *)&line);
mapSeriaDescribe(hRsc, object.Code, object.Local, &seria);
// -
place.FirstCode = seria.FirstCode;
place.SecondCode = seria.SecondCode;
place.SecondNumber = seria.SecondCount;
for ( int i = 1; i <= seria.FirstCount; i++)
{
place.FirstNumber = i;
mapSeriaSetObject(hRsc, incode, &place);
}
4.2.21.


IMLAPI

RSC.
, MAPGDI.H (IMG_LINE, IMG_SQUARE ..).
(). ,
, ,
. ,
, .

51

(DLL)
.

, MAPGDIEX.H.

, :
const IMLLIST * _IMLAPI imlGetImageList(void);
IMLLIST ,
,
IMLPARM. IMLPARM
( ),
.
.
, .
,
,
.
,
.
:
long int _IMLAPI imlPaintImage(long int type, const POLYDATA* data,
const IMGDRAW * parm, const IMGCONTEXT * context);
type
IMLLIST. data
() ,
IMLPARM .
0,0. parm
c,
IMLPARM . context
:
(HDC), ,
(
), .
,
.
, IMGDRAW,
:
// ( 1)
const IMGDECOR * _fastcall imlDrawAddress(const IMGDRAW * draw, int number);
//
int _fastcall imlDrawType(const IMGDRAW * draw, int number);
//
const char * _fastcall imlDrawParm(const IMGDRAW * draw, int number);
IMLSERV.CPP,
\SDK\IMLAPI\IMLCOMM\. ,
, IMLSERV.CPP
.

52

imlDrawParm
, imlDrawType. ,
128 (IML_LINE), imlDrawParm
IMG_LINE. MAPGDI.H
\SDK\INCLUDE\.
,
, MAPAPI:
long int _MAPAPI imgPaintImage(const POLYDATA * data, long int type,
const char * parm, const IMGCONTEXT *
context);
data ,
. type
(IMG_LINE, IMG_DOT, IMG_SQUARE, IMG_TRUETYPE ..). parm
. context
, imlPaintImage.
,

, .
:
//
int _fastcall imlGetSemanticLong(SEMANTIC * semn, int code, int number,
long * value);
// c
int _fastcall imlGetSemanticDouble(SEMANTIC * semn, int code, int number,
double * value);
//
int _fastcall imlGetSemanticString(SEMANTIC * semn, int code, int number,
char * value, int size);
IMLSEMN.CPP
\SDK\IMLAPI\IMLCOMM\. , ,
IMLSEMN.CPP .

: ,
, ,
.
:
long int _IMLAPI imlTestVisible(long int type, const POLYDATA * data,
const IMGDRAW * parm, const IMGCONTEXT * context);
,
imlPaintImage, imgPaintImage,
imgTestVisible,
. imgPaintImage ,
imlPaintImage .
.

:
long int _IMLAPI imlPaintExample(long int type, const IMGDRAW * parm,

53

const IMGCONTEXT * context);


data .

.
imgPaintImage, .

. , , ,
.
.
. ,
.
//
IMLPARM ImlMarkAlongLine =
{
IMLIDENT, 5, 0, 0, 0, 0,
{{ IMG_VECTOREX, "Mark parameters", " ", 0, 0},
{ IMG_DOUBLE, "Mark distance in mm", " ",
0, 0},
{ IMG_DOUBLE, "Mark shift in mm", " ", 0, 0},
{ IMG_DRAWLINE, "Down line parameters", " ", 0, 0},
{ IMG_DRAWLINE, "Top line parameters", " ",
0, 0},
}
};
.
, IMGLINE, IMGCIRCLE.
(
) .
DOUBLE,

.
// , IMG_DOUBLE
if (imlDrawType(draw, 2) == IMG_DOUBLE)
{
if ((parm = imlDrawParm(draw, 2)) != 0)
{
//
#ifdef RISCCPU
// ARM, SPARC,MIPS
DOUBLEREGISTER regvalue;
DoubleToRegister(regvalue, parm);
double value = regvalue.Double;
#else
double value = ((IMGDOUBLE *)parm)->Value;
#endif
//
if ((value < 0.1) || (value > 200))
value = 4;
// ( )
distance = (context->Scale * context->PixelX * value * 1000.0);
}
}

54

PixelX PixelY IMGCONTEXT


.
Scale
, 1.
1
1000 * PixelX, 1 = 1000 .
,
Scale.
:
// ( )
distance = (context->Scale * context->PixelX * value * 1000.0);
, ,
\SDK\IMLAPI\. ,
, IML.
Builder C++, Visual C++ Delphi.
Linux
C++.
4.2.22.

mtrapi.h.
mapCreateMtrEx,
HMAP.
.
, ,
, , ..
MTRBUILDPARMEX MTRPROJECTIONDATA.
maptype.h.
.
,
, .

mapPutMtrFrame.

mapSetMtrShowRange,
mapCloseMtr.
:
MTRBUILDPARMEX parm; //
MTRPROJECTIONDATA projectiondata; //

long int Area[1000]; //


long int MtrWidth = 50; //
long int MtrHeight = 20; //
long MinHeight,MaxHeight,j;
//
memset(&parm,0,sizeof(MTRBUILDPARMEX));
parm.StructSize = sizeof(MTRBUILDPARMEX); //
parm.BeginX = 5203300;
//
parm.BeginY = 2367900;
// (- )
parm.ElemSizeMeters = 50; //
//

55

parm.Width = MtrWidth *parm.ElemSizeMeters; //


parm.Height = MtrHeight*parm.ElemSizeMeters; //
parm.ElemSizeBytes = 4;
// P
parm.Unit = 0;
// E ()
parm.Scale = 100000;
//
//
//
memset(&projectiondata,0,sizeof(MTRPROJECTIONDATA));
projectiondata.StructSize = sizeof(MTRPROJECTIONDATA);
projectiondata.MapType = 1; // -
projectiondata.ProjectionType = 1; // - -
//
// Area
Area[0] = 120;
Area[1] = 123;
Area[2] = 127;
...
Area[999] = 145;
// MinHeight,MaxHeight
// , parm.Unit
for (j = 0; j < 1000; j++)
{
if (Area[j] < MinHeight) MinHeight = Area[j];
if (Area[j] > MaxHeight) MaxHeight = Area[j];
}
// MTW-
hMap = mapCreateMtrEx(mtwname,&parm,&projectiondata);
if (hMap == 0) return 0;
// Area
if (mapPutMtrFrame(hMap,1,(char*)Area,0,0,MtrWidth,MtrHeight,0))
{
// . .
mapSetMtrShowRange(hMap,1,(double)MinHeight,(double)MaxHeight);
}
//
mapCloseMtr(hMap,1);
mapOpenMtr,
HMAP.
mapGetMtrDescribe.
MTRDESCRIBE.
MTRDESCRIBE maptype.h.

, .
mapGetMtrFrame.

mapGetMtrElementRow, mapGetMtrElementColumn
,
mapGetMtrElementSize.
:

56

long int MtrHeight,MtrWidth; //


long int ElementSizeBytes; //
long int * Area;
//
hMap = mapOpenMtr(mtwname,0);
if (hMap == 0) return 0;
//
MtrHeight = mapGetMtrElementRow(hMap,1);
MtrWidth = mapGetMtrElementColumn(hMap,1);
if (MtrHeight == 0 || MtrWidth == 0) return 0;
//
ElementSizeBytes = mapGetMtrElementSize(hMap,1);
if (ElementSizeBytes == 0) return 0;
//
Area = (long int *)farmalloc(MtrWidth*MtrHeight*ElementSizeBytes);
if (Area == 0) return 0;
memset(Area,0,MtrWidth*MtrHeight*ElementSizeBytes);
// Area
if (mapGetMtrFrame(hMap,1,(char*)Area,0,0,MtrWidth,MtrHeight,
MtrWidth*ElementSizeBytes) == 0) return 0;
//
mapCloseMtr(hMap,0);
4.2.23.

. ,
, ,
.

.
:
// (mapapi.h)
HOBJ hObj = mapCreateObject(hMap, 1, 0, 0);
// (seekapi.h)
if (mapReadObjectByNumber(hMap, hSite, hObj, 1, 2) != 0)
{
// (sitapi.h)
mapChangeObjectMap(hObj, hMap, hSite2);
// (mapapi.h)
mapCommitObject(hObj);
}
// (mapapi.h)
mapFreeObject(hObj);

57


.
, .
,
.


SXF .
.
SXF
.
.
:
// (seekapi.h)
HSELECT hSelect = mapCreateMapSelectContext(hMap);
// 123 ABC (seekapi.h)
mapSelectSample(hSelect, ABC, 123);
...
// 234 ABC (seekapi.h)
mapSelectSample(hSelect, ABC, 234);
// SXF c newabc (vecexapi.h)
SaveSxfFromMapSelect(c:\data\abc.map, 1, c:\data\newabc.sxf,
hWnd, hSelect, 0, 0);
// (seekapi.h)
mapDeleteSelectContext(hSelect);

. : ,
(),
. :
// c:\map\abc.map (vecexapi.h)
UpdateMapFromSxf(c:\input\newabc.sxf, c:\map\abc.map, hWnd);
hWnd
SXF .
WM_OBJECT, WM_LIST, WM_ERROR
maptype.h (0x585, 0x586, 0x587), 4.3.3.1.
, ,
SXF.

:
// c:\map\abc.map SXF (vecexapi.h)
AppendMapFromSxfSelect(c:\input\newabc.sxf, c:\map\abc.map, hWnd, 0);
SXF,
. 0,
.
,
.

58

,
.
SXF
, .
,
. , ,
.

.

, , ,
.
:
// (seekapi.h)
if (mapSeekObject(hMap, hObj, ABC, 123) != 0)
{
// (mapapi.h)
int length = mapGetObjectRecordLength(hObj);

char * buffer = new char[length];


// (mapapi.h)
mapGetObjectRecord(hobj, buffer, length);
//

//
delete [] buffer;
}
, ,
.
, .
:
// (mapapi.h)
HOBJ hObj = mapPutObjectRecord(hMap, hSite, buffer, maxlength, 1);
// (mapapi.h)
mapFreeObject(hObj);
maxlength .
( ).

,
. :
// (sitapi.h)
int length = mapGetMapPassportRecordLength(hMap, hSite);
char * buffer = new char[length];
// (sitapi.h)
mapGetMapPassportRecord(hMap, hSite, buffer, length);

59

//

//
delete [] buffer;
, ,
:
// (sitapi.h)
HSITE hSite = mapPutMapPassportRecord(hMap, c:\map\abc.sit,
c:\map\special.rsc,
buffer, maxlength);

// (sitapi.h)
mapCloseSiteForMap(hMap, hSite);

.
,
.
,
, :
// ,
// 19:00 18/11/2001 (logapi.h)
int number = mapLogGetActionNumberByTime(hMap, hSite, 20011118, 68400);
0 .
,
(, ,
). :
// (maptype.h)
ACTIONHEAD head;
// // (logapi.h)
int count = mapLogReadAction(hMap, hSite, number, &head);
// (maptype.h)
ACTIONRECORD record;
// (logapi.h)
mapLogGetActionRecord(hMap, hSite, 1, &record);
//
if ((record.Type == OO_APPEND) || (record.Type == OO_UPDATE)
{
// (seekapi.h)
mapSelectSampleByList(hSelect, record.List, record.Key);
}

// (seekapi.h)

60

mapSeekSelectObject(hMap, hObj, hSelect, WO_NEXT);


, :
// (seekapi.h)
mapReadObjectByNumber(hMap, hSite, hObj, record.List, record.Number);

mapObjectKey(hObj) record.Key.
, .
.
.
, .
4.2.24.
rstapi.h.
mapCreateRst,
HMAP.
, ( ),
( 1, 4 8 ), ,
( ).
.
,
, .

mapPutRstFrame.
( -
, , ) mapSetRstLocation.
:
long int Width = 50; //
long int Height = 20; //
long int ElemSize = 8; // ( )
double Scale = 100000; //
//
double Precision = 20000; // (
// )
long int ColorCount = 256; //
//
COLORREF Palette[256];
memset((char*)&Palette, 0, 256*sizeof(COLORREF));
for (int i = 0; i < ColorCount; i++)
{ Palette[i] = RGB(i,i,i); }
// RSW-
char Name[] = exampl.rsw;
HMAP hMap = mapCreateRst ((const char *) Name,
Width, Height,
ElemSize,
(COLORREF*)&Palette, ColorCount,
Scale, Precision);

61

if (hMap == 0) return 0;
long int RstNumber = 1; //
// ( )
DOUBLEPOINT Location;
Location.X = 5203300;
//
Location.Y = 2367900;
// -
// 0
mapSetRstLocation(hMap, RstNumber, (DOUBLEPOINT*)&location);
// Area
mapPutRstFrame(hMap, RstNumber, (char*)Area, 0, 0, Width, Height, 1, 0);
//
mapCloseRst(hMap, RstNumber);
mapOpenRst,
HMAP.

mapGetRstFrame.
mapGetRstHeight,
mapGetRstWidth ,
mapGetRstElementSize.
:
long int Height, Width; //
long int ElementSize; // ( )
char * Area;
//
hMap = mapOpenRst(rstname,0);
if (hMap == 0) return 0;
//
Height = mapGetRstHeight (hMap,1);
Width = mapGetRstWidth (hMap,1);
if (Height == 0 || Width == 0) return 0;
// ( )
ElementSize = mapGetRstElementSize (hMap,1);
if (ElementSize == 0) return 0;
//
Area = (char*)farmalloc(Width*Height*ElementSize/8);
if (Area == 0) return 0;
memset(Area,0,Width*Height*ElementSize/8);
// Area
if (mapGetRstFrame(hMap,1,(char*)Area,0,0,Width,Height,
Width*ElementSizeBytes/8) == 0) return 0;
//
mapCloseRst(hMap,0);

62

4.2.25. 3D-

(, , ).

HMAP3D. t3dOpen(...),
HMAP.
CREATETASK3D.
CREATETASK3D ,
3D- . :
3D- ( CmStop3d);
3D-
( CmMove3d);
3D-
( CmSelectFrame3d);

( CmSelectObject3d).
CmStop3d - .
.

.

:
// ini-
char* iniName = (char*)mapGetMapIniName(hMap);
CREATETASK3D parmtask3d;
// 3d- ini-
memset(&parmtask3d, 0, sizeof(CREATETASK3D));
// 2D 3D
parmtask3d.MoveAdjust = GetPrivateProfileInt(IniFileSection, "Synch2D3D", 0,
iniName);
//
parmtask3d.Area = GetPrivateProfileInt(IniFileSection, "SelectArea", 2, iniName);
// ,
// 3D-
parmtask3d.CmStop3d = ID_CM_T3DSTOP;
parmtask3d.CmSelectFrame3d = ID_CM_T3DSELECTFRAME;
parmtask3d.CmMove3d = ID_CM_T3DMOVE;
parmtask3d.CmSelectObject = ID_CM_T3DSELECTOBJECT;
//
HTask3D = t3dOpen(hMap, &parmtask3d, &tparmex);

t3dClose(). :
if (HTask3D != 0)
{
if (::MessageBox(0, " 3D?", " 3D",

63

MB_YESNO | MB_ICONINFORMATION | MB_TASKMODAL) == IDNO)


return;
//
t3dClose(HTask3D);
HTask3D = 0;
}

.
/
2D 3D . t3dMoveAdjustIsActive() .

t3dSetPoint() t3dSetPointAndDirect(),
.
3D-
:
// 2D 3D
if (t3dMoveAdjustIsActive(HTask3D) == 0) return;
//

// ( )
::ConvertMetric(hMap, &CurPoint, PP_PICTURE, PP_PLANE);
XYHDOUBLE point3d;
point3d.X = CurPoint.X;
point3d.Y = CurPoint.Y;
// ,
point3d.H = mapGetPrecisionHeightValue(hMap, CurPoint.X, CurPoint.Y);
if (point3d.H == ERRORHEIGHT) point3d.H = 0.0;
// 3D-
//
t3dSetPoint(HTask3D, &point3d);
3D-
(CmMove3d)
( 3D- ).

3D-.
t3dGetPoint().
:
//
XYHDOUBLE point3d;
t3dGetPoint(HTask3D, &point3d);
// ( )
::ConvertMetric(hMap, (DOUBLEPOINT*)&point3d, PP_PLANE, PP_PICTURE);
//
RECT rectWnd;

64

::GetClientRect(AfxGetMainWnd()->m_hWnd, &rectWnd);
//
MapOffset.x = point3d.X - (rectWnd.right - rectWnd.left) / 2;
MapOffset.y = point3d.Y - (rectWnd.bottom - rectWnd.top) / 2;
SetScrollPos(SB_HORZ, MapOffset.x);
SetScrollPos(SB_VERT, MapOffset.y);
//
Invalidate();
UpdateWindow();

3D- , (
3D-).

3D- (CmSelectFrame3d) .
.

:
if (HTask3D == 0) return;
//
t3dClose(HTask3D);
HTask3D = 0;
// 3D- ,
//
parmtask3d.Area = 2;
//
RECT rectWnd;
::GetClientRect(AfxGetMainWnd()->m_hWnd, &rectWnd);
//
rectWnd.left += MapOffset.x;
rectWnd.top += MapOffset.y;
rectWnd.right += MapOffset.x;
rectWnd.bottom += MapOffset.y;
// ( )
DOUBLEPOINT curPoint;
curPoint.X = (double)rectWnd.left;
curPoint.Y = (double)rectWnd.bottom;
::ConvertMetric(hMap, &curPoint, PP_PICTURE, PP_PLANE);
parmtask3d.SelectFrame.X1 = curPoint.X;
parmtask3d.SelectFrame.Y1 = curPoint.Y;
curPoint.X = (double)rectWnd.right;
curPoint.Y = (double)rectWnd.top;
::ConvertMetric(hMap, &curPoint, PP_PICTURE, PP_PLANE);
parmtask3d.SelectFrame.X2 = (double)curPoint.X;
parmtask3d.SelectFrame.Y2 = (double)curPoint.Y;
// 3D
//

65

//
HTask3D = t3dOpen(hMap, &parmtask3d, &tparmex);
t3dSetSelectObject().
(
t3dSetSelectObject) t3dClearSelectObject().
t3dGetSelectObject().
(CmSelectObject3d)
,
, , .

,
. t3dAdjustData()

3D-.
t3dUpdateData() 3D-
.
4.2.26.
,
2011, , 2008, - ,
GIS ToolKit 11 .
, .
TCP\IP
. Windows, Linux, Solaris (Sparc).


.

()
,
-.
3-5
(http://www.gisinfo.ru/products/gisserver.htm).
(
)
mapAdjustData, .
( ) ,
. .
,
. :
//
char * host = "www.gisserver.ru";
int port = 2047;
int number = mapOpenConnect(host, port);
//
TMCUSERPARM userparm;
strncpy(userparm.Name, "User1", sizeof(userparm.Name)-1);
userparm.Name[sizeof(userparm.Name)-1] = 0;

66

char password[64];
strncpy(password, "1", sizeof(password)-1);
password[sizeof(password)-1] = 0;
// MD5
typedef long int (WINAPI * STRINGTOHASH)(const char * source, char * target,
long int size);
HINSTANCE instance = 0;
STRINGTOHASH svStringToHash;
svStringToHash =
(STRINGTOHASH)mapLoadLibrary("gisdlgs.dll",&instance,"svStringToHash");
if (svStringToHash)
{
(*svStringToHash)(password, userparm.Password, sizeof(userparm.Password));
::FreeLibrary(instance);
}
// - mapRegisterUserEx
//
// (, "User2") -
// , - ,
// mapCanCloseConnect(number);
mapRegisterUserEx(number, &userparm);
//
char * alias = "";
char aliasname[1024];
// : HOST#www.gisserver.ru#2047#ALIAS#
mapBuildAliasName(host, port, alias, aliasname, sizeof(aliasname));
//
HMAP hmap = mapOpenData(aliasname, 0);
,
gisdlgs.dll.
.
1)

HOST#www.gisserver.ru#2047#ALIAS#,

.
.

:
//
// ( )
// parm - ( Handle
//
,
)
// aliasName -
// "HOST#:#ALIAS#__"

67

//
long int WINAPI svGetUserDataEx(TASKPARM *parm,const char * aliasName);
( )
. aliasName.
2)


.
.

:
//
// parm - ( Handle
//
)
// name -
//
( MAXPATH)
// size -
// name
//
long int WINAPI svOpenDataEx(TASKPARM *parm,char * name,long int size);
,
MAPAPI-:
// -
// 1024 65536, - 2047
// number -
// 1 mapActiveServerCount()
_MAPIMP long int _MAPAPI mapGetConnectPortEx(long int number);
// \
// - 1,
// - 2.
// -
// name -
// size - ( 256)
//
_MAPIMP long int _MAPAPI mapGetConnectHostEx(long int number, char * name,
long int size);
, , (
) .
mapRegisterUserEx.
//
// //
// USERPARM maptype.h
//
_MAPIMP long int _MAPAPI mapRegisterUserEx(long int number, TMCUSERPARM *
parm);

68

TMCUSERPARM Name (
ANSI) Password (, ANSI,
MD5). MD5
Windows
(cryptdll.dll).

mapGetCurrentUserNameEx:
// , -
// number - 1
mapActiveServerCount()
//
const char * _MAPAPI mapGetCurrentUserNameEx(long int number);
,
(mapOpenData).
.

"HOST#:#ALIAS#__".

"HOST#"

-. ,
"ALIAS#", . ,
, .
(),
, MAPAPI-:
// -
// buffer - ,
//
TMCMAPLIST maptype.h
// length -
// MAPAPI
// "ALIAS#"
// 0
long int _MAPAPI mapGetMapListforUserEx(long int number,
TMCMAPLIST * buffer, int length);
// -
// buffer - ,
//
TMCMAPLIST maptype.h
// length -
// MAPAPI
// "ALIAS#"
// 0
long int _MAPAPI mapGetMtwListforUserEx(long int number,
TMCMAPLIST * buffer, int length);
// -
// buffer - ,
//
TMCMAPLIST maptype.h
// length -
// MAPAPI
// "ALIAS#"

69

// 0
long int _MAPAPI mapGetRswListforUserEx(long int number,
TMCMAPLIST * buffer, int length);
// -
// number - 1
mapActiveServerCount()
// buffer - ,
//
TMCMAPLIST maptype.h
// length -
// 0
long int _MAPAPI mapGetAlsListforUserEx(long int number, TMCMAPLIST * buffer,
int length);
4 , , .
. TMCMAPLIST
Level Type (
0). alsOpenAreaList

. alsapi.h.
, ,
, gisdlgs.dll:
//
//
long int WINAPI _export svOpenData(TASKPARM *parm);

( TASKPARM)
AW_OPENDOC (0x655):
::SendMessage(Parm->Handle, AW_OPENDOC, (WPARAM)name, 0);

WPARAM

:
ALIAS#__".
,
,
AW_GETCURRENTDOC (0x673):
::SendMessage(Parm->Handle,
(long)&hMap);

AW_GETCURRENTDOC,

(long)&hWnd,

(HMAP)

:
::InvalidateRect(hWnd, 0, false);
AW_GETCURRENTDOC
(HMAP), ,
(HWND), InvalidateRect .

70

, ,
gisdlgs.dll:
//
//
long int WINAPI _export svAppendData(HMAP hmap, TASKPARM *parm)
, ,
.
MAP,
(SIT).
, ,
MAPAPI-:
//
// hmap -
// hSite -
// ( () hSite = hMap)
// ,
_MAPIMP long int _MAPAPI mapIsMapFromServer(HMAP hMap, HSITE hSite);

(, ..).

- .

.
mapGetSiteCopyFlag:
// -

// hMap -
// hSite -
// -
_MAPIMP long int _MAPAPI mapGetSiteCopyFlag(HMAP hMap,HSITE hSite);
,
.
,

mapCloseMapAccess(),
//
long int _MAPAPI mapCloseMapAccess();
, ,
.
, .
, JPEG 10
, 3-4 ,

3-4 .

71


,
.
,
.
.

( ). , ,
:
//
const char * _MAPAPI mapGetCachePath();
//
//
long int _MAPAPI mapSetCachePath(const char * path);
,
Temp Panorama.Cache.
4.2.27. ( )
NETAPI.H.
OBJNET.DLL (GISOBNET.DLL).
MAPAPI , ,
.
onCreateNetDlg(HMAP hmap, TASKPARMEX
* parm).

(. mapSetSiteSeekSelect(...)) , ,
(. ).
" ",
, (road10.rsc, road25.rsc service.rsc), .
: , ,
( 32812
32822, . maptype.h).

" ",
.
,
.
.
.
:
HSITE site = onCreateNetDlg (hmap, parm);
hmap - ;
parm - (. .4.3.1);

site.
. 0.

72

.

.

onSeekPathDlg, onSeekPath, onSeekPathCreateObject. :
long int WINAPI onSeekPathDlg(HMAP hmap, HSITE site,
TASKPARMEX * parm,
HOBJ infobegin,HOBJ infoend);
.
hmap - , site -
infobegin - ( ),
infoend - ( ).
" ",
( ,
"") .
" ",
.
,
.
mapTotalSeekObjectCount (seekapi.h). ,
mapTotalSeekObject (seekapi.h).
: (mapObjectKey),
, - 1, , 0 - .

.
mapCreateSiteObject (SITAPI.H).
:
HOBJ info1 = mapCreateSiteObject(hmap,site,IDDOUBLE2,0);
HOBJ info2 = mapCreateSiteObject(hmap,site,IDDOUBLE2,0);
,
.
info1 :
long int _export WINAPI onGetNodeByPoint(HMAP hmap, HSITE site,
HOBJ info, DOUBLEPOINT * point);
hmap - ;
site
- ;
info
- ( ) ,
point - .
info (SITAPI.H):
_MAPIMP HOBJ _MAPAPI mapSeekSiteObject(HMAP hMap,HSITE hSite,HOBJ info,
long int key);
key - ( ).

:
HOBJ info1 = mapCreateSiteObject(hmap,site,IDDOUBLE2,0);
HOBJ info2 = mapCreateSiteObject(hmap,site,IDDOUBLE2,0);
DOUBLEPOINT point1, point2;
point1.X = 7345215.57;
point1.Y = 5448790.17;

73

point2.X = 7305483.92;
point2.Y = 5452435.00;
onGetNodeByPoint(hmap,site, info1, point1);
onGetNodeByPoint(hmap,site, info2, point2);
onSeekPathDlg(hmap,site,parm,info1,info2);

onMinimalPath, onMinimalPathEx. :
long int WINAPI onMinimalPath(HMAP hmap, HSITE site,
TASKPARMEX * parm,
DOUBLEPOINT * arraypoint, long int
count);
( ).
: hmap - ; site -
; parm - (.maptype.h); array , count; count .
.
" ",
( ,
"") .
"
", ,
,
, . 0.
:
long int WINAPI onEditDeleteNode(HMAP hmap, HSITE site,
TASKPARMEX *parm, HOBJ info); - ;
long int WINAPI onEditAddNode(HMAP hmap, HSITE site,
TASKPARMEX *parm, HOBJ info1, HOBJ info2); - ;
long int WINAPI onEditRoad(HMAP hmap, HSITE site,TASKPARMEX *parm,
HOBJ info); - ;
long int WINAPI onEditCreateArc(HMAP hmap, HSITE site,TASKPARMEX *parm,
HOBJ info1,HOBJ info2); - .
HGRAPH

. :
HGRAPH WINAPI onOpenGraphEx(HMAP hmap, HSITE site);
,
:
HSITE WINAPI onGetGraphSiteIdent(HMAP hmap);
, :
if (hgraph != 0)
{
onCloseGraph(hgraph);
hgraph = 0;
}

74

onSeekPathDlgGraph,
onSeekPathGraph,
onSeekPathCreateObjectGraph, onSeekPathDlgByPointGraph, onSeekPathByPointGraph,
onSeekPathByPointExGraph,
onDistFromKnotGraph,
onMinimalPathGraph,
onMinimalPathSiteGraph, onMinimalPathExGraph.

:
long int WINAPI onSeekPathCreateObjectGraph(HMAP hmap,HGRAPH hgraph,
TASKPARMEX * parm, HOBJ object,HOBJ infobegin,HOBJ infoend,
long int methodseek, double speed).
:
hmap - ;
hgraph - ,
onOpenGraphEx(...);
object - ,
mapCreateObject() mapCreateSiteObject(), ;
pointbegin - ( );
pointend - ( );
methodseek - (0 - , 1- )
speed - (/)( methodseek = 1
)
: -1, ; 0 - .

:
HGRAPH hgraph;
onOpenGraph(hgraph, hmap, site);
HOBJ info1 = mapCreateSiteObject(hmap,site,IDDOUBLE2,0);
HOBJ info2 = mapCreateSiteObject(hmap,site,IDDOUBLE2,0);
HOBJ object = mapCreateSiteObject(hmap,site,IDDOUBLE2,0);
DOUBLEPOINT point1, point2;
point1.X = 7345215.57;
point1.Y = 5448790.17;
point2.X = 7305483.92;
point2.Y = 5452435.00;
onGetNodeByPoint(hmap,site, info1, point1);
onGetNodeByPoint(hmap,site, info2, point2);
long int ret = onSeekPathCreateObjectGraph (hmap, hgraph ,parm,object,info1,info2,0,0);
.
if (hgraph)
onCloseGraph(hgraph);
hgraph = 0;
if (info1) mapFreeObject(info1);
if (info2) mapFreeObject(info2);
if (object) mapFreeObject(object);
( )
:
double WINAPI onMinimalPathExGraph(HMAP hmap,HGRAPH hgraph,

75

TASKPARMEX * parm, DOUBLEPOINT * arraypoint,int * arraynumber,


long int count,int flagreturn, int flagcalc).
:
hmap - ;
hgraph - ,
onOpenGraph(...);
parm - (.maptype.h);
arraypoint - ( ) ,
count;
arraynumber - ( ),
count, ;
count - ;
flagreturn - (0 - , 1 - );
flagcalc - (0 - , 1- ).
. arraynumber
, .
. 0.

:
HGRAPH hgraph;
onOpenGraph(hgraph, hmap, site);
DOUBLEPOINT array[5];
array [0].x = 7345215.57;
array [0].y = 5448790.17;

array[4].x = 7305483.92;
array[4].y = 5452435.00;
int arraynumber[5];
memset(arraynumber,0,sizeof(int)*5);
double lenght = onMinimalPathExGraph(hmap, hgraph, parm, array, arraynumber,5,0,0);

if (hgraph)
onCloseGraph(hgraph);
hgraph = 0;
length. arraynumber
, .
4.2.28.

,
, , ,
, , .
,
.
mapSaveMapState mapRestoreMapState.
//
void TMapWindow::CloseData()
{
if (hMap != 0)
{
//

76

DOUBLEPOINT point;
point.X = HorzScrollBar->Position + ClientRect.Width()/2;
point.Y = VertScrollBar->Position + ClientRect.Height()/2;
//
mapPictureToPlane(hMap, &point.X, &point.Y);
//
mapSaveMapState(HMAP hMap, &point);
//
mapCloseData(hMap);
hMap = 0;
}
}

mapRestoreMapState.
DOUBLEPOINT point;
point.X = 0;
point.Y = 0;
mapRestoreMapState(hMap, &point);
long int mapwidth = 0;
long int mapheight = 0;
mapGetPictureSize(hMap, &mapwidth, &mapheight);
HorzScrollBar->Range = mapwidth;
VertScrollBar->Range = mapheight;
if ((point.X != 0) || (point.Y != 0))
{
mapPlaneToPicture(hMap, &point.X, &point.Y);
//
HorzScrollBar->Position = point.X - ClientRect.Width()/2;
VertScrollBar->Position = point.Y - ClientRect.Height()/2;
}
4.2.29.
, web, wmsacces.dll (giswmsacces.dll).
.
OGC WMS, OGC WMTS, TMS 17 .
wmslist.ini.
.

mapPortalMenu(), wmsapi.h.
,
. , ,
wmslist.ini.

77

// hmap
-
// parm
-
// left, top - ( )
// :
// (parm->Handle)
// AW_OPENDOC -
// ::SendMessage(Parm->Handle, AW_OPENDOC, (WPARAM)fname, 0);
// AW_CLOSEDOC -
// ::SendMessage(parm->Handle, AW_CLOSEDOC, (WPARAM)filename.c_str(), 0);
// (parm->DocHandle)
// MT_MAPWINPORT -
// ::SendMessage(Parm->DocHandle, MT_MAPWINPORT, MWP_SETVIEWSCALE,0)
// AW_MOVEDOC - geopoint
// ::SendMessage(Parm->DocHandle,
AW_MOVEDOC,(WPARAM)&geopoint,
PP_GEOWGS84);
// PP_GEOWGS84 //
WGS-84
// MT_SELECTOBJECT -
// ::SendMessage(Parm->DocHandle, MT_SELECTOBJECT,0,0);
// 0
long int mapPortalMenu (HMAP hmap, TASKPARMEX *parm, int left, int top)

mapEditWms -
(wmsapi.h), mapOpenData mapAppendData
(mapapi.h) - / .

78

// /
// parm
-
// wmsstring - ( url )
// size - ,
// flag - ( )
// 0 - , 1 - , 2 -
// type - // 0 - WMS, 1 - WMTS
// 0
long int _MAPAPI mapEditWms(TASKPARMEX *parm, char* wmsstring, int size, int flag)
char wmsstring[4096] = {0};
HMAP hmap =0;
if(wmsEditWms(parm, wmsstring, 4096, 0))
{
hmap = mapOpenData(wmsstring);
if(hmap)
{
// ,

MapView1->UpdatePictureBorder ();
//
MapView1->Repaint();
}
}
mapCloseData(hmap);

79

5.

5.1.

PANORAMA.EXE

MAPEDIT.DLL


RSTEDIT.DLL

MAPTASK.DLL


.
.

MAPVETR.DLL

MAPPICTR.DLL

MAPCOMP.DLL

MAPCOMM.DLL

C.
(,
Clipboard,...)
MAPDB. DLL

MAPACCES.DLL

MAPPASP.DLL

MAPLINK.DLL

RSCEDIT.DLL


, PASCAL,
BASIC-

.
MAPTRANS. DLL

Delphi,


Visual C++


Visual Basic


Delphi

. * ,
.

80

5.2.
, Delphi, Builder C++, Visual Studio

2011, 4.2.1.
,
2011 ( SXF, ..).
DLL.
2011 , ,
, 4.2.3.
5.2.1.
SXF
2011 MAPVECTR.DLL.
extern "C"
{
long int _export WINAPI LoadSxf2Map(char * sxfname, char * mapname,
void * parm);
}
sxfname sxf. mapname
, MAP (
2011), parm .
SXF
2011 MAPVECTR.DLL.
extern "C"
{
long int _export WINAPI LoadTxt2Map(char * txtname, char * mapname,
void * parm);
}
sxfname txt. mapname
, MAP (
2011), - parm .

SXF 2011
MAPVECTR.DLL.
extern "C"
{
long int _export WINAPI SaveMap2Txt(long int hmap, const char * nametxt,
void * parm);
}
hmap .
txtname SXF ,
.

81


SXF 2011
MAPVECTR.DLL
extern "C"
{
long int _export WINAPI SaveMap2Sxf(long int hmap, const char * namesxf,
void * parm);
}
hmap . sxfname
, SXF.
(parm) .
5.2.2.
RSW -
MAPPICTR.DLL
extern "C"
{
long int _export WINAPI LoadBmpToRst(char* lpszsource,
char* lpsztarget, void* parm);
}
lpszsource . lpsztarget , RSW ( ).
parm .
RSW
LoadPcxtoRst MAPPICTR.DLL:
extern "C"
{
long int _export WINAPI LoadPcxToRst(char* lpszsource,
char* lpsztarget, void* parm);
}
lpszsource .
lpsztarget ,
RSW( ), parm .
5.2.3.

MAPVECTR.DLL.
extern C
{
long int WINAPI MapSort(long int hmap, void * parm);
}
hmap c . parm
.

MAPPASP.DLL

82

extern C.
{
int WINAPI MapPspEdit(long int hmap, char*mapname, void*parm);
}
hmap , mapname
parm .

MAPPASP.DLL.
hmap parm , mapname
*.MAP.

MAPPASP.DLL
extern C
{
int WINAPI MapPaspPlan(char *mapname, void *parm);
}
mapname *.MAP, parm
.
5.2.4.
2011
.
MapSelec.DLL.
MapSelec.DLL
/
.

HSELECT ( 4.1.2.3.).
/
/ MAPAPI
(APILIST.DOC ) .

:
extern "C"
{
long int WINAPI selSetViewStaff(HMAP hmap, TASKPARM* parm,
long int* note);
}
hmap - ;
parm - ;
note - ,
. note = 0 .

.

. note
/
/ .

83

/
extern "C"
{
long int _export WINAPI selSetObjectsSearch(HMAP hmap,
TASKPARM* parm,
long int* note);
}
hmap - ;
parm - (. .4.3.1);
note - ,
. note = 0
.
:
0 - / ;
1 - ;
2 - .

. note
/
/ .
/
:
extern "C"
{
long int _export WINAPI selFindStaff(HMAP hmap, HSELECT select,
TASKPARM* parm);
}
hmap - ;
select - ;
parm - (. .4.3.1).
:
0 - / ;
1 - ;
2 - .
()
.
/ :
extern "C"
{
long int _export WINAPI selSearchObjectByArea(TASKPARM* parm, HMAP hmap,
HOBJ hobj, HWND hwnd ) ;
}
parm - (. maptype.h);
hmap - ;
hobj - - .
;
hwnd - .
:
0 - / ;
1 - ;
2 - .

.
/
:

84

extern "C"
{
long int _export WINAPI selSearchName(HMAP hmap, HSELECT select,
ARRAYNAME* arname,
TASKPARM* parm);
}
hmap - ;
select - ;
arname - ;
parm - (. 4.3.1).
:
0 - / ;
1 - ;
2 - .

.
ARRAYNAME :
struct ARRAYNAME
{
long int Code;
//
long int Title;
//
long int Count;
//
char
Name[16][256]; //
};

2011 .

:
extern "C"
{
long int _export WINAPI selSaveSelect(HMAP hmap);
}
hmap - .
.

.

:
extern "C"
{
long int _export WINAPI selRestoreSelect(HMAP hmap);
}
hmap - .
.

.

,
.
extern "C"
{
long int _export WINAPI selSetFilterTitle(TASKPARM* parm, HSELECT hselect,
HMAP hma p,char * title);
}
parm - (. .4.3.1).
select - (. 4.1.2.3.),

85

;
hmap - ;
title
- , .
.
/
, .
5.3.
2011
:
,
;

(MFC, OWL);
.
,
SXF . DIR,
SXF,
progressbar.
.

. SXF,
DIR
. .
, ,
. (HWND),
(SendMessage).
, .
,
. ,
,
Windows. ,
PeekMessage, DispatchMessage ..
5.3.1.
(MAP) SXF,
(DIR)
MAPVECEX.DLL.
extern C
{
long int WINAPI LoadDirToMap(char* namedir, char* namemap, HWND handle);
}
namedir DIR. namemap
MAP. handle ,
. handle ,
. WinApi SendMessage.
0585. WPARAM ( 0 100)
, LPARAM
DIR ( 1 ).
0586 SXF
( WPARAM) SXF ( LPARAM).

86

0586, WPARAM 0,
LPARAM- SXF, DIR. - SXF
, SXF 586
585, .
.
DIR .
DIR ( ).
- . , MAP103P.RSC.
SXF, TXT MAP,
. .
( ),
, DIR. ,
, ,
DIR.
. DIR :\DATA. SXF
\KALUGA\kaluga.sxf. C:\DATA\KALUGA\kaluga.sxf.
. : T:\Rostov\rostov.txt.
.
(RSC) .
DIR RSC
NAME, .
,
NAME
DIR
SXF, TXT MAP, .

(, - ..).
(, 1:200000)
, SXF DIR
SXF, , .
SXF, ,
SXF.
.
SXF.
(MAP) SXF
MAPVECX.DLL
extern C
{
long int WINAPI UpdateMapFromSxf(char* namesxf, char* namemap, HWND handle);
}
namesxf SXF,
.
, namemap - (MAP).
, , - .
.
, .
0585,
DIR.
(MAP) SXF
MAPVECEX.DLL.
extern C
{
long int WINAPI LoadSxfToMap

87

(char* namesxf, char* namemap, char* namersc, HWND handle);


}
namesxf SXF (), namemap ( MAP), namersc -
(RSC). handle ,
0585.
.
(MAP) TXT ( SXF)
MAPVECEX.DLL.
extern C
{
long int WINAPI LoadTxtToMap
( char * nametxt, char * namemap, char * namersc, HWND handle);
}
nametxt TXT (), namemap ( MAP), namersc -
(RSC). handle ,
0585.
.
TXT : SXF, P000,
P001, P002, P207,.END. .
(MAP)
MAPVECEX.DLL
extern C
{
long int WINAPI LoadMapToMap(HMAP hMap, char * namemap, HWND handle);
}
hMap ,
. namemap ,
. handle ,
0585.
SXF (MAP)
MAPVECEX.DLL
extern C
{
long int WINAPI SaveSxfFromMap(char* namemap,int list, char* namesxf, HWND
handle);
}
namemap ( MAP).
list .
namesxf SXF. handle
SXF
( 0585).
.
TXT (MAP)
MAPVECEX.DLL.
:
extern C

88

{
long int WINAPI SaveTxtFromMap(char * namemap, int list, char* nametxt,
HWND handle);
}
:
extern C
{
long int WINAPI SaveTxtGeoFromMap(char * namemap, int list, char* nametxt,
HWND handle);
}
namemap (MAP). list
. nametxt
TXT ( 0x585).
.
DIR
MAPVECEX.DLL.
SXF:
extern C
{
long int WINAPI SaveDirSxfFromMap(char * namemap, char* namedir, HWND
handle);
}
TXT
:
extern C
{
long int WINAPI SaveDirTxtFromMap (char * namemap, char* namedir,
HWND handle);
}
TXT
:
extern C
{
long int WINAPI SaveDirTxtGeoFromMap(char * namemap, char* namedir,
HWND handle);
}
namemap (MAP). namedir
DIR. handle
, 0x585, 0x586.
.
SXF(TXT)
(MAP).
5.3.2.

MAPVECEX.DLL:

89

extern C
{
int WINAPI MapSortProcess ( HMAP doc, HWND handle, int regim);
}
doc - .
handle , c
.
regim :
0 - c ,
1 - .
.
:
0x585, 0x586 - . 4.2.3.1;
0588 - ;
WPARAM ;
LPARAM ;
LPARAM 0, .
5.3.3.

MAPACCES.DLL:
extern C
{
long int WINAPI mapBuildMtw(HMAP hMap, const char* mtrname,
const char* txtname, BUILDMTW * mtrparm, HWND handle);
}
hMap . mtrname
. txtname
, .
a (IMH-a) pe a pa H
paa, a p a ap . txtname
, .
mtrparm . handle

. 0581.
WPARAM ( 0 100) .

0581.
BUILDMTW :
struct BUILDMTW
{
unsigned
long int StructSize;
long int Free;

// :
// sizeof (BUILDMTW)
//

double BeginX;
double BeginY;

//
// (- )

double Width;

//

90

double Height;

//

double ElemSizeMeters; //
//
long int ElemSizeBytes;

// P
// ( : 1,2,4,8)

long int Unit;

// E
// (0 - , 1 - ,
// 2 - , 3 - )

long int ReliefType;

// (0 - ,
// 1 - + )

long int UserType;

// ,
//

long int Scale;

//
// (
//
//
// )

long int HeightSuper;

//
//
// (0 - , 1 - )

long int FastBuilding;

// :
// 0 - ,
//
// 1 - ,
//
// 2 - ,
//
// 3 - ,
//

char Reserve[52];
};

//

BUILDMTW
:
StructSize ,
sizeof(BUILDMTW);
Free ;
BeginX,BeginY
(- ) ;
Width ;
Height (
Width,Height );
ElemSizeMeters
( , 20
);

91

ElemSizeBytes , 4, ..
,
;
Unit ,
; Unit : 0 - , 1 , 2 - , 3 - ;
ReliefType
ReliefType:
o 0 - , ..
,
, , ;
o 1 - ..
,
;
UserType ,
;
Scale 0,
;
HeightSuper ,

HeightSuper:
o 0 - ,
o 1 - ;
FastBuilding .
FastBuilding:
o 0 -
( - ,
,
);
o 1 -
( ,

);
o 2 -
;
o 3 -
;
Reserve .

MAPPICEX.DLL:
extern "C"
{
long int WINAPI LoadMtrOptimization(HWND handle,char* name,
char* newname, long int compressnumber,
long int flagborder);
}

handle
name
newname

- ,
- ,
-
( name),
compressnumber -

92

( 32 - ,
0 - ),
flagborder -
( 0 -
)

WM_PROGRESSBAR.
WPARAM - (0% - 100%). -
WM_PROGRESSBAR, .
WM_PROGRESSBAR maptype.h,
0x590.
LoadMtrOptimization .
MTRCREA.IMH,
.
a (IMH-a) pe a
pa H paa, a p a ap .
:
MTRFILTER;
ABSOLUTE_HEIGHT_OBJECTS;
RELATIVE_HEIGHT_OBJECTS;

HYDROGRAPHY_CONSTANT_HEIGHT_OBJECTS;

HYDROGRAPHY_VARIED_HEIGHT_OBJECTS;
ADDITIONAL;
(MTRFILTER) WHAT_IS_IT,
.

(ABSOLUTE_HEIGHT_OBJECTS)
:

ABSOLUTE_HEIGHT_CODE;
CODES (CODES=INCLUDE
, CODES=EXCLUDE
) ;
COUNT;
, CODn, n
. CODn ,
, .
(RELATIVE _HEIGHT_OBJECTS)
:

RELATIVE
_HEIGHT_CODE;
CODES (CODES=INCLUDE
, CODES=EXCLUDE
) ;
COUNT;
, CODn DEFn, n
. CODn ,
, .
DEFn
n.

93

(HYDROGRAPHY_CONSTANT_HEIGHT_OBJECTS) :
COUNT;
, CODn, n
. CODn ,
, .


(HYDROGRAPHY_ VARIED _HEIGHT_OBJECTS) :
COUNT;
, CODn, n
. CODn ,
, .

(ADDITIONAL)
:
COUNT;
,
CODnnn SIGNn, n .
CODn ,
. SIGNn ,
n.
5.3.4.
-
, . -
.TIM, .TID. ,

RSC.
2-3 MAP
( " 2011") .
,
.
- (Intel, MIPS, SPARC,
Linux, QNX, VxWorks ..).

MAP2TIM. DLL:
extern C
{
long int WINAPI SaveTimFromMap(char * namemap, char * nametim, HWND handle);
}
namemap ( MAP)
nametim ( TIM)
Handle ,
0590.
.
WPARAM = -1, LPARAM
, (, N - 37).
WPARAM 0 100
.
WPARAM = -2,
.

. , ,

94

.
,
0590.
LPARAM, WPARAM = -1.
5.3.5.

MAPVECEX.DLL.
extern C
{
long int WINAPI ModifyMap(char * namemapin, char * namemapout, long int
typeprojection, long int zone, HSELECT select,HWND handle);
}
namemapin MAP.
namemapout MAP.
typeprojection .
: (
) - 1, ( ) 2, 4,
- 7. zone
( 1 60).
-. select
. handle ,
. handle ,
. WinApi SendMessage.
0585. WPARAM ( 0 100)
, LPARAM
.
0586 (
WPARAM) ( LPARAM).
0586, WPARAM 0,
LPARAM- .
.

95

6.

6.1.
,
MAPACCES.DLL MAPAXSVC.DLL,
2011 , .
.
- ,
() . :
, , ,
.
- . : ,
, , a.
32- DLL
Windows.
.
:
extern "C"
{
long int _ export WINAPI GetInterfaceVersion()
{
return MAPACCESSVERSION; // return 0;
}
}
Visual C++, "_export"
"__declspec(dllexport)".
Delphi :
procedure GetInterfaceVersion; stdcall; export;
begin
...
end;
exports
GetInterfaceVersion;

MAPACCESS, , ,
. -
. .
MAPACCESSVERSION mapapi.h.
:
extern "C"
{
long int WINAPI CallMapFunctionEx(long int hmap, TASKPARMEX * parm);
{
...
}
}
hmap
TASKPARMEX matype.h.

96

typedef struct TASKPARMEX


{
long int Language;

//

// (1 -ENGLISH,
// 2 - RUSSIAN, ...)
HINSTANCE Resource;
//
const char * HelpName;
// ".hlp"
const char * IniName;
// ".ini"
const char * PathShell;
// (exe,dll,...)
const char * ApplicationName; //
HWND
Handle;
//
HWND
DocHandle;
// () 0
long int
StayOnTop;
// StayOnTop

}
TASKPARMEX;
2011,
,
PANAPI.
6.2. PANAPI
6.2.1.
2011

,
.
, ( ,
, ..),
"PANAPI" "MAPAPI".
Visual C++, C++ Builder, Delphi ..
"MAPAPI"
(, ), "PANAPI"
.
"PANAPI" :
, , (
).

.
"MAPAPI" "PANAPI"
MAPACCES.DLL
MAPTASK.DLL ,
. , "PANAPI" ,

.
,
.
, , .

(), (
, , . .).

(OWL, MFC, VCL . .).

Windows (long int, char, double, POINT, RECT, HDC, HWND ..)
, (HMAP, HOBJ, DOUBLEPOINT,
TASKPARM ..).

97

PASCAL .
6.2.2.
" "
:
extern "C"
{
HMAPTASK WINAPI __declspec(dllexport)
CreatePanTask(HMAPDOC hdoc,TASKPARM * parm,const char * dllname)
{
// " "
TPanTask * task = new TUserTask(hdoc,parm,dllname);
if (task->GetTaskIdent() == 0)
{
delete task;
task = 0;
}
if (task)
return task->GetTaskIdent();
return 0;
}
} // extern "C"
Delphi
.
function CreatePanTask(aMapDoc : HMAPDOC; var aParm : TTASKPARM;
const aPathName : PChar) : HMAPTASK;
var
task1 : TMyTask;
begin
task1 := TMyTask.CreatePanTask(aMapDoc, aParm, aPathName);
try
Result := task1.GetTaskIdent;
if Result = 0
then begin
task1.Free;
exit;
end;
task1.CmMyTask; //
except
on E:Exception
do begin
ShowMessage(E.Message);
Result := 0;
end;
end;
end;
HMAPTASK, HMAPDOC, TASKPARM
MAPTYPE.H.

98

TPanTask PANTASK.H, -
PANTASK.CPP. \SDK\PANTASK ,
" 2011".
TPanTask.
" "
MAPTASK.DLL,
"PANAPI".
GetTaskIdent
, "PANAPI".
.
" 2011" () .

, ( ) .
CreatePanTask,
.
, ,

(utsDeletePanTask,
utsSetFocus,
utsGetAction...),
.

2011 PANTASK.CPP,
.

( ) SetFocus.
( ,
..) ( )
ChangeData.

( ) ChangeLanguage.
,

.
.
( ) GetAction.
( ) EnableAction.
" "
.
" 2011"
( ).
( , ),
SetFocus.
"MAPAPI"
TPanTask HMap ( HMAP).

MainMessage, WINAPI- SendMessage.


TPanTask SetFocus, GetAction,
EnableAction.
, GetAction,
: ,
TPanTask , " ",
.
GetAction :
HMAPACTION TUserTask::GetAction(int comid, int run)
{
//
HMAPACTION action;

99

if ((action = TPanTask::GetAction(comid,run)) != 0)
return action;
// ,
// CM_MED_STEPSIZE - ;
// void CmStepSize(void) - , ;
// IDN_HLP_STEPSIZE - Help, F1.
SeekCommand(comid,run)
{
CheckCommand(CM_MED_STEPSIZE,CmStepSize,IDN_HLP_STEPSIZE);
}
//
// TMoveObject - , TPanAction.
SeekAction(comid,run)
{
CheckAction(CM_MED_MOVEOBJECT,TMoveObject,
IDN_HLP_MOVEOBJECT);
CheckAction(CM_MED_CREATEOBJECT,TCreateObject,
IDN_HLP_CREATEOBJECT);
}
ReturnAction();
}
Delphi :
function TMyTask.GetAction(comid : integer; run : integer) : HMAPACTION;
begin
//
case comid of
// , !!!
// ( )
//
CMB_CLOSETASK :
begin
Result := CheckCommand(run, comid, CmMyTaskCLose,
CMB_CLOSETASK_HLP);
exit;
end;
CMB_MAINFORM:
begin
Result := CheckCommand(run, comid, CmMyStatistic,
CMB_CLOSETASK_HLP);
exit;
end;
//
//
CMB_OBJ_INFO :
begin
Result := CheckAction(run, comid, TMyActionSelectInfo,
CMB_OBJ_INFO_HLP);
exit;
end;

100

end; // case comid


Result := 0;
end;
EnableAction GetAction c
"run", .
.
( ,
, ..).
- .

\SDK\MAPDB , " 2011".
MAPDB.CPP, - MAPDB.H.
6.2.3.
" "
" ". " " ,
(TPanWindow) .
TPanWindow . ,
" ", .
TPanWindow
:

;
C :
GetApplicationName - ,
GetIniName
- "ini" ,
GetMapIniName
- "ini" ,
GetHelpName
- "hlp" ,
GetLanguage
- ,
GetPanelState
- (
),
GetPathShell
- ,
GetUserName
- ,
GetDocPath
- .
, "hlp" "ini"
,
TPanWindow.

:
ChangeScale
- ,
Client2Picture -
,
Picture2Client -
,
PlaneToClient - ()
,
SetPicturePoint - ,
GetPicturePoint - ,

101


2011 :
CreateProgress
-
;
SetProgressPercent - ;
DeleteProgress
- .

:
SetSelectObject - ,
;
IsObjectSelected - ;
ClearSelect
- ;
ViewObject
- ,
, ;
ViewPlanePoint - ,
, ( ) ;
SetViewSelect
-
/ .
:
SetMessage
- "
2011";
SetWindowTitle - ;
ClearWindowTitl - ;
ViewHelp
- "HELP" "hlp"
;
PressButton
- "" ,
;
ReleaseButton - .
:
GetHandle
- (HWND) ;
GetParentHandle - (HWND)
;
GetMainHandle - (HWND)
;
GetCursorPos
- ;
GetClientRect
- ;
GetMainClientRec-
;
ScreenToClient - ;
SendMessage
- ;
PostMessage
- ;
MainMessage
-
;
Invalidate
- ;
InvalidateRect -
;
InvalidateRectPlane -
, (
);
UpdateWindow
- .
TPanWindow PANWIN.H, -
PANTASK.CPP. \SDK\PANTASK
, 2011.

102

6.2.4.
" "
" " GetAction
.
" " , TPanAction.

, GetAction . :
//
// CM_MED_MOVEOBJECT - ;
// TMoveObject - , TPanAction.
// IDN_HLP_MOVEOBJECT - Help, F1.
SeekAction(comid,run)
{
CheckAction(CM_MED_MOVEOBJECT,TMoveObject,IDN_HLP_MOVEOBJECT);
CheckAction(CM_MED_CREATEOBJECT,TCreateObject,
IDN_HLP_CREATEOBJECT);
}
CM_MED_MOVEOBJECT
TMoveObject,
TPanAction.
,
.
" "
. . CanClose.
,
. ,
Setup .

.
,
Setup .
TPanWindow - IsObjectSelected.
(HOBJ) . ,
. ,
SelectObject.

. CanSelectObject (
) CanSelectThisObject ( ).
.
, .
(
) .
(, ,
)
TPanWindow - SetSelectObject.
TPanWindow -
MapWindow.

:
KeyDown
- ;
LeftDown
- ;
LeftUp
- ;
Move
- ;
RightDown
- ;

103

RightUp
- ;
CallRightMenu-
,
;
Commit
- ( !) ,
,
,
CTRL-ENTER,
..;
Revert
- ( !) ,
CTRL
, ..;
Paint
- ,
;
ResetMessage -
;
ChangeData
- -
( , , ),
, ,
- ;

TPanTask, TPanWindow .
:
GetPicturePoint - ;
GetPlanePoint -
;
GetGeoPoint
-
, ,
;
IsGeoSupported - .
Revert
( SetSelectObject(0) TPanWindow). ,
, - Close (
) Quit ( ).
,
( Close).
,
Close. , ,
.
. ""
, CTRL-C .., .

CanRestartByButton, .

"MAPAPI".
HMap ( HMAP).
, ,
.
TPanAction PANACT.H, -
PANTASK.CPP. \SDK\PANTASK ,
" 2011".

104

6.2.5.
2011
.
, "", ,
.
,
2011.
, :

( DDB).
, 2011
:
char* userGetTaskName(long language);
:
language - (. maptype.h).
language,
.
32- .
long userGetPanelCount();
0 .
char* userGetPanelName(long panel, long language);
:
panel
- 1 ..,
language - (. maptype.h).
,
. 32-
.
long userGetPanelButtonCount(long panel);
:
panel - 1 ..
0 .
long userGetPanelButtonResID(long button, long panel);
:
button - 1 ..,
panel - 1 ..
0 .
char* userGetPanelButtonName(long number, long panel, long language);
:
button - 1 ..,
panel
- 1 ..,
language - (. maptype.h)
,
. 32-
.

105

MAPDB.CPP,
\SDK\MAPDB ,
2011.

,
2011 PANAPI
:

/ ;

..
virtual int CreateTaskPanel(int panel = 1);
:
panel (. userGetPanelCount()).

0 .
2011 ,
.
int CreatePanel(HINSTANCE hInst, const char* name);
:
hInst - ,
name - .
0 .
int InsertButton(int panelID, int bmpFace, int command, int after = 0);
:
panelID - ,
bmpFace - ,
command - , 0 - ,
after
- ,
, 0 - .

command 0 .
int DeleteButton(int panelID, int command);
:
panelID - ,
command - .
1 0
.
int MovePanel(int panelID, RECT rect, int position, int layout = 1);
:
panelID - ,
rect
- ,
position - :
0 - ;
1 - ;
2 - ;
3 - ;
4 - ;

106

layout

1 0 .
int SetButtonFace(int panelID, int command, HBITMAP bmpFace);
:
command - ,
bmpFace - .
command
panelID , panelID = 0, command 0
.
virtual int PanelCanClose(int panelID);
:
panelID - ,
2011,
panelID, .
virtual int PanelRightUp(int panelID, POINT * point);
:
panelID -
point
-
2011
panelID, ,
.
RSWEDIT.CPP,
\SDK\RSWEDIT ,
2011.
6.3.
, CallMapFunctionEx,
:
1. ( BMP 20 28
).
2. ( ) ButtonArray.
3. Hint .
4.
( \SDK\DxfToMap\Userapi.cpp).
#ifndef MAPTYPE_H
#include "maptype.h" // MAPAPI
#endif
//
int ButtonArray[1] = {100}; // 20x32 DLL
int ButtonCount = 1;
extern "C"
{
//--------------------------------------------------------------//
// language - (. maptype.h)

107

// !
//
32-
//--------------------------------------------------------------char* _export WINAPI userGetTaskName(long language)
{
if (language == ML_RUSSIAN)
return " DXF MAP";
//
else
return "Import from DXF";
}
//--------------------------------------------------------------//
//--------------------------------------------------------------long _export WINAPI userGetPanelCount()
{ return 1; }
//--------------------------------------------------------------//
// number - ( 1)
// language - (. maptype.h)
// !
//
32-
//--------------------------------------------------------------char* _export WINAPI userGetPanelName(long number, long language)
{ return userGetTaskName(language); }
//--------------------------------------------------------------//
// panel - ( 1)
//--------------------------------------------------------------long _export WINAPI userGetPanelButtonCount(long panel)
{ return ButtonCount; }
//--------------------------------------------------------------//
// number - ( 1)
// panel - ( 1)
//--------------------------------------------------------------long _export WINAPI userGetPanelButtonResID(long number, long panel)
{ return ButtonArray[0]; }
//--------------------------------------------------------------//
//--------------------------------------------------------------char* _export WINAPI userGetPanelButtonName(long number, long panel,
long language)
{ return userGetTaskName(language); }
} // extern "C"

108

7.
7.1. Visual C++
MAPAPI (
LoadLibrary, GetProcAddress, FreeLibrary) (
LIB-). LIB-,
Builder/Borland C++ Visual C++, .
. ,
gisacces.dll (gssacces.dll), gisacces.lib
(gssacces.lib) Visual C++.
MapViewer, Microsoft Visual C++,
GIS ToolKit.
H-:
MAPAPI.H, SITAPI.H ..

7.2. Visual Basic


, Microsoft Visual Basic,
MAPAPI, GISACCES.DLL.
Basic
.
:
Public hMap As Long
Type DoublePoint
X As Double
Y As Double
End Type


DOUBLEPOINT

,
Declare Function mapOpenData Lib "gisacces.dll" (ByVal name As String, _
ByVal mode%) As Long
Declare Function mapCloseData Lib "gisacces.dll" (ByVal hMap As Long) As Long
Declare Function mapView Lib "gisacces.dll" (ByVal hMap As Long, _
ByVal hwnd As Long, _
ByVal flag As Long, _
ByVal point As Long, _
ByVal place As Long) As Long
Long.
, String (ByVal).
UNICODE ANSI .
VarPtr().
:
Public WindowPoint As DoublePoint
Private Sub MapPicture_Paint()
Dim flag As Integer
flag = 0

109

WindowPoint.X = 120
WindowPoint.Y = 200


flag = mapView(hMap, MapPicture.hwnd, flag, VarPtr(WindowPoint), 2)
End Sub
MAPAPI gisacces.dll Visual Basic
.
, .
Type Taskparm
Language As Long
Resource As Long
HlpName As Long
IniName As Long
PathName As Long
TaskName As Long
HWin As Long
End Type
Type Objectform
Window As Long
Position As MapPoint
LeftTop As MapPoint
Place As Long
Mode As Long
Map As Long
End Type

'
'
'0
' Help
' INI-
'
'
'
'
' HWND
'
'
' 1 - ( )
' 1 -
' HMAP


Declare Function formSelectObject Lib "gisforms" (ByVal hObj As Long, _
ByVal mframe As Long, _
ByVal pplace As Long, _
ByVal objform As Long, _
ByVal tparm As Long) As Long
'---------------------------------------------------------' X,Y ( )
'---------------------------------------------------------Sub SelectMapObject(X As Long, Y As Long)
Dim parm As Taskparm
Dim scrpoint As MapPoint
Dim ret As Long
Dim sframe As MapDFrame
Dim objform As Objectform
If hMap = 0 Then
Exit Sub
End If
parm.HWin = fMainForm.hWnd
parm.IniName = 0

110

parm.Resource = 0
parm.Language = 0
parm.PathName = 0
parm.TaskName = 0
parm.HlpName = 0
If hObj = 0 Then
hObj = mapCreateSiteObject(hMap, hMap, 0, 0)
End If
sframe.X1 = WindowPoint.X + X - 4
sframe.Y1 = WindowPoint.Y + Y - 4
sframe.X2 = WindowPoint.X + X + 4
sframe.Y2 = WindowPoint.Y + Y + 4
scrpoint.X = X
scrpoint.Y = Y
ret = ClientToScreen(fMainForm.hWnd, VarPtr(scrpoint))
objform.Map = hMap
objform.Window = fMainForm.MapPicture.hWnd
objform.Position.X = scrpoint.X
objform.Position.Y = scrpoint.Y
objform.LeftTop.X = WindowPoint.X
objform.LeftTop.Y = WindowPoint.Y
objform.Place = 1
objform.Mode = 1
ret = formSelectObject(hObj, VarPtr(sframe), 2, VarPtr(objform), VarPtr(parm))
End Sub
7.3. Embedded Visual C++
Pocket PC 2003 (Windows CE)
eMbedded Visual C++ 4.0.
MAPAPI
mapaxlib.lib, ,
MapView .
.
. ,
C:\MapView.
\GisTool.PocketPC\MapView
.
eMbedded Visual C++ 4.0.
MapView: File\Open Workspace\MapView.vcw.
Select Active WCE Configuration POCKET PC 2003;
Select Active Configuration Win32 (WCE emulator) Debug
.
\Lib\emulatorDbg\mapaxlib.lib
(C:\MapView).
: Build\Build MapView.exe F7.
fatal error C1083: Cannot open include
file: 'mapapi.h': No such file or directory Project\Settings,
C/C++ Project Options - /I ".\include".

111

error LNK2008: "void * __cdecl


operator new(unsigned int)" (??2@YAPAXI@Z) already defined in coredll.lib(COREDLL.dll)
Project Settings General Microsoft
Foundation Classes Use MFC in a Shared DLL.
error LNK2019: unresolved external
symbol _WinMain referenced in function _WinMainCRTStartup
Project Settings Link Project Options, entry
: /entry:"wWinMainCRTStartup", /entry:"WinMainCRTStartup".
w.
Pocket PC 2003.
Build\Start Debug\Go F5.

MapView,
. GPS- .
- ,
. , C:\Maps. Emulator\Folder
Sharing. Folder Sharing Share this folder
. \\Storage Card\\,
. , MapViewApp.cpp
OnFileOpen(). .

BEGIN_MESSAGE_MAP.

ON_COMMAND(ID_FILE_OPEN,
CWinApp::OnFileOpen) ON_COMMAND(ID_FILE_OPEN, OnFileOpen).

OnFileOpen _tcsncpy(cardpath, _T("\\Storage Card\\N3702.map"),


MAX_PATH - 1); .
MapView.exe Pocket PC
2003 .
USB-
.
Microsoft ActiveSync ( 3.7 ).
MapView: File\Open Workspace\MapView.vcw.
Select Active WCE Configuration POCKET PC 2003;
Select Active Configuration Win32 (WCE ARM V4) Release
Win32 (WCE ARM V4) Debug
. Select Default Device
POCKET PC 2003 Device.
\Lib\ARMV4REL\mapaxlib.lib
(C:\MapView).
: Build\Build MapView.exe F7.

.
Microsoft ActiveSync. Explore.
.
\My Documents. Pocket PC 2003
!
(Personal, ).
Build\Start
Debug\Go F5.
MapView,
.
, .

112

7.4. .NET Framework C#


MAPAPI .NET Framework
,
,
.
, Microsoft .NET
Framework, . , ,
, .
MAPAPI.
DLL
. .NET Framework,
,
DLL.

(, , ) .
, ,
(int, float ..).
(char*
) (char**) .

.
DLL, :
1. MAPAPI;
2. System.Runtime.InteropServices;
3. MAPAPI
.
DLL DLLImport.
static
extern,
[DllImport(gisacces, CharSet = CharSet.Ansi)]
public static extern int mapOpenData(string mapname,int mode);
4. MAPAPI,
.
C#

MAPAPI .
.

MarshalAs Marshal
.
MAPAPI Interop.
, .
MAPAPI, Gisacces.dll, :
char* _MAPAPI mapGetMtrName(long int hMap, long int number);
Interop :
[DllImport(gisacces, CharSet = ChatSet.Ansi)]
private static extern IntPtr mapGetMtrName(int hMap, int number);
public static string netGetMtrName(int hMap, int number)

113

{
IntPtr ptr = mapGetMtrName(hMap, number);
if (ptr == IntPtr.Zero) return string.Empty;
return Marshal.PtrToStringAnsi(ptr);
}
C# :
string mtrName = Interop.netGetMtrName(hMap, number);
MAPAPI .
.NET Framework
.
, StringBuilder.
MAPAPI, Gisacces.dll, :
long int _MAPAPI MapSemanticValue(long int hobj, long int number, char* buff, long int
bufsize);
Interop :
[DllImport(gisacces, CharSet = CharSet.Ansi)]
private static extern int mapSemanticValue(int info, int number, StringBuilder sb, int bufsize);
public static string netSemanticValue(int hobj, int number)
{
StringBuilder sb = new StringBuilder(256);
if (mapSemanticValue(hobj, number, sb, sb.Capacity) == 0) return "";
return sb.ToString();
}
C# :
string SemValue = netSemanticValue(hobj, number);
, .

mapGetRscSemanticExByCode
Gisacces.dll. ,
.
MAPAPI :
typedef struct RSCSEMANTICEX
{
long int Code;
long int Type;
long int Reply;
long int Enable;
long int Service;
long int Reserv;
char Name[32];
char Unit[8];
double Minimum;
double Default;
double Maximum;
long int Size;

114

long int Decimal;


char ShortName[16];
}
RSCSEMANTICEX;
long int _MAPAPI mapGetRscSemanticExByCode(HRSC hRsc,RSCSEMANTICEX *
semtype, long int code);
C# :
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct RscSemantic
{
public int Code;
public int Type;
public int Reply;
public int Enable;
public int Service;
public int Reserv;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string Name;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public string Unit;
public double Minimum;
public double Default;
public double Maximum;
public int Size;
public int Decimal;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public string ShortName;
public void Init()
{
StringBuilder sName = new StringBuilder(" ", 32);
this.Name = sName.ToString();
StringBuilder sUnit = new StringBuilder(" ", 8);
this.Unit = sUnit.ToString();
StringBuilder sKey = new StringBuilder(" ", 16);
this.ShortName = sKey.ToString();
}
}
Interop :
DllImport(gisacces, CharSet = CharSet.Ansi)]
public static extern int mapGetRscSemanticExByCode(int hRsc, ref RscSemantic rscsem, int
semcode);
C# :
RscSemantic rscSemantic = new RscSemantic();
rscSemantic.Init();

Interop.mapGetRscSemanticExByCode(hRsc, ref rscSemantic, semCode);

115


DLL .NET Framework Microsoft
http://msdn.microsoft.com.
Builder C++ (gisobnet.dll,
gisdlgs.dll, gisgps.dll, gissemdb.dll, s57togis.dll).
ASP.NET
NET .
: Overflow or underflow in the arithmetic operation.
FTP-
DLL .
:
//
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int _controlfp(int value, uint mask);
//( DLL , "msvcrt.dll")
// C FTP DLL ( Builder
C++)
int fpuStatus = MapAccess._controlfp(0, 0);
// DLL
int f = MapAccess.onGetNodeByPoint(mapHandle, mapSite, hObj, ref point);
// FTP
MapAccess._controlfp(fpuStatus, 0xFFFFFFFF);
-
.NET Framework GIS WebToolKit .
7.5. Windows Mobile #
, MAPAPI-
Windows Mobile, MAPAXLIB.DLL.
Visual Studio 2005 (2008) C++.
# , .NET Framework ( ).
Windows Mobile
MAPAPI-.
C#:
.

C++. fixed unsafe.
(Project\...
Properties) Build Allow unsafe code.
unsafe private void PaintMarker()
{
PAINTPARM image;
IMGLINE line = new IMGLINE();
image.Image = (int)MAPGDI.IMG_LINE;

116

PLACEDATA pdata = new PLACEDATA();


int[] Counts = new int[8];
DOUBLEPOINT[] Points = new DOUBLEPOINT[16];
Counts[0] = 2;

Points[0].X = MarkPointPix.X;

pdata.PolyText = (IntPtr)0;
pdata.Count = 8;
fixed (DOUBLEPOINT* pPoints = &Points[0])
{
pdata.Points = (IntPtr)pPoints;
fixed (int* pCounts = &Counts[0])
{
pdata.PolyCounts = (IntPtr)pCounts;
IMGLINE* pLine = &line;
image.Parm = (IntPtr)pLine;
DOUBLEPOINT vpoint = new DOUBLEPOINT();
vpoint.X = ViewPoint.X;
vpoint.Y = ViewPoint.Y;
MapAccess.mapViewUserObject(hMap, (int)Handle, ref vpoint,
ref image, ref pdata, (int)PPLACE.PP_PICTURE);
}
}
}
.
,
. Invoke.
(delegate).
public delegate void myDelegate();
public delegate void myDelegateBool(bool value);
// Service thread for time action
public void ServiceActionByTime(Object state)
{
if ((hMap == 0) || (IsUpdateImage != 0))
return;

if (GpsPort.IsActive())
{
if (ViewGpsPosition() != 0)
Invoke((myDelegateBool)CommentPoint, true);
}
// Update gps state comment
if (IsGpsActive != GpsPort.IsActive())

117

{
Invoke((myDelegateBool)CommentPoint, true);
IsGpsActive = GpsPort.IsActive();
}
// Show marker on\off
Invoke((myDelegate)PaintMarker);
}
GPS .
, - Windows Mobile
GPS . , ,
:
// Open COM port (may be virtual port)
// portname - name of port ("COM1:")
// baudrate - baud rate of port (4800, 9600, ...)
// If the function fails, the return value is zero
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int gpsOpen(string portname, int baudrate);
// Close COM port
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int gpsClose(int hcomport);
// Request: Is gps point update?
// If the function succeeds, the return value is nonzero
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int gpsIsUpdate(int hcomport);
// Get current point in radians (WGS-84)
// Update flag is reset
// If the function fails, the return value is zero
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int gpsGetPoint(int hcomport, ref DOUBLEPOINT point,
ref double height);
public void Close()
{
if (hComport != 0)
{
MapAccess.gpsClose(hComport);
hComport = 0;
}
Place = false;
}
public bool Open()
{
Close();
Portname = MapAccess.netgpsGetDefaultGPSPort();
if (Portname.Length == 0)

118

Portname = "COM2:";
hComport = MapAccess.gpsOpen(Portname, Baudrate);
return IsActive();
}
public bool GetCurrentPoint(ref MapControl.DOUBLEPOINT point, ref double h)
{
if (!IsActive())
return false;
Place = false;
if (MapAccess.gpsIsUpdate(hComport) == 0)
return false;
if (MapAccess.gpsGetPoint(hComport, ref point, ref h) != 0)
{
Place = true;
return true;
}
return false;
}
MAPAXLIB.DLL, gpsapi.h (
Microsoft!),
.
.

, .
,
. . ,
, , MAPAPI:
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int mapCreateImage(int handle);
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern void mapCloseImage(int handle);
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int mapViewImageEx(int himage, int hwnd, ref RECT rect);
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int mapScrollImageEx(int himage, int dx, int dy, int onlymap);
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int mapDrawImageMapEx(int himage, int hmap, ref RECT rect,
ref Point position, int onlymap);
[DllImport(GisLibrary, CharSet = CharSet.Auto)]
public static extern int mapClearImageObjects(int himage, ref RECT rect);

119

Int32 hImage = 0;
...
hImage = MapAccess.mapCreateImage((int)Handle);
...
unsafe private void MyForm_Paint(object sender, PaintEventArgs e)
{
if (IsUpdateImage != 0)
{
MapRect.left = ViewPoint.X;
MapRect.right = ViewPoint.X + ClientRectangle.Width;
MapRect.top = ViewPoint.Y;
MapRect.bottom = ViewPoint.Y + ClientRectangle.Height;
// Draw map in screen buffer
// 1 update first buffer only
MapAccess.mapDrawImageMapEx(hImage, hMap, ref MapRect, 0, 1);
ViewControl(1);
IsUpdateImage = 0;
}
// Fast draw map in device screen from screen buffer (second buffer)
// Make BitBlt only
MapAccess.mapViewImageEx(hImage, (int)Handle, ref MapRect);
}
private void MapScroll(int dx, int dy)
{
if (hMap == 0)
return;
lock (this)
{
// 1 update first buffer only
// if necessary second buffer will be created
MapAccess.mapScrollImageEx(hImage, dx, dy, 1);
...
// 1 update first buffer only
MapAccess.mapDrawImageMapEx(hImage, hMap, ref TempMRect, ref
TempPoint, 1);
}
Refresh();
}
unsafe private void ViewControl(int clear)
{
if (clear != 0)
// Update second buffer !!!
MapAccess.mapClearImageObjects(hImage, 0);
// Paint controls on the map image
foreach (MapAction action in ActionList)

120

{
action.Show(hImage, hMap, SizeType);
}
}
...
MapAccess.mapCloseImage(hImage);
hImage = 0;
.
# .
++,
. .
1.
DLL ( Solution
Explorer, , Add\Existing Item).
2.

Properties. Copy to output Directory Copy
if never.

.
,
. File\Configure
Emulator Properties General Shared folder.
.
SDMMC.
7.6. PL/SQL
Oracle (Windows,
Linux, Solaris) PL/SQL MAPAPI .
Oracle DLL (SO),
MAPAPI-. CREATE LIBRARY,
Oracle
, PL/SQL
.
CREATE LIBRARY CREATE ANY LIBRARY.
:
CREATE
OR
REPLACE
'/opt/oracle/product/9ir2/lib/libmapplsql.so';

LIBRARY

LibMapPLSQL

AS

PL/SQL.
.
CREATE OR REPLACE FUNCTION mapOpenMap(m3 IN VARCHAR2, m1 IN
BINARY_INTEGER)
RETURN BINARY_INTEGER
AS EXTERNAL NAME "mapOpenMap" LIBRARY LibMapPLSQL
PARAMETERS(m3 STRING, m1 LONG);
"C", void:
CREATE OR REPLACE PROCEDURE mapCloseMap(hMap IN BINARY_INTEGER)
AS EXTERNAL NAME "mapCloseMap" LIBRARY LibMapPLSQL
PARAMETERS(hMap LONG);

121

PL/SQL "C",
. -, PL/SQL . -,
"C" " ",
- .
Linux KOI8-R. ,
"C"-: ( ) .
:
CREATE
OR
REPLACE
PROCEDURE
mapPictureToPlane(hMap
IN
BINARY_INTEGER, ptrx IN OUT DOUBLE PRECISION, ptry IN OUT DOUBLE
PRECISION)
AS EXTERNAL NAME "mapPictureToPlane" LIBRARY LibMapPLSQL
PARAMETERS(hMap LONG, ptrx BY REFERENCE DOUBLE, ptry BY
REFERENCE DOUBLE);
BY REFERENCE ,
.
PL/SQL ,
float, .
mapPaint PL/SQL .
- ,
.
GIF-
picexCreateGifFileFromMap picexCreateGifFileFromMapSel,
HMAP,

GIF-

picexCreateGifFileFromMapSel
(HSELECT). GIF-( ), - 0.
,
GIF-.

mapOpenMap(...). GIF-
picexCreateGifFileFromMap(..).
mapCloseMap(..)
:
-- C -----CREATE
OR
REPLACE
LIBRARY
LibMapPLSQL
AS
'/opt/oracle/product/9ir2/lib/libmapplsql.so';
/
--
CREATE OR REPLACE FUNCTION mapOpenMap(m3 IN VARCHAR2, m1 IN
BINARY_INTEGER)
RETURN BINARY_INTEGER
AS EXTERNAL NAME "mapOpenMap" LIBRARY LibMapPLSQL
PARAMETERS(m3 STRING, m1 LONG);
/
--
CREATE OR REPLACE PROCEDURE mapCloseMap(hMap IN BINARY_INTEGER)
AS EXTERNAL NAME "mapCloseMap" LIBRARY LibMapPLSQL
PARAMETERS(hMap LONG);
/
-- GIF-

122

CREATE OR REPLACE FUNCTION picexCreateGifFileFromMap(hMap IN


BINARY_INTEGER, leftmap IN BINARY_INTEGER, topmap IN BINARY_INTEGER,
rightmap IN BINARY_INTEGER, bottommap IN BINARY_INTEGER, namegif IN
VARCHAR2)
RETURN BINARY_INTEGER
AS EXTERNAL NAME "picexCreateGifFileFromMap" LIBRARY LibMapPLSQL
PARAMETERS(hMap LONG, leftmap LONG, topmap LONG, rightmap LONG,
bottommap LONG, namegif STRING);
/
-- C ------------
DECLARE
m1
NUMBER := 0;
hMap
BINARY_INTEGER := 0;
ret
BINARY_INTEGER := 0;
mapname VARCHAR2(256) := '/Podolsk/Podolsk.map';
--
BEGIN
--
hMap := mapOpenMap(mapname, m1);
-- GIF-
ret := picexCreateGifFileFromMap(hMap, 0, 0, 500, 700, '/tmp/example1.gif');
--
mapCloseMap(hMap);
hMap := 0;
END;
/

123

8.
8.1
2011
:
Microsoft Windows (2000, XP, Vista ..) Intel ;
Linux (Red Hat, AltLinux, ASP Linux, ..)
Intel, Mips, Sparc, ;
SUN Solaris Sparc;
QNX Intel- ( Watcom C\C++);
2000 ( ) Intel, Mips;
Windows Mobile (Pocket PC 2003, Windows CE) Intel ARM.

++.
.
8.2. Windows
Windows
.
2011 map*.dll;
GIS ToolKit gis*.dll;
GIS ToolKit Free gss*.dll.
, 2011
map*.dll. mapacces.dll, mapvecex.dll,
mappicex.dll, maprscex.dll, mapmtrex.dll
mapselec.dll, mapobj.dll, rscedit.dll, mapprint.dll, mapvectr.dll, mappictr.dll .
gis*.dll
gss*.dll ( GIS ToolKit Free).
:
gis3d.dll 3D- ,
map3dapi.h;
gisacces.dll , 90% MAPAPI; ;
gismtrex.dll ( ), gisvecex.dll (
); mapapi.h, sitapi.h, mtrapi.h,
rstapi.h, logapi.h, gpsapi.h, arealist.h, mtlapi.h, rscapi.h, seekapi.h;
gisdelon.dll ;
TIN-; trianapi.h;
gisdxf.dll DXF; gisdxf.h;
gisforms.dll ;
listapi.h; medapi.h, objapi.h, prnapi.h;
gisgps.dll GPS-;
gisgps.h;
gismath.dll ;
mathapi.h;
gismtrex.dll ;
mtrexapi.h;

124

gisobnet.dll
..; netapi.h;
gispicex.dll - \ (PCX,
TIFF, JPEG, BMP ); mappicex.h, picextrs.h;
gispictr.dll \
(PCX, TIFF, JPEG, BMP ); pictrapi.h;
gisrscex.dll
(rsc); gisacces.dll; maprscex.h;
gisscrn.dll
; mapscren.h;
gissemdb.dll DBF;
semdbase.h;
gissupp.dll
WMF; mapsupp.h;
gisvecex.dll \ SXF, TXF, DIR,
; vecexapi.h;
s57togis.dll S57;
s57tomap.h.
Windows \System32.
GIS ToolKit Free
.
GIS ToolKit Free.
.
8.3. Linux Solaris
Linux Solaris
:
libmap*.so;
GIS ToolKit Qt Designer libqd*.so
(libqdmapselec.so;
libqdmapobj.so; libqdmapacces.so, libqdmapacces16.so,
libqdmapacces24.so, libqdmapacces8.so; libqdmapvecex.so; libqdmapqtfrm.so);
GIS ToolKit Kylix Java libgis*.so
(libgisacces.so, libgisvecex.so) Linux.
, 8, 16, 24 32
(
).

Оценить