pub struct Map { /* private fields */ }Implementations§
Source§impl Map
impl Map
Sourcepub fn new<F>(
frontend: &F,
observer: Rc<dyn MapObserver>,
map_options: MapOptions,
) -> Mapwhere
F: RendererFrontend + Clone + 'static,
pub fn new<F>(
frontend: &F,
observer: Rc<dyn MapObserver>,
map_options: MapOptions,
) -> Mapwhere
F: RendererFrontend + Clone + 'static,
Map(RendererFrontend&, MapObserver&, const MapOptions&) with the
default ResourceOptions() and ClientOptions().
C++ keeps a reference to the frontend; frontends are handles here
(Clone shares the same renderer), so the map keeps a clone.
Sourcepub fn with_resource_options<F>(
frontend: &F,
observer: Rc<dyn MapObserver>,
map_options: MapOptions,
resource_options: &ResourceOptions,
client_options: &ClientOptions,
) -> Mapwhere
F: RendererFrontend + Clone + 'static,
pub fn with_resource_options<F>(
frontend: &F,
observer: Rc<dyn MapObserver>,
map_options: MapOptions,
resource_options: &ResourceOptions,
client_options: &ClientOptions,
) -> Mapwhere
F: RendererFrontend + Clone + 'static,
Map(RendererFrontend&, MapObserver&, const MapOptions&, const ResourceOptions&, const ClientOptions&): the file source is the
FileSourceManager’s ResourceLoader for these options.
Sourcepub fn with_file_source<F>(
frontend: &F,
observer: Rc<dyn MapObserver>,
file_source: Arc<dyn FileSource>,
map_options: MapOptions,
) -> Mapwhere
F: RendererFrontend + Clone + 'static,
pub fn with_file_source<F>(
frontend: &F,
observer: Rc<dyn MapObserver>,
file_source: Arc<dyn FileSource>,
map_options: MapOptions,
) -> Mapwhere
F: RendererFrontend + Clone + 'static,
Map(std::unique_ptr<Impl>) with Impl(frontend, observer, fileSource, mapOptions).
Sourcepub fn get_client_options(&self) -> ClientOptions
pub fn get_client_options(&self) -> ClientOptions
getClientOptions().
Sourcepub fn render_still(&mut self, callback: StillImageCallback)
pub fn render_still(&mut self, callback: StillImageCallback)
Register a callback that will get called (on the render thread) when all resources have been loaded and a complete render occurs.
Sourcepub fn render_still_with_camera(
&mut self,
camera: &CameraOptions,
debug_options: MapDebugOptions,
callback: StillImageCallback,
)
pub fn render_still_with_camera( &mut self, camera: &CameraOptions, debug_options: MapDebugOptions, callback: StillImageCallback, )
renderStill(const CameraOptions&, MapDebugOptions, StillImageCallback).
Sourcepub fn trigger_repaint(&mut self)
pub fn trigger_repaint(&mut self)
Triggers a repaint.
Sourcepub fn get_style_mut(&mut self) -> StyleMut<'_>
pub fn get_style_mut(&mut self) -> StyleMut<'_>
style::Style& getStyle(): a guard that derefs to &mut Style; the
style’s observer calls made through it reach the map when it drops.
pub fn cancel_transitions(&mut self)
pub fn set_gesture_in_progress(&mut self, in_progress: bool)
pub fn is_gesture_in_progress(&self) -> bool
pub fn is_rotating(&self) -> bool
pub fn is_scaling(&self) -> bool
pub fn is_panning(&self) -> bool
pub fn get_camera_options(&self, padding: Option<EdgeInsets>) -> CameraOptions
pub fn jump_to(&mut self, camera: &CameraOptions)
Sourcepub fn lat_lng_bounds_for_camera(&self, camera: &CameraOptions) -> LatLngBounds
pub fn lat_lng_bounds_for_camera(&self, camera: &CameraOptions) -> LatLngBounds
latLngBoundsForCamera(camera).
pub fn ease_to(&mut self, camera: &CameraOptions, animation: &AnimationOptions)
pub fn fly_to(&mut self, camera: &CameraOptions, animation: &AnimationOptions)
pub fn move_by( &mut self, point: &ScreenCoordinate, animation: &AnimationOptions, )
pub fn pitch_by(&mut self, pitch: f64, animation: &AnimationOptions)
pub fn scale_by( &mut self, scale: f64, anchor: Option<ScreenCoordinate>, animation: &AnimationOptions, )
pub fn rotate_by( &mut self, first: &ScreenCoordinate, second: &ScreenCoordinate, animation: &AnimationOptions, )
Sourcepub fn camera_for_lat_lng_bounds(
&self,
bounds: &LatLngBounds,
padding: &EdgeInsets,
bearing: Option<f64>,
pitch: Option<f64>,
) -> CameraOptions
pub fn camera_for_lat_lng_bounds( &self, bounds: &LatLngBounds, padding: &EdgeInsets, bearing: Option<f64>, pitch: Option<f64>, ) -> CameraOptions
cameraForLatLngBounds(bounds, padding, bearing, pitch).
Sourcepub fn camera_for_lat_lngs(
&self,
lat_lngs: &[LatLng],
padding: &EdgeInsets,
bearing: Option<f64>,
pitch: Option<f64>,
) -> CameraOptions
pub fn camera_for_lat_lngs( &self, lat_lngs: &[LatLng], padding: &EdgeInsets, bearing: Option<f64>, pitch: Option<f64>, ) -> CameraOptions
cameraForLatLngs(latLngs, padding, bearing, pitch).
Sourcepub fn lat_lng_bounds_for_camera_unwrapped(
&self,
camera: &CameraOptions,
) -> LatLngBounds
pub fn lat_lng_bounds_for_camera_unwrapped( &self, camera: &CameraOptions, ) -> LatLngBounds
latLngBoundsForCameraUnwrapped(camera).
pub fn set_bounds(&mut self, options: &BoundOptions) -> Result<(), String>
Sourcepub fn get_bounds(&self) -> BoundOptions
pub fn get_bounds(&self) -> BoundOptions
Returns the current map bound options. All optional fields in BoundOptions are set.
pub fn set_north_orientation(&mut self, orientation: NorthOrientation)
pub fn set_constrain_mode(&mut self, mode: ConstrainMode)
pub fn set_viewport_mode(&mut self, mode: ViewportMode)
Sourcepub fn set_size(&mut self, size: Size) -> Result<(), String>
pub fn set_size(&mut self, size: Size) -> Result<(), String>
C++ throws “failed to resize: size is empty”; the port returns it.
pub fn set_frustum_offset(&mut self, frustum_offset: &EdgeInsets)
pub fn get_frustum_offset(&self) -> EdgeInsets
pub fn get_map_options(&self) -> MapOptions
pub fn set_projection_mode(&mut self, options: &ProjectionMode)
pub fn get_projection_mode(&self) -> ProjectionMode
pub fn get_transform_state(&self) -> TransformState
pub fn set_tile_lod_min_radius(&mut self, radius: f64)
pub fn get_tile_lod_min_radius(&self) -> f64
pub fn set_tile_lod_scale(&mut self, scale: f64)
pub fn get_tile_lod_scale(&self) -> f64
pub fn set_tile_lod_pitch_threshold(&mut self, threshold: f64)
pub fn get_tile_lod_pitch_threshold(&self) -> f64
pub fn set_tile_lod_zoom_shift(&mut self, shift: f64)
pub fn get_tile_lod_zoom_shift(&self) -> f64
pub fn set_tile_lod_mode(&mut self, mode: TileLodMode)
pub fn get_tile_lod_mode(&self) -> TileLodMode
Sourcepub fn pixel_for_lat_lng(&self, lat_lng: &LatLng) -> ScreenCoordinate
pub fn pixel_for_lat_lng(&self, lat_lng: &LatLng) -> ScreenCoordinate
pixelForLatLng(latLng).
Sourcepub fn lat_lng_for_pixel(
&self,
pixel: &ScreenCoordinate,
wrap_mode: WrapMode,
) -> LatLng
pub fn lat_lng_for_pixel( &self, pixel: &ScreenCoordinate, wrap_mode: WrapMode, ) -> LatLng
latLngForPixel(pixel, wrapMode).
Sourcepub fn pixels_for_lat_lngs(&self, lat_lngs: &[LatLng]) -> Vec<ScreenCoordinate> ⓘ
pub fn pixels_for_lat_lngs(&self, lat_lngs: &[LatLng]) -> Vec<ScreenCoordinate> ⓘ
pixelsForLatLngs(latLngs).
Sourcepub fn lat_lngs_for_pixels(
&self,
screen_coords: &[ScreenCoordinate],
wrap_mode: WrapMode,
) -> Vec<LatLng>
pub fn lat_lngs_for_pixels( &self, screen_coords: &[ScreenCoordinate], wrap_mode: WrapMode, ) -> Vec<LatLng>
latLngsForPixels(screenCoords, wrapMode).
Sourcepub fn set_prefetch_zoom_delta(&mut self, delta: u8)
pub fn set_prefetch_zoom_delta(&mut self, delta: u8)
setPrefetchZoomDelta(delta).
Sourcepub fn get_prefetch_zoom_delta(&self) -> u8
pub fn get_prefetch_zoom_delta(&self) -> u8
getPrefetchZoomDelta().
Sourcepub fn get_free_camera_options(&self) -> FreeCameraOptions
pub fn get_free_camera_options(&self) -> FreeCameraOptions
getFreeCameraOptions().
pub fn set_debug(&mut self, debug_options: MapDebugOptions)
pub fn get_debug(&self) -> MapDebugOptions
pub fn is_fully_loaded(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for Map
impl !Send for Map
impl !Sync for Map
impl !UnwindSafe for Map
impl Forget for Map
impl Freeze for Map
impl Unpin for Map
impl UnsafeUnpin for Map
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.