The geographic model (spec/03 §8): a projection and a view. It owns no position scales:
positions come from the projection spatial step, which reads the model's projection
through its context. It owns color and any other non-position scale.
- What it owns (§8.1):
projection(type, required, one ofMacaw.Draw.Geo.Projection's types;scale,translate,center,rotate,parallels,clip_angle;translatethe plot's center by default) andfit. - Clipping is the view's (§8.2): a row the projection clips keeps its place with
nilpositions, so inference and the summary read every row. - The fit (§8.3):
scaleandtranslateset to the plot inset bypaddingover the points of a slot's rows before any step, byfields([longitude, latitude]) orfield(a GeoJSON geometry),min_spanmeters widening coincident points; re-run on every delivery to the slot and onsize. - The view and the box window (§8.4): the option
view:(a box, the Frame's bound state) is the view a realization shows; a finished pan or zoom emits"view"with the box enclosing the plot's corners and edge midpoints inverted through the projection; it writeswindowonly over a:pointwindow field; a view of empty space emits nothing. - Tiles alignment (§8.5): a
tileslayer needs a Mercator,centerlatitude 0, no tilt or roll, else{:tiles, :projection, what}at the layer'skind. - Hit-testing, writes and summary (§8.6):
invert/2through the projection's inverse,data-mw-projectionfor the client (attrs/1), the summary "map" with the view's box.
Copied from visualize's Visualize.Chart.Frame (:geo) over Macaw.Draw.Geo.Projection
and Macaw.Draw.Geo.Tiles.
Summary
Functions
The projection's parameters as the client reads them (§8.6): data-mw-projection, its
type and numbers, type,scale,tx,ty,cx,cy,λ,φ,γ,clip,p1,p2 (clip - for none).
The box a view shows (§8.4): the plot's four corners and its edge midpoints inverted
through the projection, the box %{west, south, east, north} enclosing them, latitudes
clamped to ±90 and west east of east when it crosses the antimeridian. When a corner
or midpoint is off the sphere it contributes nothing, and the box is the finer sample of
Macaw.Draw.Geo.Viewport.box/2, which finds a globe smaller than the plot; :none when
nothing of the sphere is in view.
A finished pan or zoom (§8.4): the gesture's scale and translate, the moved view,
set on the model's projection; the "view" event's box is that view's.
Functions
The projection's parameters as the client reads them (§8.6): data-mw-projection, its
type and numbers, type,scale,tx,ty,cx,cy,λ,φ,γ,clip,p1,p2 (clip - for none).
The box a view shows (§8.4): the plot's four corners and its edge midpoints inverted
through the projection, the box %{west, south, east, north} enclosing them, latitudes
clamped to ±90 and west east of east when it crosses the antimeridian. When a corner
or midpoint is off the sphere it contributes nothing, and the box is the finer sample of
Macaw.Draw.Geo.Viewport.box/2, which finds a globe smaller than the plot; :none when
nothing of the sphere is in view.
A finished pan or zoom (§8.4): the gesture's scale and translate, the moved view,
set on the model's projection; the "view" event's box is that view's.