Changes between SDK version 1.1 and 1.0/1.01
Keymap SDK version 1.1 introduces some changes aimed to deliver higher level of software compatibility and portability. Change does not affect the SDK WTL UI classes.
Changes list:
CPoint removed from SDK Core and replaced by POINT
CRect removed from SDK Core and replaced by RECT
CSize removed from SDK Core and replaced by SIZE
CString removed from SDK Core and replaced by TCHAR*
CMapPoint::GetCPoint renamed to CMapPoint::GetPOINT
All API methods has input or output data as classes above also changed
Street name rendering improved
All Keymap SDK libraries now built with MD (Multi-thread DLL) and MDd (Multi-thread Debug DLL) options.
Search callback function void SearchCallback(CMapObject* pObj) changed to bool SearchCallback(CMapObject* pObj). If you want to interrupt object search, return true from SearchCallback, otherwise you must return false. See this article.
Added callback function to interrupt map rendering. By default this callback function not declared: bool (*_callbackDraw)()=NULL; To enable callback during map rendering, define your own callback function and assign _callbackDraw = &_yourFunction; If callback function returns false, SDK will continue map rendering, otherwise map rendering interrupted.
Added data import callback. This callback function provide import task progress and allows user to interrupt import operation.
With above changes, from version 1.1 you can build WTL or MFC applications with same Keymap SDK libraries. Furthermore, any GUI library can be used with the SDK without re-build the SDK.
Migration note:
Change input/ output for API methods used CPoint , CRect, CSize, CString
Change GetCPoint to GetPOINT
Change your WTL application from MT to MD and from MTd to MDd (C/C++/ Code Generation/ Runtime Library)
Deploy msvcr80.dll and msvcr80d.dll if these files missing in your devices.
View class method OnWmGpsUpdate need small change:
//in SDK v.1.01 pMap->m_strGPSInfo is CString, now replaced by pMap->m_szGPSInfo (TCHAR[512])
//pMap->m_strGPSInfo+= _T("-WGS84 convert failed");
_tcscat(pMap->m_szGPSInfo, _T("-WGS84 convert failed"));
//pMap->m_strGPSInfo+= _T("-outside");
_tcscat(pMap->m_szGPSInfo, _T("-outside"));
//Change GetCPoint to GetPOINT and change return type
//CPoint ptScr1 = pt.GetCPoint(pMap);
//CRect recScr = pMap->GetRecClient();
CPoint ptScr1(pt.GetPOINT(pMap));
CRect recScr(pMap->GetRecClient());
Main frame class needs small change in import-related code:
//CMainFrame constructor OGR2Mpl=(MplImportResult(*)(const char*, const char*, int, bool (*_callbackF)(float)))GetProcAddress(m_hImportDll,"OGR2Mpl"); Mpl2Mpl=(MplImportResult(*)(const TCHAR*, const TCHAR*, int, bool (*_callbackF)(float)))GetProcAddress(m_hImportDll,"Mpl2Mpl"); VacuumKdtree=(MplImportResult(*)(const TCHAR*, int, bool (*_callbackF)(float)))GetProcAddress(m_hImportDll,"VacuumKdtree");
//CMainFrame::OnFileImport MplImportResult iResult; #ifdef UNICODE iResult = OGR2Mpl(strFileImport, strFile, 50000, NULL); #else iResult = OGR2Mpl(dlgImport.m_szFileName,dlgExport.m_szFileName, 50000, NULL); #endif//UNICODE
To learn about using data import callback function, reference Using callback functions article.
Changes between SDK version 1.2 and 1.1
Keymap SDK version 1.2 introduces map layer transparency.