ChamplainNetworkTileSource

ChamplainNetworkTileSource — A map source that downloads tile data from a web server

Functions

Properties

gint max-conns Read / Write
gboolean offline Read / Write
gchar * proxy-uri Read / Write
gchar * uri-format Read / Write / Construct
gchar * user-agent Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ChamplainMapSource
            ╰── ChamplainTileSource
                ╰── ChamplainNetworkTileSource

Description

This class is specialized for map tiles that can be downloaded from a web server. This includes all web based map services such as OpenStreetMap, Google Maps, Yahoo Maps and more. This class contains all mechanisms necessary to download tiles.

Some preconfigured network map sources are built-in this library, see ChamplainMapSourceFactory.

Functions

champlain_network_tile_source_new_full ()

ChamplainNetworkTileSource *
champlain_network_tile_source_new_full
                               (const gchar *id,
                                const gchar *name,
                                const gchar *license,
                                const gchar *license_uri,
                                guint min_zoom,
                                guint max_zoom,
                                guint tile_size,
                                ChamplainMapProjection projection,
                                const gchar *uri_format,
                                ChamplainRenderer *renderer);

Constructor of ChamplainNetworkTileSource.

Parameters

id

the map source's id

 

name

the map source's name

 

license

the map source's license

 

license_uri

the map source's license URI

 

min_zoom

the map source's minimum zoom level

 

max_zoom

the map source's maximum zoom level

 

tile_size

the map source's tile size (in pixels)

 

projection

the map source's projection

 

uri_format

the URI to fetch the tiles from, see champlain_network_tile_source_set_uri_format

 

renderer

the ChamplainRenderer used to render tiles

 

Returns

a constructed ChamplainNetworkTileSource object

Since: 0.4


champlain_network_tile_source_get_uri_format ()

const gchar *
champlain_network_tile_source_get_uri_format
                               (ChamplainNetworkTileSource *tile_source);

Default constructor of ChamplainNetworkTileSource.

Parameters

tile_source

the ChamplainNetworkTileSource

 

Returns

A URI format used for URI creation when downloading tiles. See champlain_network_tile_source_set_uri_format() for more information.

Since: 0.6


champlain_network_tile_source_set_uri_format ()

void
champlain_network_tile_source_set_uri_format
                               (ChamplainNetworkTileSource *tile_source,
                                const gchar *uri_format);

A URI format is a URI where x, y and zoom level information have been marked for parsing and insertion. There can be an unlimited number of marked items in a URI format. They are delimited by "#" before and after the variable name. There are 4 defined variable names: X, Y, Z, and TMSY for Y in TMS coordinates.

For example, this is the OpenStreetMap URI format: "https://tile.openstreetmap.org/#Z#/#X#/#Y#.png"

Parameters

tile_source

the ChamplainNetworkTileSource

 

uri_format

the URI format

 

Since: 0.4


champlain_network_tile_source_get_offline ()

gboolean
champlain_network_tile_source_get_offline
                               (ChamplainNetworkTileSource *tile_source);

Gets offline status.

Parameters

tile_source

the ChamplainNetworkTileSource

 

Returns

TRUE when the tile source is set to be offline; FALSE otherwise.

Since: 0.6


champlain_network_tile_source_set_offline ()

void
champlain_network_tile_source_set_offline
                               (ChamplainNetworkTileSource *tile_source,
                                gboolean offline);

Sets offline status.

Parameters

tile_source

the ChamplainNetworkTileSource

 

offline

TRUE when the tile source should be offline; FALSE otherwise

 

Since: 0.6


champlain_network_tile_source_get_proxy_uri ()

const gchar *
champlain_network_tile_source_get_proxy_uri
                               (ChamplainNetworkTileSource *tile_source);

Gets the proxy uri used to access network.

Parameters

tile_source

the ChamplainNetworkTileSource

 

Returns

the proxy uri

Since: 0.6


champlain_network_tile_source_set_proxy_uri ()

void
champlain_network_tile_source_set_proxy_uri
                               (ChamplainNetworkTileSource *tile_source,
                                const gchar *proxy_uri);

Override the default proxy for accessing the network.

Parameters

tile_source

the ChamplainNetworkTileSource

 

proxy_uri

the proxy uri used to access network

 

Since: 0.6


champlain_network_tile_source_get_max_conns ()

gint
champlain_network_tile_source_get_max_conns
                               (ChamplainNetworkTileSource *tile_source);

Gets the max number of allowed simultaneous connections for this tile source.

Parameters

tile_source

the ChamplainNetworkTileSource

 

Returns

the max number of allowed simultaneous connections for this tile source.

Since: 0.12.14


champlain_network_tile_source_set_max_conns ()

void
champlain_network_tile_source_set_max_conns
                               (ChamplainNetworkTileSource *tile_source,
                                gint max_conns);

Sets the max number of allowed simultaneous connections for this tile source.

Before changing this remember to verify how many simultaneous connections your tile provider allows you to make.

Parameters

tile_source

the ChamplainNetworkTileSource

 

max_conns

the number of allowed simultaneous connections

 

Since: 0.12.14


champlain_network_tile_source_set_user_agent ()

void
champlain_network_tile_source_set_user_agent
                               (ChamplainNetworkTileSource *tile_source,
                                const gchar *user_agent);

Sets the User-Agent header used communicating with the server.

Parameters

tile_source

a ChamplainNetworkTileSource

 

user_agent

A User-Agent string

 

Since: 0.12.16

Types and Values

struct ChamplainNetworkTileSource

struct ChamplainNetworkTileSource;

The ChamplainNetworkTileSource structure contains only private data and should be accessed using the provided API

Since: 0.6

Property Details

The “max-conns” property

  “max-conns”                gint

Specifies the max number of allowed simultaneous connections for this tile source.

Before changing this remember to verify how many simultaneous connections your tile provider allows you to make.

Owner: ChamplainNetworkTileSource

Flags: Read / Write

Allowed values: >= 1

Default value: 2

Since: 0.12.14


The “offline” property

  “offline”                  gboolean

Specifies whether the network tile source can access network

Owner: ChamplainNetworkTileSource

Flags: Read / Write

Default value: FALSE

Since: 0.4


The “proxy-uri” property

  “proxy-uri”                gchar *

Used to override the default proxy for accessing the network.

Owner: ChamplainNetworkTileSource

Flags: Read / Write

Default value: ""

Since: 0.4


The “uri-format” property

  “uri-format”               gchar *

The uri format of the tile source, see champlain_network_tile_source_set_uri_format

Owner: ChamplainNetworkTileSource

Flags: Read / Write / Construct

Default value: ""

Since: 0.4


The “user-agent” property

  “user-agent”               gchar *

The HTTP user agent used for requests

Owner: ChamplainNetworkTileSource

Flags: Write

Default value: "libchamplain/0.12.20"

Since: 0.12.16