Crate libshumate

source ·
Expand description

§Rust Shumate bindings

This library contains safe Rust bindings for Shumate, a library that offers a GTK4 widget to display maps.

See also

§Example

The libshumate crate is usually renamed to shumate. You can do this globally in your Cargo.toml file:

[dependencies.shumate]
package = "libshumate"
version = "0.x.y"
use shumate::prelude::*;

use shumate::{Map};
use gtk::{Application, Box, ListBox, Orientation, ApplicationWindow};

fn main() {
    let application = Application::builder()
        .application_id("com.example.FirstShumateApp")
        .build();

    application.connect_activate(|app| {
        let content = Map::new();

        let window = ApplicationWindow::builder()
            .application(app)
            .default_width(350)
            // add content to window
            .child(&content)
            .build();
        window.show();
    });

    application.run();
}

Re-exports§

Modules§

Structs§

  • A widget displaying a compass.
  • A simple object implementing Location.
  • The base class used to retrieve tiles as [glib::Bytes][crate::glib::Bytes].
  • Represents a request to a DataSource for a tile.
  • A cache that stores and retrieves tiles from the file system. It is mainly used by TileDownloader, but can also be used by custom data sources.
  • Every layer (overlay that moves together with the map) has to inherit this class and implement its virtual methods.
  • A widget that displays license text.
  • An interface common to objects having latitude and longitude
  • The Map widget is a gtk::Widget that show and allows interaction with the user.
  • A Layer implementation that fetches tiles from a MapSource and draws them as a grid.
  • The base class for all map sources. Map sources fill Tile objects with images from various sources: a web API, for example, or a test pattern generated on demand.
  • This object allows you to hold MapSource instances, you can access a default set of sources with populate_defaults().
  • Markers represent points of interest on a map. Markers need to be placed on a layer (a MarkerLayer). Layers have to be added to a Map for the markers to show on the map.
  • Displays markers on the map. It is responsible for positioning markers correctly, marker selections and group marker operations.
  • A layer displaying line path between inserted Location objects
  • A simple variant of Marker showing the location of the point as a circle on the map.
  • Properties
  • A widget displaying a scale.
  • A ready-to-use map gtk::Widget.If you want to use your own implementation, you can look at the Map widget.
  • An object containing the details of a map feature that has been clicked. It is the argument of the symbol-clicked and symbol-clicked signals.
  • An object that represents map tiles. Tiles are loaded by a MapSource.
  • A DataSource that asynchronously downloads tiles from an online service using a given template.
  • Provides low-level access to the contents of a vector tile.
  • Reads the layers and features of a vector tile.
  • A MapSource that renders tiles from a given vector data source.
  • A collection of VectorSprites.
  • The object holding the coordinate, zoom-level, and rotation state of the current view.

Enums§

Constants§

Statics§