Maps · Layers: routes, GeoJSON, heat and clusters
MapView takes layers over its tiles and under its pins. RouteLine runs along places the short way across the date line. read_geojson reads RFC 7946 to features, strictly: a position past the globe, a line of one position or a ring that does not close fails with its reason, and a feature placed nowhere keeps no geometry. GeoJsonLayer washes areas as one path per polygon, so holes stay open, outlines them, strokes lines and dots points. GeoHeatmap spreads weighted places in a quartic kernel over small cells, scaled to the densest spot in view. Lines and areas unwrap across the date line and repeat on every world in view. cluster_markers gathers pins by squares of the world, so a pan keeps each group; a cluster shows its count, and its press shows its members whole, never farther out. A zoom that may regroup them hands a focused pin's or cluster's focus to the map.
This commit is contained in:
1 parent
91a0fc2252
commit
e3a96b04e0
16 files changed
+1350
-48
No files matched your search
@@ -11,6 +11,20 @@ pub struct MapSizes {
|
||||
pub popup: Rems,
|
||||
/// Room a popup keeps from the map's edges and from its point.
|
||||
pub margin: Rems,
|
||||
/// A route's stroke.
|
||||
pub route: Rems,
|
||||
/// A GeoJSON line's and outline's stroke.
|
||||
pub line: Rems,
|
||||
/// A GeoJSON point's side.
|
||||
pub dot: Rems,
|
||||
/// A heat cell's side.
|
||||
pub heat_cell: Rems,
|
||||
/// How far a heat point spreads.
|
||||
pub heat_reach: Rems,
|
||||
/// A cluster's side.
|
||||
pub cluster: Rems,
|
||||
/// The square of the world that gathers pins into one cluster.
|
||||
pub gather: Rems,
|
||||
}
|
||||
|
||||
impl Theme {
|
||||
@@ -19,6 +33,13 @@ impl Theme {
|
||||
tile: px(256.0),
|
||||
popup: px_to_rems(240.0),
|
||||
margin: px_to_rems(8.0),
|
||||
route: px_to_rems(3.0),
|
||||
line: px_to_rems(1.5),
|
||||
dot: px_to_rems(8.0),
|
||||
heat_cell: px_to_rems(4.0),
|
||||
heat_reach: px_to_rems(28.0),
|
||||
cluster: px_to_rems(32.0),
|
||||
gather: px_to_rems(56.0),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user