Class: Toybox.WatchUi.MapView
- Inherits:
-
Toybox.WatchUi.View
Overview
A View for rendering a map on the screen.
The map is rendered statically and focused on the bounding box and/or a MapMarker point or MapPolyline drawn on the map. The map can be rendered in MAP_MODE_BROWSE or MAP_MODE_PREVIEW mode.
Direct Known Subclasses
Instance Method Summary collapse
-
clear() as Void
Clear all the objects from the map.
-
getMapMode() as WatchUi.MapMode
Get the current mode for the map in this MapView.
-
initialize()
Constructor.
-
onUpdate(dc as Graphics.Dc) as Void
Update the View.
- setMapMarker(markers as WatchUi.MapMarker or Lang.Array<WatchUi.MapMarker>) as Void
-
setMapMode(mode as WatchUi.MapMode) as Void
Set the mode for the map in this MapView.
-
setMapVisibleArea(topLeft as Position.Location, bottomRight as Position.Location) as Void
Select the area of the map to render on the screen with a bounding box.
-
setPolyline(polyline as WatchUi.MapPolyline) as Void
Add MapPolyline object to be rendered on the map.
-
setScreenVisibleArea(topLeftX as Lang.Number, topLeftY as Lang.Number, bottomRightX as Lang.Number, bottomRightY as Lang.Number) as Void
Set the area on the screen to focus the map.
Instance Method Details
clear() as Void
Clear all the objects from the map.
Removes all MapPolyline and MapMarker objects.
getMapMode() as WatchUi.MapMode
Get the current mode for the map in this MapView.
initialize()
Constructor
onUpdate(dc as Graphics.Dc) as Void
Update the View.
This is called when a View is brought to the foreground, after the call to onShow(). While a View is active, this method is generally used to update dynamic content in the View.
setMapMarker(markers as WatchUi.MapMarker or Lang.Array<WatchUi.MapMarker>) as Void
setMapMode(mode as WatchUi.MapMode) as Void
Set the mode for the map in this MapView.
setMapVisibleArea(topLeft as Position.Location, bottomRight as Position.Location) as Void
Select the area of the map to render on the screen with a bounding box. A redraw of the current underlying map data will occur, so calling this function inside of onUpdate() is discouraged as it could lead to map flicker.
setPolyline(polyline as WatchUi.MapPolyline) as Void
Add MapPolyline object to be rendered on the map.
setScreenVisibleArea(topLeftX as Lang.Number, topLeftY as Lang.Number, bottomRightX as Lang.Number, bottomRightY as Lang.Number) as Void
Set the area on the screen to focus the map.