Brew advanced and proficient-3G mobile value-added business operation, customization and development-77--obtain location information in BREW (LBS application)

Source: Internet
Author: User

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 );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.