Canvas Nasal API: Difference between revisions

→‎Map: Added the map methods
(→‎set: Added settings I have no clue what do.)
(→‎Map: Added the map methods)
Line 622: Line 622:
== Map ==
== Map ==
Inherits from Element.
Inherits from Element.
Class for a group element on a canvas with possibly geographic positions which automatically get projected according to the specified projection.
Each map consists of an arbitrary number of layers (canvas groups)
=== del ===
'''Parameters:''' ()
=== setController ===
'''Parameters:''' (controller)
controller needs to inherit from Map.Controller
=== addLayer ===
'''Parameters:''' (factory, type_arg=nil, priority=nil, style=nil, opts=nil, visible=1)
=== getLayer ===
'''Parameters:''' (type_arg)
=== setRange ===
'''Parameters:''' (range)
=== getRange ===
'''Parameters:''' ()
=== setPos ===
'''Parameters:''' (lat, lon, hdg=nil, range=nil, alt=nil)
=== getPos ===
'''Parameters:''' ()
Returns vector with lat, lon, heading, range and altitude
=== getLat ===
'''Parameters:''' ()
=== getLon ===
'''Parameters:''' ()
=== getHdg ===
'''Parameters:''' ()
=== getAlt ===
'''Parameters:''' ()
=== getRange ===
'''Parameters:''' ()
=== getLatLon ===
'''Parameters:''' ()
Returns vector with lat and lon
=== getPosCoord ===
'''Parameters:''' ()
N.B.: This always returns the same geo.Coord object,
so its values can and will change at any time (call
update() on the coord to ensure it is up-to-date,
which basically calls this method again).
=== update ===
'''Parameters:''' (predicate=nil)
Update each layer on this Map.
=== See also ===
[[Canvas_Maps|Canvas Maps]] and [[Canvas_Map_API|Canvas Map API]]


See: [[Canvas_Maps|Canvas Maps]] and [[Canvas_Map_API|Canvas Map API]]
== Image ==
== Image ==
Inherits from Element.
Inherits from Element.


See: [[Canvas_Image|Canvas Image]]
See: [[Canvas_Image|Canvas Image]]
574

edits