Tizen Native API  5.5

This provides APIs related to Geographical Coordinates.

Functions

int maps_coordinates_create (const double latitude, const double longitude, maps_coordinates_h *coordinates)
 Creates a new instance of Geographical Coordinates and initiates a handle with it.
int maps_coordinates_destroy (maps_coordinates_h coordinates)
 Destroys the Geographical Coordinates and releases all its resources.
int maps_coordinates_clone (const maps_coordinates_h origin, maps_coordinates_h *cloned)
 Clones the Geographical Coordinates.
int maps_coordinates_get_latitude (const maps_coordinates_h coordinates, double *latitude)
 Gets the latitude of the coordinates.
int maps_coordinates_get_longitude (const maps_coordinates_h coordinates, double *longitude)
 Gets the longitude of the coordinates.
int maps_coordinates_get_latitude_longitude (const maps_coordinates_h coordinates, double *latitude, double *longitude)
 Gets the latitude and longitude of the coordinates.
int maps_coordinates_set_latitude (maps_coordinates_h coordinates, const double latitude)
 Sets the latitude of the coordinates.
int maps_coordinates_set_longitude (maps_coordinates_h coordinates, const double longitude)
 Sets the longitude of the coordinates.
int maps_coordinates_set_latitude_longitude (maps_coordinates_h coordinates, const double latitude, const double longitude)
 Sets the latitude and longitude of the coordinates.
int maps_coordinates_list_create (maps_coordinates_list_h *coordinates_list)
 Creates a coordinates list having a set of coordinates.
int maps_coordinates_list_destroy (maps_coordinates_list_h coordinates_list)
 Frees all of the memory used by a coordinates list.
int maps_coordinates_list_append (maps_coordinates_list_h coordinates_list, maps_coordinates_h coordinates)
 Appends a coordinates to a coordinates list.
int maps_coordinates_list_remove (maps_coordinates_list_h coordinates_list, maps_coordinates_h coordinates)
 Removes a coordinates from a coordinates list.
int maps_coordinates_list_get_length (maps_coordinates_list_h coordinates_list, int *length)
 Gets the number of elements in a coordinates list.
int maps_coordinates_list_foreach (maps_coordinates_list_h coordinates_list, maps_coordinates_cb callback, void *user_data)
 Retrieves all coordinates by invoking a specific callback for each coordinates of coordinates list.

Typedefs

typedef void * maps_coordinates_h
 Handle of the Geographical Coordinates.
typedef struct _maps_coordinates_s maps_coordinates_s
 Structure of the Geographical Coordinates.
typedef void * maps_coordinates_list_h
 The coordinates list handle.
typedef bool(* maps_coordinates_cb )(int index, maps_coordinates_h coordinates, void *user_data)
 Called iteratively to get a coordinates information.

Typedef Documentation

typedef bool(* maps_coordinates_cb)(int index, maps_coordinates_h coordinates, void *user_data)

Called iteratively to get a coordinates information.

Since :
2.3.2
Parameters:
[in]indexThe index of iteration
[in]coordinatesThe handle of coordinates
[in]user_dataThe user data passed from the foreach function
Returns:
true to continue with the next iteration of the loop,
false to break out of the loop
typedef void* maps_coordinates_h

Handle of the Geographical Coordinates.

The Geographical Coordinates handle can be obtained via call of maps_coordinates_create().

Since :
2.3.2
Remarks:
To release the handle use maps_coordinates_destroy().
To clone the handle use maps_coordinates_clone().
typedef void* maps_coordinates_list_h

The coordinates list handle.

The coordinates list handle can be obtained via calling of maps_coordinates_list_create().

Since :
2.3.2

Structure of the Geographical Coordinates.

This structure represents a Geographical Coordinates, specified with a latitude and longitude values.
The latitude must be in range of [-90.0, 90.0].
The longitude must be in range of [-180.0, 180.0].

Since :
2.3.2
Remarks:
maps_coordinates_h is a void pointer to the maps_coordinates_h.
Do not use maps_coordinates_s directly if you are an application developer. Using maps_coordinates_h is recommended.
See also:
maps_coordinates_h

Function Documentation

int maps_coordinates_clone ( const maps_coordinates_h  origin,
maps_coordinates_h cloned 
)

Clones the Geographical Coordinates.

This function makes a clone of the origin Geographical Coordinates of type maps_coordinates_h.

Since :
2.3.2
Remarks:
cloned must be released using maps_coordinates_destroy().
Parameters:
[in]originThe original coordinate handle
[out]clonedA cloned coordinate handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_OUT_OF_MEMORYOut of memory
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
origin is created using maps_coordinates_create().
See also:
maps_coordinates_create()
maps_coordinates_destroy()
int maps_coordinates_create ( const double  latitude,
const double  longitude,
maps_coordinates_h coordinates 
)

Creates a new instance of Geographical Coordinates and initiates a handle with it.

This function creates coordinates, a new instance of Geographical Coordinates of type maps_coordinates_h with a specified latitude and longitude.
New handle is assigned with this instance.

Since :
2.3.2
Remarks:
coordinates must be released using maps_coordinates_destroy().
coordinates may be cloned using maps_coordinates_clone().
Parameters:
[in]latitudeThe latitude [-90.0 ~ 90.0] (degrees)
[in]longitudeThe longitude [-180.0 ~ 180.0] (degrees)
[out]coordinatesThe coordinates handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_OUT_OF_MEMORYOut of memory
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
See also:
maps_coordinates_clone()
maps_coordinates_destroy()

Destroys the Geographical Coordinates and releases all its resources.

This function destroys the Geographical Coordinates maps_coordinates_h and releases all its resources.

Since :
2.3.2
Parameters:
[in]coordinatesThe coordinate handle to destroy
Returns:
0 on coordinates, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
coordinates are created using maps_coordinates_create_rectangle().
See also:
maps_coordinates_create()
maps_coordinates_clone()
int maps_coordinates_get_latitude ( const maps_coordinates_h  coordinates,
double *  latitude 
)

Gets the latitude of the coordinates.

This function gets the latitude value of the coordinates handle.

Since :
2.3.2
Parameters:
[in]coordinatesThe coordinate handle
[out]latitudeThe latitude of the coordinate handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
coordinates are created using maps_coordinates_create().
See also:
maps_coordinates_create()
maps_coordinates_set_latitude()
int maps_coordinates_get_latitude_longitude ( const maps_coordinates_h  coordinates,
double *  latitude,
double *  longitude 
)

Gets the latitude and longitude of the coordinates.

This function gets the longitude and longitude value of the coordinates handle.

Since :
2.3.2
Parameters:
[in]coordinatesThe coordinate handle
[out]latitudeThe latitude of the coordinate handle
[out]longitudeThe longitude of the coordinate handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
coordinates are created using maps_coordinates_create().
See also:
maps_coordinates_create()
maps_coordinates_set_latitude_longitude()
int maps_coordinates_get_longitude ( const maps_coordinates_h  coordinates,
double *  longitude 
)

Gets the longitude of the coordinates.

This function gets the longitude value of the coordinates handle.

Since :
2.3.2
Parameters:
[in]coordinatesThe coordinate handle
[out]longitudeThe longitude of the coordinate handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
coordinates are created using maps_coordinates_create().
See also:
maps_coordinates_create()
maps_coordinates_set_longitude()
int maps_coordinates_list_append ( maps_coordinates_list_h  coordinates_list,
maps_coordinates_h  coordinates 
)

Appends a coordinates to a coordinates list.

Since :
2.3.2
Parameters:
[in]coordinates_listThe coordinates list handle
[in]coordinatesThe coordinates handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_OUT_OF_MEMORYOut of memory
MAPS_ERROR_NOT_SUPPORTEDNot supported
See also:
maps_coordinates_list_create()
maps_coordinates_list_destroy()

Creates a coordinates list having a set of coordinates.

Since :
2.3.2
Parameters:
[out]coordinates_listThe coordinates list handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_OUT_OF_MEMORYOut of memory
MAPS_ERROR_NOT_SUPPORTEDNot supported
See also:
maps_coordinates_list_destroy()

Frees all of the memory used by a coordinates list.

Since :
2.3.2
Parameters:
[in]coordinates_listThe coordinates list handle
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
See also:
maps_coordinates_list_create()
int maps_coordinates_list_foreach ( maps_coordinates_list_h  coordinates_list,
maps_coordinates_cb  callback,
void *  user_data 
)

Retrieves all coordinates by invoking a specific callback for each coordinates of coordinates list.

Since :
2.3.2
Parameters:
[in]coordinates_listThe coordinates list handle
[in]callbackThe iteration callback
[in]user_dataThe user data to be passed to the callback function
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
See also:
maps_coordinates_list_create()
maps_coordinates_list_destroy()
maps_coordinates_list_get_length()
int maps_coordinates_list_get_length ( maps_coordinates_list_h  coordinates_list,
int *  length 
)

Gets the number of elements in a coordinates list.

Since :
2.3.2
Parameters:
[in]coordinates_listThe coordinates list handle
[out]lengthThe number of elements in the coordinates list
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
See also:
maps_coordinates_list_create()
maps_coordinates_list_destroy()
int maps_coordinates_list_remove ( maps_coordinates_list_h  coordinates_list,
maps_coordinates_h  coordinates 
)

Removes a coordinates from a coordinates list.

Since :
2.3.2
Parameters:
[in]coordinates_listThe coordinates list handle
[in]coordinatesThe coordinates handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
See also:
maps_coordinates_list_create()
maps_coordinates_list_destroy()
int maps_coordinates_set_latitude ( maps_coordinates_h  coordinates,
const double  latitude 
)

Sets the latitude of the coordinates.

This function sets the latitude value of the coordinates handle.

Since :
2.3.2
Parameters:
[in]coordinatesThe coordinate handle
[in]latitudeThe latitude of the coordinate handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
coordinates are created using maps_coordinates_create().
See also:
maps_coordinates_create()
maps_coordinates_get_latitude()
int maps_coordinates_set_latitude_longitude ( maps_coordinates_h  coordinates,
const double  latitude,
const double  longitude 
)

Sets the latitude and longitude of the coordinates.

This function sets the latitude and latitude value of the coordinates handle.

Since :
2.3.2
Parameters:
[in]coordinatesThe coordinates handle
[in]latitudeThe latitude [-90.0 ~ 90.0] (degrees)
[in]longitudeThe longitude [-180.0 ~ 180.0] (degrees)
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
coordinates are created using maps_coordinates_create().
See also:
maps_coordinates_create()
maps_coordinates_get_latitude_longitude()
int maps_coordinates_set_longitude ( maps_coordinates_h  coordinates,
const double  longitude 
)

Sets the longitude of the coordinates.

This function sets the longitude value of the coordinates handle.

Since :
2.3.2
Parameters:
[in]coordinatesThe coordinate handle
[out]longitudeThe longitude of the coordinate handle
Returns:
0 on success, otherwise a negative error value
Return values:
MAPS_ERROR_NONESuccessful
MAPS_ERROR_INVALID_PARAMETERInvalid parameter
MAPS_ERROR_NOT_SUPPORTEDNot supported
Precondition:
coordinates are created using maps_coordinates_create().
See also:
maps_coordinates_create()
maps_coordinates_get_longitude()