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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! A layer for placing polygons on the map.
//!
//! # Example
//!
//! ```no_run
//! use eframe::egui;
//! use egui_map_view::{Map, config::OpenStreetMapConfig, layers::{area::{Area, AreaLayer, AreaMode, AreaShape::Polygon, FillType}, Layer}, projection::GeoPos};
//! use egui::{Color32, Stroke};
//!
//! struct MyApp {
//! map: Map,
//! }
//!
//! impl Default for MyApp {
//! fn default() -> Self {
//! let mut map = Map::new(OpenStreetMapConfig::default());
//!
//! let mut area_layer = AreaLayer::default();
//! area_layer.add_area(Area {
//! shape: Polygon(vec![
//! GeoPos { lon: 10.0, lat: 55.0 },
//! GeoPos { lon: 11.0, lat: 55.0 },
//! GeoPos { lon: 10.5, lat: 55.5 },
//! ]),
//! stroke: Stroke::new(2.0, Color32::from_rgb(255, 0, 0)),
//! fill: Color32::from_rgba_unmultiplied(255, 0, 0, 50),
//! fill_type: FillType::Solid,
//! });
//! area_layer.mode = AreaMode::Modify;
//!
//! map.add_layer("areas", area_layer);
//!
//! Self { map }
//! }
//! }
//!
//! impl eframe::App for MyApp {
//! fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
//! egui::CentralPanel::default().show_inside(ui, |ui| {
//! ui.add(&mut self.map);
//! });
//! }
//! }
//! ```
/// Hatching geometries for the map area layer.
/// The interactive map area layer implementation.
/// Types and definitions for the area layer.
pub
pub
pub
pub use AreaLayer;
pub use ;