The previous article introduced a simple map scaling tool to make, and then need to introduce the map data reading and loading design.
First of all, the data on the map is from the database and automatically generated, I do not use the MapInfo ado.net, but the query interface with its own system, plus a custom entity to generate map entities, and insert the MapInfo in the temporary table in the session to show.
In view of the program extensibility, I will be data acquisition, graphic element display, map display and so on separate, as far as possible to be flexible and understandable.
Data acquisition interface, I have defined only one method:
/**////<summary>
///Data provides interfaces that define the basic methods of obtaining data
///</summary> public
Interface idataprovider
{
/**////<summary>
///Get all data main methods
///</summary>
///<returns> acquired entity columns Table </returns>
list<abstractentity> GetData ();
}
This method returns the list< custom abstract entity, which represents several collections of entities that need to be displayed.
So the most important thing is to abstractentity.
In this abstract entity, I define two properties X and Y, which represent the coordinates of the entities: