Map

Accesses the information about the longitude, latitude, and address as well as adds/removes annotations.

Note: In order to load the map on the Android device, you would need to make sure the Google Play service is installed beforehand.

Usage example

  • City planning:

    Use the Street View maps to implement a better city planning and design.

  • Fire department:

    The fire control center can find out the specific position of the man who made the emergency call according to the system, and then quickly plan their arrangement to send the nearest firefighters.

  • Mountaineering:

    For mountain-climbing lovers, they can identify a location according to the known longitude and latitude and vice versa.

  • Tourism:

    By combining with GPS API, travel agencies can provide better vacation tips for the current location and season.

  • Turn-by-turn route navigation:

    Help the user navigate along a route by providing detailed turn-by-turn directions. Map API does this by registering with the GPS API to receive repeated location updates of the user's position.

eon_mobile_mapex object

Properties
eon_mobile_str_annotation istr_clickedannotation

The annotation (added by of_addannotation) that the user clicks on.

integer ii_errorcode

Error code which is returned when the oe_error event is triggered.

1 - MKErrorUnknown

2 - MKErrorServerFailure. The map service is turned off.

3 - MKErrorLoadingThrottled

4 - MKErrorPlacemarkNotFound. Address is not found.

-1 - NSURLErrorUnknown

-999 - NSURLErrorCancelled

-1001 - NSURLErrorTimedOut

-1002 - NSURLErrorCannotFindHost

-1004 - NSURLErrorCannotConnectToHost

-1005 - NSURLErrorNetworkConnectionLost

-1009 - NSURLErrorNotConnectedToInternet

string is_errortext

Error message which will be returned when the oe_error event is triggered.

Events
oe_annotationclicked

Description

This event will be automatically triggered when an annotation (added by of_addannotation) is clicked.

Supported on mobile client only.

Note: This event cannot be triggered via the code, and can only be triggered by clicking the annotation on the map.

Syntax

None.

Return value

None.

The information of the clicked annotation is stored to the istr_clickedannotation instance variable.

oe_loadstart

Description

This event will be automatically triggered when starting the loading of the map. LPARAM and WPARAM are empty.

Supported on mobile client only.

Note: This event is automatically triggered after calling the of_open function.

Syntax

None.

Return value

None.

oe_loadend

Description

This event is automatically triggered upon the successful completion of loading the map. LPARAM and WPARAM are empty.

Supported on mobile client only.

Note: This event is automatically triggered after calling the of_open function.

Syntax

None.

Return value

None.

oe_error

Description

This event is automatically triggered upon failure in loading the map. WPARAM is the error number.

Supported on mobile client only.

Note: This event is automatically triggered after calling the of_open function.

This event will update the value of is_errortext and ii_errorcode properties.

Syntax

None.

Return value

None.

oe_changed

Description

This event is automatically triggered when the map display area has changed.

Note: This event is automatically triggered after calling the of_open function.

Syntax

None.

Return value

None.

Functions
of_addannotation

Description

Adds a map annotation.

Supported on mobile client only.

Syntax

map.of_addannotation ( ref eon_mobile_str_annotation astr_annotation, value boolean ab_move )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

eon_mobile_str_annotation

astr_annotation

The annotation to be added. (For the relevant information, refer to the property of the eon_mobile_str_annotation structure.)

When the annotation is added successfully, this function will generate and store the unique identifier of the annotation to the l_id property in the structure. And the l_id property will be used when this annotation is removed or selected.

boolean

ab_move

True: To automatically move the map so as to make the new annotation visible.

False: Not to move the map.

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

Code example

eon_mobile_str_annotation istr_annotation_appeon
istr_annotation_appeon.dec_latitude= 22.54993
istr_annotation_appeon.dec_longitude = 113.94977
istr_annotation_appeon.i_pincolor = 1
istr_annotation_appeon.s_pinimage="apb.png"
istr_annotation_appeon.s_subtitle="Appeon Mobile"
istr_annotation_appeon.s_title="Appeon"
uo_map.of_addannotation(istr_annotation_appeon, true)
of_addresstocoordinate

Description

Obtains the longitude and latitude according to the address. Note: before this function is called, be sure to add an eon_mobile_mapex control and call the of_open function of this control to open the map successfully.

Supported on mobile client only.

Syntax

map.of_addresstocoordinate ( value string as_address, ref decimal dec_longitude, ref decimal adec_latitude )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

string

as_address

Address, a human-readable string to specify locations.

decimal

dec_longitude

The returned longitude, which is defined using numerals within a comma-separated text string that have a precision to 6 decimal places.

decimal

adec_latitude

The returned latitude, which is defined using numerals within a comma-separated text string that have a precision to 6 decimal places.

Return value

Integer

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

of_close

Description

Closes the default map application.

Supported on mobile client only.

Syntax

map.of_close ( )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

of_coordinatetoaddress

Description

Converts the longitude and latitude into the corresponding address. Note: before this function is called, be sure to add an eon_mobile_mapex control and call the of_open function of this control to open the map successfully.

Supported on mobile client only.

Syntax

map.of_coordinatetoaddress ( value decimal dec_longitude, value decimal adec_latitude, ref string as_address )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

decimal

dec_longitude

Longitude, which is defined using numerals within a comma-separated text string that have a precision to 6 decimal places.

decimal

adec_latitude

Latitude, which is defined using numerals within a comma-separated text string that have a precision to 6 decimal places.

string

as_address

The returned address, which is converted from longitude and latitude values.

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

of_open

Description

Opens the default map application at the specified position.

Supported on mobile client only.

Syntax

map.of_open ( value eon_mobile_str_mapoption astr_mapoption )

map.of_open ( value eon_mobile_str_mapoption astr_mapoption, ref eon_mobile_str_annotation astr_clickedannotation)

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

eon_mobile_str_mapoption

astr_mapoption

Relevant information about the map. (For the relevant information, refer to the property of the eon_mobile_str_mapoption structure.)

eon_mobile_str_annotation

astr_clickedannotation

The annotation that the user clicks on. (For the relevant information, refer to the property of the eon_mobile_str_annotation structure.)

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

Code example

eon_mobile_str_mapoption lstr_mapoption
lstr_mapoption.b_allowmove = true
lstr_mapoption.b_allowzoom = true
lstr_mapoption.b_locatetocurrentlocation = true
lstr_mapoption.i_mapaccuracy = 5
uo_map.of_open(lstr_mapoption)
of_refresh

Description

Refreshes the map according to the specified information.

Supported on mobile client only.

Syntax

map.of_refresh ( value eon_mobile_str_mapoption astr_mapoption )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

eon_mobile_str_mapoption

astr_mapoption

Relevant information about the map. (For the relevant information, refer to the property of the eon_mobile_str_mapoption structure.)

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

of_removeannotation

Description

Removes a map annotation that is added by of_addannotation.

Supported on mobile client only.

Syntax

map.of_removeannotation ( value eon_mobile_str_annotation astr_annotation )

map.of_removeannotation ( value long al_id )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

eon_mobile_str_annotation

astr_annotation

The annotation to be removed. (For the relevant information, refer to the property of the eon_mobile_str_annotation structure.)

This function will remove the annotation according to the unique identifier of the annotation stored in the l_id property of the structure.

long al_id The unique identifier of the annotation to be removed.

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

of_removeallannotation

Description

Removes all map annotations that are added by of_addannotation.

Supported on mobile client only.

Syntax

map.of_removeallannotation ( )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

of_selectannotation

Description

Selects a map annotation that is added by of_addannotation.

Supported on mobile client only.

Syntax

map.of_selectannotation ( value eon_mobile_str_annotation astr_annotation )

map.of_selectannotation ( value long al_id )

Argument Type

Argument

Description

eon_mobile_mapex

map

The name of the eon_mobile_mapex object.

eon_mobile_str_annotation

astr_annotation

The annotation to be selected. (For the relevant information, refer to the property of the eon_mobile_str_annotation structure.)

This function will select the annotation according to the unique identifier of the annotation stored in the l_id property of the structure.

long al_id The unique identifier of the annotation to be selected.

Return value

Integer.

1 - Success.

-1 - Failure or it is called in PowerBuilder or Appeon Web, or there is an error.

Structures
eon_mobile_str_mapoption

Description

Struct.

A map annotation. The user can click on the text markup.

Property

Type

Variable Name

Description

boolean

b_locatetocurrent​location

Moves to the current location.

decimal{6}

dec_longitude

The longitude of the map central location (only takes effect when the value of b_locatetocurrent​location is False).

decimal{6}

dec_latitude

The latitude of the map central location.

boolean

b_allowmove

Allows the user to move or not (the default value is True).

boolean

b_allowzoom

Allows the user to zoom or not (the default value is True).

integer

i_mapaccuracy

The map display accuracy or amplification factor (unit: meter).

integer

i_maptype

The map type (0: Map (Default), 1: Satellite, 2: Mixed).

eon_mobile_str_annotation

Description

Struct.

Relevant information about the initialized map.

Property

Type

Variable Name

Description

decimal{6}

dec_longitude

The longitude of the added or obtained annotation.

decimal{6}

dec_latitude

The latitude of the added or obtained annotation.

string

s_title

The title of the added or obtained annotation.

string

s_subtitle

The subtitle of the added or obtained annotation.

integer

i_pincolor

The pin color. Only takes effect when there is no user-defined pin icon (the supported colors are: Red = 0, Green = 1, Purple = 2).

string

s_pinimage

The pin image (If it is NULL, use the default icon).

long

l_id

The unique identifier of the annotation.