Skip to main content

MapSourceExt

Trait MapSourceExt 

Source
pub trait MapSourceExt: IsA<MapSource> + 'static {
Show 35 methods // Provided methods fn fill_tile_async<P: FnOnce(Result<(), Error>) + 'static>( &self, tile: &Tile, cancellable: Option<&impl IsA<Cancellable>>, callback: P, ) { ... } fn fill_tile_future( &self, tile: &Tile, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>> { ... } fn column_count(&self, zoom_level: u32) -> u32 { ... } fn id(&self) -> Option<GString> { ... } fn latitude(&self, zoom_level: f64, y: f64) -> f64 { ... } fn license(&self) -> Option<GString> { ... } fn license_uri(&self) -> Option<GString> { ... } fn longitude(&self, zoom_level: f64, x: f64) -> f64 { ... } fn max_zoom_level(&self) -> u32 { ... } fn meters_per_pixel( &self, zoom_level: f64, latitude: f64, longitude: f64, ) -> f64 { ... } fn min_zoom_level(&self) -> u32 { ... } fn name(&self) -> Option<GString> { ... } fn projection(&self) -> MapProjection { ... } fn row_count(&self, zoom_level: u32) -> u32 { ... } fn tile_size(&self) -> u32 { ... } fn tile_size_at_zoom(&self, zoom_level: f64) -> f64 { ... } fn x(&self, zoom_level: f64, longitude: f64) -> f64 { ... } fn y(&self, zoom_level: f64, latitude: f64) -> f64 { ... } fn set_id(&self, id: &str) { ... } fn set_license(&self, license: &str) { ... } fn set_license_uri(&self, license_uri: &str) { ... } fn set_max_zoom_level(&self, zoom_level: u32) { ... } fn set_min_zoom_level(&self, zoom_level: u32) { ... } fn set_name(&self, name: &str) { ... } fn set_projection(&self, projection: MapProjection) { ... } fn set_tile_size(&self, tile_size: u32) { ... } fn connect_modified<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_license_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_license_uri_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_max_zoom_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_min_zoom_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_projection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_tile_size_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all MapSource methods.

§Implementors

MapSource, RasterRenderer, VectorRenderer

Provided Methods§

Source

fn fill_tile_async<P: FnOnce(Result<(), Error>) + 'static>( &self, tile: &Tile, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

Asynchronous version of shumate_map_source_fill_tile().

§tile

a #ShumateTile

§cancellable

a #GCancellable

§callback

a #GAsyncReadyCallback to execute upon completion

Source

fn fill_tile_future( &self, tile: &Tile, ) -> Pin<Box_<dyn Future<Output = Result<(), Error>> + 'static>>

Source

fn column_count(&self, zoom_level: u32) -> u32

Gets the number of tiles in a column at this zoom level for this map source.

§zoom_level

the zoom level

§Returns

the number of tiles in a column

Source

fn id(&self) -> Option<GString>

Gets map source’s id.

§Returns

the map source’s id.

Source

fn latitude(&self, zoom_level: f64, y: f64) -> f64

Gets the latitude corresponding to this y position in the map source’s projection.

§zoom_level

the zoom level

§y

a y position

§Returns

the latitude

Source

fn license(&self) -> Option<GString>

Gets map source’s license.

§Returns

the map source’s license.

Source

fn license_uri(&self) -> Option<GString>

Gets map source’s license URI.

§Returns

the map source’s license URI.

Source

fn longitude(&self, zoom_level: f64, x: f64) -> f64

Gets the longitude corresponding to this x position in the map source’s projection.

§zoom_level

the zoom level

§x

a x position

§Returns

the longitude

Source

fn max_zoom_level(&self) -> u32

Gets map source’s maximum zoom level.

§Returns

the maximum zoom level this map source supports

Source

fn meters_per_pixel( &self, zoom_level: f64, latitude: f64, longitude: f64, ) -> f64

Gets meters per pixel at the position on the map using this map source’s projection.

§zoom_level

the zoom level

§latitude

a latitude

§longitude

a longitude

§Returns

the meters per pixel

Source

fn min_zoom_level(&self) -> u32

Gets map source’s minimum zoom level.

§Returns

the miminum zoom level this map source supports

Source

fn name(&self) -> Option<GString>

Gets map source’s name.

§Returns

the map source’s name.

Source

fn projection(&self) -> MapProjection

Gets map source’s projection.

§Returns

the map source’s projection.

Source

fn row_count(&self, zoom_level: u32) -> u32

Gets the number of tiles in a row at this zoom level for this map source.

§zoom_level

the zoom level

§Returns

the number of tiles in a row

Source

fn tile_size(&self) -> u32

Gets map source’s tile size.

§Returns

the tile’s size (width and height) in pixels for this map source

Source

fn tile_size_at_zoom(&self, zoom_level: f64) -> f64

Gets the apparent size of the map tiles at the given fractional zoom level.

As the map is zoomed in, a tile gets bigger and bigger until, at the next integer zoom level, it “splits” into four tiles at the next zoom level. Thus, the size increase follows an exponential curve, base 2.

§zoom_level

a zoom level

§Returns

the tile’s size (width and height) in pixels for this map source at this zoom level

Source

fn x(&self, zoom_level: f64, longitude: f64) -> f64

Gets the x position on the map using this map source’s projection. (0, 0) is located at the top left.

§zoom_level

the zoom level

§longitude

a longitude

§Returns

the x position

Source

fn y(&self, zoom_level: f64, latitude: f64) -> f64

Gets the y position on the map using this map source’s projection. (0, 0) is located at the top left.

§zoom_level

the zoom level

§latitude

a latitude

§Returns

the y position

Source

fn set_id(&self, id: &str)

Sets the map source’s id.

§id

an id

Source

fn set_license(&self, license: &str)

Sets the map source’s license.

§license

the licence

Source

fn set_license_uri(&self, license_uri: &str)

Sets the map source’s license URI.

§license_uri

the licence URI

Source

fn set_max_zoom_level(&self, zoom_level: u32)

Sets the map source’s maximum zoom level.

§zoom_level

the maximum zoom level

Source

fn set_min_zoom_level(&self, zoom_level: u32)

Sets the map source’s minimal zoom level.

§zoom_level

the minimal zoom level

Source

fn set_name(&self, name: &str)

Sets the map source’s name.

§name

a name

Source

fn set_projection(&self, projection: MapProjection)

Sets the map source’s projection.

§projection

a #ShumateMapProjection

Source

fn set_tile_size(&self, tile_size: u32)

Sets the map source’s tile size.

§tile_size

the tile size

Source

fn connect_modified<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the source is modified in such a way that tiles previously filled by it should be refreshed.

It is the MapSource implementation’s responsibility to emit this signal when appropriate, such as when a data source or rendering parameter changes.

Source

fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_license_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_license_uri_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_max_zoom_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_min_zoom_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_projection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_tile_size_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§