MapE Library PE has been designed to achieve the performance level of World leading GIS softwares. Software application powered by MapE Library Professional should easily handle hundreds thousands objects in hundreds-megabyte databases.
To achieve this, we've change the way MapE layer manages map objects. Now CMapLayer object doesn't maintain object list in memory anymore. Instead of the object list, we completely moved to database model.
Since MapE Library Professional doesn't use object list, following API functions no longer supported:
CMapLayer::GetObjectHeadPostion
CMapLayer::GetObjectTailPostion
CMapLayer::GetObjectNext
CMapLayer::GetObjectPrev
CMapLayer::SendObjectBackward
CMapLayer::SendObjectToBack
CMapLayer::BringObjectForward
CMapLayer::BringObjectToFront
CMapLayer::FindObjectByIndex
CMapLayer::GetObjectAt
CMapLayer::SwapObjects
CMapLayer::FindMapObject
Declaration of following functions has been changed:
API functions added:
If your software application deals with huge maps, migrating to MapE Library Professional is right solution. However, source code using map object iteration methods should be changed:
MapE Library Standard:
|
POSITION pos = pLayer->GetObjectHeadPostion(); while(pos != NULL) { CMapObject* pObj = pLayer->GetObjectNext(pos); // do something with pObj; } |
MapE Library Professional:
|
int iObjCount = pLayer->GetObjectCount(); for(int i=0;i<iObjCount;i++) { CMapObject* pObj = pLayer->GetObject(i); //if you doesn't need meta data, use pLayer->GetObject(i, false) // do something with pObj; // if you'd like to save changes made to pObj: pObj->Commit(); // delete object to avoid memory leak delete pObj; } // commit changes in database pLayer->Commit();
|
Method CMapLayer::GetObject(int iIndex, BOOL bLoadMetaData=true) creates a map object in memory, loads data from database and return a pointer to the memory object. You can use this pointer to modify the map object in memory, and save changes to database using CMapObject::Commit method.
Please note that calling CMapObject::Commit just temporarily saves changes in database. To save these changes permanently, use CMapLayer::Commit method.
Much more effective way of iteration and accessing map objects is direct use of SQL queries. Please contact MapESoft support for assistance.
Moreover, to get existing software applications work with MapE Library Professional Edition, please comment following line in your view class cpp file:
|
GetDocument()->UpdateAllViews(this, pItem->nSubCode, (CMapObject*) pItem->pParam1); |