map.h File Reference

This file includes functions related with map generation. More...

#include <stdbool.h>
#include "platform.h"
Include dependency graph for map.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef bool(* ast_get_map_url_func_t) (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)
 Function prototype of getting map url. More...
 

Enumerations

enum  ast_map_zoom_t { AST_MAP_ZOOM_OVERVIEW, AST_MAP_ZOOM_DETAIL }
 

Functions

void ast_reg_callback_get_map_url (ast_get_map_url_func_t callback)
 Register callback function of ast_get_map_url_func_t. More...
 
bool ast_get_map_url_google (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)
 Map service use Google Maps. More...
 
bool ast_get_map_url_googlechina (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)
 Map service use Google Maps China. More...
 
bool ast_get_map_url_osm (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)
 Map service use Open Street Map. More...
 
bool ast_get_map_url_tencent (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)
 Map service use Tencent Map. More...
 
bool ast_get_map_url_baidu (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)
 Map service use Baidu Map. More...
 
bool ast_get_map_url_nomap (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)
 Null Map service. More...
 

Detailed Description

This file includes functions related with map generation.

Typedef Documentation

◆ ast_get_map_url_func_t

typedef bool(* ast_get_map_url_func_t) (char *url, const size_t url_size, const int width, const int height, const ast_map_zoom_t zoom, const double latitude, const double longitude)

Function prototype of getting map url.

Parameters
urlBuffer to save return url
url_sizeUrl buffer size
widthPerfered image width
heightPerfered image width
zoomMap zoom level
latitudeLatitude of map center
longitudeLongitude of map center
Returns
If map url is successfully built.

If return true, the url shall be filled with URL of the map image like http://maps.example.com/image.png.

Enumeration Type Documentation

◆ ast_map_zoom_t

Enumerator
AST_MAP_ZOOM_OVERVIEW 
AST_MAP_ZOOM_DETAIL 

Function Documentation

◆ ast_get_map_url_baidu()

bool ast_get_map_url_baidu ( char *  url,
const size_t  url_size,
const int  width,
const int  height,
const ast_map_zoom_t  zoom,
const double  latitude,
const double  longitude 
)

Map service use Baidu Map.

The text in map are in Simplified Chinese.

◆ ast_get_map_url_google()

bool ast_get_map_url_google ( char *  url,
const size_t  url_size,
const int  width,
const int  height,
const ast_map_zoom_t  zoom,
const double  latitude,
const double  longitude 
)

Map service use Google Maps.

◆ ast_get_map_url_googlechina()

bool ast_get_map_url_googlechina ( char *  url,
const size_t  url_size,
const int  width,
const int  height,
const ast_map_zoom_t  zoom,
const double  latitude,
const double  longitude 
)

Map service use Google Maps China.

◆ ast_get_map_url_nomap()

bool ast_get_map_url_nomap ( char *  url,
const size_t  url_size,
const int  width,
const int  height,
const ast_map_zoom_t  zoom,
const double  latitude,
const double  longitude 
)

Null Map service.

This is a fake map service which will always return false. No embeded map will be generated if this map service is selected.

◆ ast_get_map_url_osm()

bool ast_get_map_url_osm ( char *  url,
const size_t  url_size,
const int  width,
const int  height,
const ast_map_zoom_t  zoom,
const double  latitude,
const double  longitude 
)

Map service use Open Street Map.

◆ ast_get_map_url_tencent()

bool ast_get_map_url_tencent ( char *  url,
const size_t  url_size,
const int  width,
const int  height,
const ast_map_zoom_t  zoom,
const double  latitude,
const double  longitude 
)

Map service use Tencent Map.

The Tencent Map service covers only China, Google Maps will be called if map center is out of coverage.

◆ ast_reg_callback_get_map_url()

void ast_reg_callback_get_map_url ( ast_get_map_url_func_t  callback)

Register callback function of ast_get_map_url_func_t.