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§
pub use ffi;
Modules§
- Traits intended for creating custom types.
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. - 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 withpopulate_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 aMap
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 theMap
widget. - An object containing the details of a map feature that has been clicked. It is the argument of the
symbol-clicked
andsymbol-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. - GLib type: GObject with reference counted clone semantics.
- A collection of
VectorSprite
s. - The object holding the coordinate, zoom-level, and rotation state of the current view.
Enums§
- Error codes in the #SHUMATE_FILE_CACHE_ERROR domain.
- A type of geometry.
- Projections supported by the library.
- Tile loading state.
- Error codes that occurs while parsing the style in
VectorRenderer
. - Error codes in the #SHUMATE_TILE_DOWNLOADER_ERROR domain.
- Units used by the scale.
Constants§
- The maximal possible latitude value.
- The maximal possible longitude value.
- The minimal possible latitude value.
- The minimal possible longitude value.
Statics§
- Maps for Free Relief
- OpenStreetMap Cycle Map
- OpenStreetMap Mapnik
- OpenStreetMap Transport Map
- OpenWeatherMap clouds layer
- OpenWeatherMap precipitation
- OpenWeatherMap sea level pressure
- OpenWeatherMap temperature
- OpenWeatherMap wind