The iposdet interface can directly obtain information such as longitude and latitude. The application can transmit the information to the server and the GIS system to develop a variety of applications. The iposdet usage example is as follows:
// Create the instance for posdet
Ishell_createinstance (Pi-> A. m_pishell, aeeclsid_posdet, (void **) & (Pi-> m_pposdet ));
If (Pi-> m_pposdet ){
// Initialize the callback function
Callback_init (& Pi-> simplegpscb, simplegps_posdetcb, Pi );
// You also can get seperate information through
Iposdet_getgpsinfo (Pi-> m_pposdet, aeegps_getinfo_location | aeegps_getinfo_velocity | average, minimum, & Pi-> m_gpsinfo, & Pi-> simplegpscb );
}
Return (true );
The simplegps_posdetcb function displays the location information on the screen. The code for displaying the latitude is as follows:
// Wasfactor is the factor between aeegpsinfo and real world data.
Str_to_wstr( "186413.5111", sznum, sizeof (sznum ));
Wgsfactor = wstr_to_float (sznum );
// Display latitude on the screen
Val = integertofloat (PME-> m_gpsinfo.dwlat );
Val = fdiv (Val, wgsfactor );
Floattowstr (Val, sznum, text_buffer_size );
Str_to_wstr ("Lat:", sztext, text_buffer_size );
Wstrcat (sztext, sznum );
// Idisplay_clearscreen (PME-> A. m_pidisplay );
Idisplay_drawtext (PME-> A. m_pidisplay, // display instance
Aee_font_bold, // use bold font
Sztext, // text-normally comes from resource
-1, //-1 = use full String Length
0, // ignored-idf_align_center
32, // ignored-idf_align_middle
Null, // No clipping
Idf_align_center );