1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use walkers::sources::Attribution;

pub fn acknowledgement_overlay(
    ui: &mut egui::Ui,
    map_rect: &egui::Rect,
    attribution: &Attribution,
) {
    const HEIGHT: f32 = 15.0;

    let rect = egui::Rect::from_min_size(
        map_rect.left_bottom() - egui::vec2(0.0, HEIGHT),
        egui::vec2(map_rect.width(), HEIGHT),
    );

    let mut ui = ui.new_child(egui::UiBuilder::new().max_rect(rect));
    ui.multiply_opacity(0.7);

    egui::Frame::none()
        .fill(ui.visuals().window_fill)
        .inner_margin(egui::Margin::same(2.0))
        .show(&mut ui, |ui| {
            let text = egui::WidgetText::from(attribution.text).small();
            ui.hyperlink_to(text, attribution.url);
        });
}