OsmGpsMap

OsmGpsMap — The map display widget

Stability Level

Stable, unless otherwise indicated

Functions

Properties

gboolean auto-center Read / Write / Construct
gfloat auto-center-threshold Read / Write / Construct
gboolean auto-download Read / Write / Construct
gint drag-limit Read / Write / Construct Only
gint gps-track-highlight-radius Read / Write / Construct
gint gps-track-point-radius Read / Write / Construct
gfloat gps-track-width Read / Write / Construct
gchar * image-format Read / Write / Construct Only
gfloat latitude Read
gfloat longitude Read
gint map-source Read / Write / Construct
gint map-x Read / Write / Construct Only
gint map-y Read / Write / Construct Only
gint max-zoom Read / Write / Construct Only
gint min-zoom Read / Write / Construct Only
gchar * proxy-uri Read / Write / Construct Only
gboolean record-trip-history Read / Write / Construct
gchar * repo-uri Read / Write / Construct Only
gboolean show-gps-point Read / Write / Construct
gboolean show-trip-history Read / Write / Construct
gchar * tile-cache Read / Write / Construct
gchar * tile-cache-base Read / Write / Construct Only
gint tile-zoom-offset Read / Write / Construct Only
gint tiles-queued Read
gchar * user-agent Read / Write / Construct
gint zoom Read / Write / Construct Only

Signals

void changed Run First

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkDrawingArea
                ╰── OsmGpsMap

Implemented Interfaces

OsmGpsMap implements AtkImplementorIface and GtkBuildable.

Includes

#include <osm-gps-map.h>

Description

OsmGpsMap is a widget for displaying a map, optionally overlaid with a track(s) of GPS co-ordinates, images, points of interest or on screen display controls. OsmGpsMap downloads (and caches for offline use) map data from a number of websites, including

OpenStreetMap

Example 1. Showing a map

1
2
3
4
5
6
7
8
9
10
11
12
13
int main (int argc, char **argv)
{
    g_thread_init(NULL);
    gtk_init (&argc, &argv);

    GtkWidget *map = osm_gps_map_new ();
    GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_container_add (GTK_CONTAINER(w), map);
    gtk_widget_show_all (w);

    gtk_main ();
    return 0;
}

OsmGpsMap allows great flexibility in customizing how the map tiles are cached, see “tile-cache-base” and “tile-cache” for more information.

A number of different map sources are supported, see OsmGpsMapSource_t. The default source, OSM_GPS_MAP_SOURCE_OPENSTREETMAP always works. Other sources, particular those from proprietary providers may work occasionally, and then cease to work. To check if a source is supported for the given version of this library, call osm_gps_map_source_is_valid().

Example 2. Map with custom source and cache dir

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
int main (int argc, char **argv)
{
    g_thread_init(NULL);
    gtk_init (&argc, &argv);
    OsmGpsMapSource_t source = OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_SATELLITE;

    if ( !osm_gps_map_source_is_valid(source) )
        return 1;

    GtkWidget *map = g_object_new (OSM_TYPE_GPS_MAP,
                     "map-source", source,
                     "tile-cache", "/tmp/",
                      NULL);
    GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_container_add (GTK_CONTAINER(w), map);
    gtk_widget_show_all (w);

    gtk_main ();
    return 0;
}

Finally, if you wish to use a custom map source not supported by OsmGpsMap, such as a custom map created with

CloudMade

then you can also pass a specially formatted string to “repo-uri”.

Example 3. Map using custom CloudMade map and on screen display

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
int main (int argc, char **argv)
{
    g_thread_init(NULL);
    gtk_init (&argc, &argv);
    const gchar *cloudmate = "http://a.tile.cloudmade.com/YOUR_API_KEY/1/256/#Z/#X/#Y.png";

    GtkWidget *map = g_object_new (OSM_TYPE_GPS_MAP,
                     "repo-uri", cloudmate,
                      NULL);
    OsmGpsMapOsd *osd = osm_gps_map_osd_new ();
    GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    osm_gps_map_layer_add (OSM_GPS_MAP(map), OSM_GPS_MAP_LAYER(osd));
    gtk_container_add (GTK_CONTAINER(w), map);
    gtk_widget_show_all (w);

    gtk_main ();
    return 0;
}

Functions

osm_gps_map_get_default_cache_directory ()

gchar *
osm_gps_map_get_default_cache_directory
                               (void);

Returns (transfer full): the default cache directory for the library, that is the base directory to which the full cache path is appended. If “tile-cache-base” is omitted from the constructor then this value is used.


osm_gps_map_source_get_friendly_name ()

const char *
osm_gps_map_source_get_friendly_name (OsmGpsMapSource_t source);

Get friendly name for source

Parameters

source

a OsmGpsMapSource_t source id.

[in]

Returns

Nice printable source name

Since: 0.7.0


osm_gps_map_source_get_repo_uri ()

const char *
osm_gps_map_source_get_repo_uri (OsmGpsMapSource_t source);

Get repository URI address for the source

Parameters

source

a OsmGpsMapSource_t source id.

[in]

Returns

Source repo URI

Since: 0.7.0


osm_gps_map_source_get_image_format ()

const char *
osm_gps_map_source_get_image_format (OsmGpsMapSource_t source);

Get tile image format for the source

Parameters

source

a OsmGpsMapSource_t source id.

[in]

Returns

source tile image format

Since: 0.7.0


osm_gps_map_source_get_min_zoom ()

int
osm_gps_map_source_get_min_zoom (OsmGpsMapSource_t source);

Get minimum zoom level for the source

Parameters

source

a OsmGpsMapSource_t source id.

[in]

Returns

source minimum zoom level

Since: 0.7.0


osm_gps_map_source_get_max_zoom ()

int
osm_gps_map_source_get_max_zoom (OsmGpsMapSource_t source);

Get maximum zoom level for the source

Parameters

source

a OsmGpsMapSource_t source id.

[in]

Returns

source maximum zoom level

Since: 0.7.0


osm_gps_map_source_is_valid ()

gboolean
osm_gps_map_source_is_valid (OsmGpsMapSource_t source);

Check whether source is considered valid

Parameters

source

a OsmGpsMapSource_t source id.

[in]

Returns

Validity of the source (whether repo uri is not null)

Since: 0.7.0


osm_gps_map_new ()

GtkWidget *
osm_gps_map_new (void);

Returns a new OsmGpsMap object, defaults to showing data from

OpenStreetMap

See the properties description for more information about construction parameters than could be passed to g_object_new()

Returns

a newly created OsmGpsMap object.

[transfer full]


osm_gps_map_download_maps ()

void
osm_gps_map_download_maps (OsmGpsMap *map,
                           OsmGpsMapPoint *pt1,
                           OsmGpsMapPoint *pt2,
                           int zoom_start,
                           int zoom_end);

Downloads all tiles over the supplied zoom range in the rectangular region specified by pt1 (north west corner) to pt2 (south east corner)

Parameters

map

a OsmGpsMap widget

 

pt1

nort west corner.

[in]

pt2

south east corner.

[in]

zoom_start

start of zoom range.

[in]

zoom_end

end of zoom range.

[in]

osm_gps_map_download_cancel_all ()

void
osm_gps_map_download_cancel_all (OsmGpsMap *map);

Cancels all tiles currently being downloaded. Typically used if you wish to cacel a large number of tiles queued using osm_gps_map_download_maps()

Parameters

map

a OsmGpsMap widget

 

Since: 0.7.0


osm_gps_map_get_bbox ()

void
osm_gps_map_get_bbox (OsmGpsMap *map,
                      OsmGpsMapPoint *pt1,
                      OsmGpsMapPoint *pt2);

Returns the geographic locations of the bounding box describing the contents of the current window, i.e the top left and bottom right corners.

Parameters

map

a OsmGpsMap widget

 

pt1

point to be filled with the top left location.

[out]

pt2

point to be filled with the bottom right location.

[out]

osm_gps_map_set_center ()

void
osm_gps_map_set_center (OsmGpsMap *map,
                        float latitude,
                        float longitude);

Set map center, does not change zoom level

Parameters

map

a OsmGpsMap widget

 

latitude

latitude in degrees

 

longitude

longitude in degrees

 

osm_gps_map_set_center_and_zoom ()

void
osm_gps_map_set_center_and_zoom (OsmGpsMap *map,
                                 float latitude,
                                 float longitude,
                                 int zoom);

Set map center and desired zoom level

Parameters

map

a OsmGpsMap widget

 

latitude

latitude in degrees

 

longitude

longitude in degrees

 

zoom

desired zoom level

 

Since: 0.7.0


osm_gps_map_set_zoom ()

int
osm_gps_map_set_zoom (OsmGpsMap *map,
                      int zoom);

Set map zoom to the desired zoom level

Parameters

map

a OsmGpsMap widget

 

zoom

Desired zoom level.

[in]

Returns

zoom level


osm_gps_map_zoom_in ()

int
osm_gps_map_zoom_in (OsmGpsMap *map);

Zoom in by 1 step

Parameters

map

a OsmGpsMap widget

 

Returns

zoom level


osm_gps_map_zoom_out ()

int
osm_gps_map_zoom_out (OsmGpsMap *map);

Zoom out by 1 step

Parameters

map

a OsmGpsMap widget

 

Returns

zoom level


osm_gps_map_scroll ()

void
osm_gps_map_scroll (OsmGpsMap *map,
                    gint dx,
                    gint dy);

Scrolls the map by dx , dy pixels (positive north, east)

Parameters

map

a OsmGpsMap widget

 

dx

pixels to scroll in NS (positive: scroll nort, negative: scroll south)

 

dy

pixels to scroll in EW (positive: scroll east, negative: scroll west)

 

osm_gps_map_get_scale ()

float
osm_gps_map_get_scale (OsmGpsMap *map);

Get the scale of the map at the center, in meters/pixel.

Parameters

map

a OsmGpsMap widget

 

Returns

the scale of the map at the center, in meters/pixel.


osm_gps_map_set_keyboard_shortcut ()

void
osm_gps_map_set_keyboard_shortcut (OsmGpsMap *map,
                                   OsmGpsMapKey_t key,
                                   guint keyval);

Associates a keyboard shortcut with the supplied keyval (as returned by gdk_keyval_from_name or simiar). The action given in key will be triggered when the corresponding keyval is pressed. By default no keyboard shortcuts are associated.

Parameters

map

a OsmGpsMap widget

 

key

a OsmGpsMapKey_t

 

keyval

a keyval to bind

 

osm_gps_map_get_event_location ()

OsmGpsMapPoint *
osm_gps_map_get_event_location (OsmGpsMap *map,
                                GdkEventButton *event);

A convenience function for getting the geographic location of events, such as mouse clicks, on the map

Free returned point with g_free

Parameters

map

a OsmGpsMap widget

 

event

A GtkEventButton that occured on the map

 

Returns

The point on the globe corresponding to the click.

[transfer full]

Since: 0.7.0


osm_gps_map_convert_geographic_to_screen ()

void
osm_gps_map_convert_geographic_to_screen
                               (OsmGpsMap *map,
                                OsmGpsMapPoint *pt,
                                gint *pixel_x,
                                gint *pixel_y);

Convert the given location on the globe to the corresponding pixel locations on the map.

Parameters

map

a OsmGpsMap widget

 

pt

location

 

pixel_x

pixel location on map, x axis.

[out]

pixel_y

pixel location on map, y axis.

[out]

Since: 0.7.0


osm_gps_map_convert_screen_to_geographic ()

void
osm_gps_map_convert_screen_to_geographic
                               (OsmGpsMap *map,
                                gint pixel_x,
                                gint pixel_y,
                                OsmGpsMapPoint *pt);

Convert the given pixel location on the map into corresponding location on the globe

Parameters

map

a OsmGpsMap widget

 

pixel_x

pixel location on map, x axis

 

pixel_y

pixel location on map, y axis

 

pt

location.

[out]

Since: 0.7.0


osm_gps_map_gps_add ()

void
osm_gps_map_gps_add (OsmGpsMap *map,
                     float latitude,
                     float longitude,
                     float heading);

Set current GPS point to given lat/lon point with given heading. If record-trip-history is set, add point to trip history

Parameters

map

a OsmGpsMap widget

 

latitude

latitude in degrees

 

longitude

longitude in degrees

 

heading

GPS degrees or OSM_GPS_MAP_INVALID to disable showing heading

 

Since: 0.7.0


osm_gps_map_gps_clear ()

void
osm_gps_map_gps_clear (OsmGpsMap *map);

Clear GPS track history

Parameters

map

a OsmGpsMap widget

 

Since: 0.7.0


osm_gps_map_gps_get_track ()

OsmGpsMapTrack *
osm_gps_map_gps_get_track (OsmGpsMap *map);

Get internal GPS track history

Parameters

map

a OsmGpsMap widget

 

Returns

The OsmGpsMapTrack of the internal GPS track, i.e. that which is modified when calling osm_gps_map_gps_add(). You must not free this.

[transfer none]

Since: 0.7.0


osm_gps_map_track_add ()

void
osm_gps_map_track_add (OsmGpsMap *map,
                       OsmGpsMapTrack *track);

Add a track to map

Parameters

map

a OsmGpsMap widget

 

track

a OsmGpsMapTrack object

 

Since: 0.7.0


osm_gps_map_track_remove ()

gboolean
osm_gps_map_track_remove (OsmGpsMap *map,
                          OsmGpsMapTrack *track);

Remove given track from map

Parameters

map

a OsmGpsMap widget

 

track

a OsmGpsMapTrack object

 

Since: 0.7.0


osm_gps_map_track_remove_all ()

void
osm_gps_map_track_remove_all (OsmGpsMap *map);

Remove all tracks

Parameters

map

a OsmGpsMap widget

 

Since: 0.7.0


osm_gps_map_image_add ()

OsmGpsMapImage *
osm_gps_map_image_add (OsmGpsMap *map,
                       float latitude,
                       float longitude,
                       GdkPixbuf *image);

Creates OsmGpsMapImage with given params and adds it to map images

Parameters

map

a OsmGpsMap widget

 

latitude

latitude in degrees

 

longitude

longitude in degrees

 

image

Image pixbuf.

[in]

Returns

A OsmGpsMapImage representing the added pixbuf.

[transfer full]

Since: 0.7.0


osm_gps_map_image_add_with_alignment ()

OsmGpsMapImage *
osm_gps_map_image_add_with_alignment (OsmGpsMap *map,
                                      float latitude,
                                      float longitude,
                                      GdkPixbuf *image,
                                      float xalign,
                                      float yalign);

Creates OsmGpsMapImage with given params and adds it to map images

Parameters

map

a OsmGpsMap widget

 

latitude

latitude in degrees

 

longitude

longitude in degrees

 

image

Image pixbuf.

[in]

xalign

x-align of image

 

yalign

y-align of image

 

Returns

A OsmGpsMapImage representing the added pixbuf.

[transfer full]

Since: 0.7.0


osm_gps_map_image_remove ()

gboolean
osm_gps_map_image_remove (OsmGpsMap *map,
                          OsmGpsMapImage *image);

Remove image from list of images

Parameters

map

a OsmGpsMap widget

 

image

a OsmGpsMapImage to remove.

[in]

Returns

true if image was on list of images

Since: 0.7.0


osm_gps_map_image_remove_all ()

void
osm_gps_map_image_remove_all (OsmGpsMap *map);

Remove all images from map

Parameters

map

a OsmGpsMap widget

 

Since: 0.7.0


osm_gps_map_layer_add ()

void
osm_gps_map_layer_add (OsmGpsMap *map,
                       OsmGpsMapLayer *layer);

Add layer to map

Parameters

map

a OsmGpsMap widget

 

layer

a OsmGpsMapLayer object

 

Since: 0.7.0


osm_gps_map_layer_remove ()

gboolean
osm_gps_map_layer_remove (OsmGpsMap *map,
                          OsmGpsMapLayer *layer);

Remove layer from map

Parameters

map

a OsmGpsMap widget

 

layer

a OsmGpsMapLayer object

 

Returns

whether layer was found and removed

Since: 0.7.0


osm_gps_map_layer_remove_all ()

void
osm_gps_map_layer_remove_all (OsmGpsMap *map);

Remove all layers from map

Parameters

map

a OsmGpsMap widget

 

Since: 0.7.0

Types and Values

struct OsmGpsMap

struct OsmGpsMap;

struct OsmGpsMapClass

struct OsmGpsMapClass {
    GtkDrawingAreaClass parent_class;

    void (*draw_gps_point) (OsmGpsMap *map, cairo_t *cr);
};

OSM_GPS_MAP_INVALID

#define OSM_GPS_MAP_INVALID         (0.0/0.0)

OSM_GPS_MAP_CACHE_DISABLED

#define OSM_GPS_MAP_CACHE_DISABLED  "none://"

OSM_GPS_MAP_CACHE_AUTO

#define OSM_GPS_MAP_CACHE_AUTO      "auto://"

OSM_GPS_MAP_CACHE_FRIENDLY

#define OSM_GPS_MAP_CACHE_FRIENDLY  "friendly://"

enum OsmGpsMapSource_t

Members

OSM_GPS_MAP_SOURCE_NULL

   

OSM_GPS_MAP_SOURCE_OPENSTREETMAP

   

OSM_GPS_MAP_SOURCE_OPENSTREETMAP_RENDERER

   

OSM_GPS_MAP_SOURCE_OPENAERIALMAP

   

OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE

   

OSM_GPS_MAP_SOURCE_OPENCYCLEMAP

   

OSM_GPS_MAP_SOURCE_OSM_PUBLIC_TRANSPORT

   

OSM_GPS_MAP_SOURCE_GOOGLE_STREET

   

OSM_GPS_MAP_SOURCE_GOOGLE_SATELLITE

   

OSM_GPS_MAP_SOURCE_GOOGLE_HYBRID

   

OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_STREET

   

OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_SATELLITE

   

OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_HYBRID

   

OSM_GPS_MAP_SOURCE_OSMC_TRAILS

   

OSM_GPS_MAP_SOURCE_LAST

   

enum OsmGpsMapKey_t

Members

OSM_GPS_MAP_KEY_FULLSCREEN

   

OSM_GPS_MAP_KEY_ZOOMIN

   

OSM_GPS_MAP_KEY_ZOOMOUT

   

OSM_GPS_MAP_KEY_UP

   

OSM_GPS_MAP_KEY_DOWN

   

OSM_GPS_MAP_KEY_LEFT

   

OSM_GPS_MAP_KEY_RIGHT

   

OSM_GPS_MAP_KEY_MAX

   

Property Details

The “auto-center” property

  “auto-center”              gboolean

map auto center.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Default value: TRUE


The “auto-center-threshold” property

  “auto-center-threshold”    gfloat

the amount of the window the gps point must move before auto centering.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 0.25


The “auto-download” property

  “auto-download”            gboolean

map auto download.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Default value: TRUE


The “drag-limit” property

  “drag-limit”               gint

The number of pixels the user has to move the pointer in order to start dragging.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Allowed values: >= 0

Default value: 10


The “gps-track-highlight-radius” property

  “gps-track-highlight-radius” gint

The radius of the gps point highlight circle.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 20


The “gps-track-point-radius” property

  “gps-track-point-radius”   gint

The radius of the gps point inner circle.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 5


The “gps-track-width” property

  “gps-track-width”          gfloat

The width of the lines drawn for the gps track.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Allowed values: [1,100]

Default value: 4


The “image-format” property

  “image-format”             gchar *

The map source tile repository image format (jpg, png).

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Default value: "png"


The “latitude” property

  “latitude”                 gfloat

Latitude in degrees.

Owner: OsmGpsMap

Flags: Read

Allowed values: [-90,90]

Default value: 0


The “longitude” property

  “longitude”                gfloat

Longitude in degrees.

Owner: OsmGpsMap

Flags: Read

Allowed values: [-180,180]

Default value: 0


The “map-source” property

  “map-source”               gint

A OsmGpsMapSource_t representing the tile repository to use

If you do not wish to use the default map tiles (provided by OpenStreeMap) it is recommened that you set this property at construction, instead of setting “repo-uri”.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “map-x” property

  “map-x”                    gint

Initial map x location.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Default value: 890


The “map-y” property

  “map-y”                    gint

Initial map y location.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Default value: 515


The “max-zoom” property

  “max-zoom”                 gint

Maximum zoom level.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Allowed values: [0,20]

Default value: 20


The “min-zoom” property

  “min-zoom”                 gint

Minimum zoom level.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Allowed values: [0,20]

Default value: 1


The “proxy-uri” property

  “proxy-uri”                gchar *

HTTP proxy uri or NULL.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Default value: NULL


The “record-trip-history” property

  “record-trip-history”      gboolean

should all gps points be recorded in a trip history.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Default value: TRUE


The “repo-uri” property

  “repo-uri”                 gchar *

A URI string which defines the location and format to fetch tiles for the map. The string is of the format "http://tile.openstreetmap.org/#Z/#X/#Y.png". Characters that begin with # are treated as tokens and replaced according to the following rules;

  • #X - X-tile, slippy map format

  • #Y - Y-tile, slippy map format, mercator projection

  • #Z - Zoom level, where min_zoom >= zoom <= max_zoom

  • #S - Zoom level, where -max_zoom >= (zoom-max_zoom) <= min_zoom

  • #Q - Quad tree format, set of "qrts"

  • #Q0 - Quad tree format, set of "0123"

  • #YS - Not Implemented

  • #R - Random integer in range [0,4]

If you do not wish to use the default map tiles (provided by OpenStreeMap) it is recommened that you use one of the predefined map sources, and thus you should construct the map by setting “map-source” and not “repo-uri”. The “repo-uri” property is primarily designed for applications that wish complete control of tile repository management, or wish to use OsmGpsMap with a tile repository it does not explicitly support.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Default value: "https://tile.openstreetmap.org/#Z/#X/#Y.png"


The “show-gps-point” property

  “show-gps-point”           gboolean

Controls whether the current gps point is shown on the map. Note that for derived classes that implement the draw_gps_point vfunc, if this property is FALSE

Owner: OsmGpsMap

Flags: Read / Write / Construct

Default value: TRUE


The “show-trip-history” property

  “show-trip-history”        gboolean

should the recorded trip history be shown on the map.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Default value: TRUE


The “tile-cache” property

  “tile-cache”               gchar *

Either a full path or one of the special format URIs OSM_GPS_MAP_CACHE_DISABLED, OSM_GPS_MAP_CACHE_AUTO, OSM_GPS_MAP_CACHE_FRIENDLY. Also see “tile-cache-base” for a full understanding.

OSM_GPS_MAP_CACHE_DISABLED disables the on disk tile cache (so all tiles are fetched from the network. OSM_GPS_MAP_CACHE_AUTO causes the tile cache to be /tile-cache-base/md5(repo-uri), where md5 is the md5sum of “repo-uri”. OSM_GPS_MAP_CACHE_FRIENDLY causes the tile cache to be /tile-cache-base/friendlyname(repo-uri).

Any other string is interpreted as a local path, i.e. /path/to/cache

Owner: OsmGpsMap

Flags: Read / Write / Construct

Default value: "auto://"


The “tile-cache-base” property

  “tile-cache-base”          gchar *

The base directory of the tile cache when you have constructed the map with “tile-cache” set to OSM_GPS_MAP_CACHE_AUTO or OSM_GPS_MAP_CACHE_FRIENDLY

The string is interpreted as a local path, i.e. /path/to/cache. If NULL is supplied, map tiles are cached starting in the users cache directory, (as outlined in the

XDG Base Directory Specification). To get the

base directory where map tiles will be cached call osm_gps_map_get_default_cache_directory()

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Default value: NULL


The “tile-zoom-offset” property

  “tile-zoom-offset”         gint

Number of zoom-levels to upsample tiles.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Allowed values: [0,10]

Default value: 0


The “tiles-queued” property

  “tiles-queued”             gint

The number of tiles currently waiting to download. Connect to ::notify::tiles-queued if you want to be informed when this changes

Owner: OsmGpsMap

Flags: Read

Default value: 0


The “user-agent” property

  “user-agent”               gchar *

The default user-agent for downloading tiles from the “map-source” is "libosmgpsmap/VERSION". The value of “user-agent” will be appended to it.

Owner: OsmGpsMap

Flags: Read / Write / Construct

Default value: NULL

Since: 1.2.0


The “zoom” property

  “zoom”                     gint

The map zoom level. Connect to ::notify::zoom if you want to be informed when this changes.

Owner: OsmGpsMap

Flags: Read / Write / Construct Only

Allowed values: [0,20]

Default value: 3

Signal Details

The “changed” signal

void
user_function (OsmGpsMap *osmgpsmap,
               gpointer   user_data)

The “changed” signal is emitted any time the map zoom or map center is chaged (such as by dragging or zooming).

If you are only interested in the map zoom, then you can simply connect to ::notify::zoom

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run First