AllowRotate : bool ux
Specifies whether the user is allowed to rotate the map. The bearing can still be changed using the Bearing property.
Displays a native map view.
The MapView
allows you to present annotated, interactive world-wide maps to the user using the mapping APIs native to the platform: Google Maps on Android and Apple Maps on iOS.
The MapView
is a native control, and thus needs to be contained in a NativeViewHost to be displayed. As with other native mobile controls, there currently isn't a MapView
available for desktop targets.
Note: You need to add a reference to Fuse.Maps
in the Packages
section of your .unoproj
:
"Packages": [
"Fuse.Maps",
"Fuse",
"FuseJS"
]
Getting a MapView
included in your app is straight forward: Simply include the node in your UX as you normally would with a native control:
<NativeViewHost>
<MapView/>
</NativeViewHost>
To initialize and manipulate the map camera, use the Latitude, Longitude, Zoom, Tilt and Bearing properties, all of which are two-way bindable.
Zoom
follows Google's "zoom levels", which can be read about in detail here.
The map can be further customized by setting the rendering style using the Style property.
Options are Normal
, Satellite
and Hybrid
.
To annotate the map with labelled markers, see MapMarker
Google Maps requires a valid Google Maps API key. Follow Google's documentation to get one set up. Once you have your key it must be added to your project file, as shown below
"Android": {
"Geo": {
"ApiKey": "your_key_here"
}
}
This example displays a map with an average zoom level focused on Fuse's home in Oslo, Norway
<App>
<ClientPanel>
<NativeViewHost>
<MapView Latitude="59.911567" Longitude="10.741030" Zoom="10">
<MapMarker Latitude="59.911567" Longitude="10.741030" Label="Fuse HQ"/>
</MapView>
</NativeViewHost>
</ClientPanel>
</App>
Specifies whether the user is allowed to rotate the map. The bearing can still be changed using the Bearing property.
Specifies whether the user is allowed to scroll the map. The position can still be modified by the API.
Specifies whether the user is allowed to tilt the map. The tilt angle can still be changed using the Tilt property.
Specifies whether the user is allowed to zoom the map. The zoom level can still be changed using the Zoom property.
The bearing of the map relative to true north, in degrees.
The latitude coordinate.
The longitude coordinate.
Sets the Bearing of a MapView.
Sets the geographical location the MapView is focused on.
Sets the Tilt angle of a MapView.
Sets the Zoom level of a MapView.
Zoom to make all of markers in the MapView is shown.
When True
, a compass will be shown on the map.
True
if the user's geographical location should be visible on the map.
The rendering style of the map (Normal
, Satellite
or Hybrid
).
The angle of rotation around the X axis, measured in degrees.
The zoom level of the camera. Corresponds to Google Maps' Zoom Levels.
The Alignment of the Element
.
Determines how the aspect ratio is maintained in a situation when it violates the min or max sizing constraints.
The manner in which the size and position of the element is calculated.
Clips the child elements to the bounds of this element visually.
Specifies how hit tests should be performed on this element.
The height limit for an element using BoxSizing="Limit"
.
The width limit for an element using BoxSizing="Limit"
.
The Visibility of the Element
.
Begins removing a given node, playing all RemovedAnimations before actual removal.
Begins removing a given visual, playing all RemovedAnimations before actual removal.
Requests that this visual be brought into the visible are of the screen. Typically a containing
ScrollView
will scroll to ensure it is visible.
Brings the given child to the front of the Z-order. In UX markup, use the BringToFront trigger action instead.
The number of child nodes of this visual.
The children of the visual. All nodes placed inside the visual in UX markup are assigned to this list. The order of Visuals this list determines the order of layout. The Z-order of the children is by default equal to this order, but can be manipulated separately using methods like BringToFront and SendToBack.
Whether this visual has any visual child nodes.
Indicates the visual for this node has changed. This allows the root-level node to know that it must draw, and any caching that it must invalidate the cache for this node.
Indicates the composition of the visual has changed, but that the visual drawing itself is still valid (for example a position change).
Whether this node is in an enabled context.
The context is disabled if one of the ancestor nodes have IsEnabled set to false
.
Returns whether this visual is visible without concern for whether an ancestor visual is hidden or collapsed.
Returns whether this visual is currently visible. Will return false if any of the ancestor visuals are hidden or collapsed. This property can not be used to check whether a visual is hidden because it is occluded by another visual, or is outside the view but otherwise visible.
The layer this visual belongs to in the Parent container.
Describes how this visual participates in layout.
Converts a coordinate from the local space into the parent space.
The list of resources defined at this node.
Sends the given child to the back of the Z-order. In UX markup, use the SendToBack trigger action instead.
Whether to snap the result of layout of this visual to physical device pixels.
Converts a coordinate from the parent space into the local space.
The number of child visuals of this visual.
The list of bindings belonging to this node.
The context parent is the semantic parent of this node. It is where non-UI structure should be resolved, like looking for the DataContext, a Navigation, or other semantic item.
Finds the first node with a given name that satisfies the given acceptor. The serach algorithm works as follows: Nodes in the subtree are matched first, then it matches the nodes in the subtrees ofthe ancestor nodes by turn all the way to the root. If no matching node is found, the function returns null.
Whether rooting for this node is completed. Returns false if unrooting has started.
Whether rooting of this node has started. Note that even if this property returns true, rooting may not yet be completed for the node. See also IsRootingCompleted.
Run-time name of the node. This property is automatically set using the ux:Name attribute.
Returns the next sibling node of the given type.
If you override OnRooted
you must call base.OnRooted()
first in your derived class. No other processing should happen first, otherwise you might end up in an undefined state.
The parent Visual of this node. Will return null if the node is not rooted.
Returns the next sibling node of the given type.
A linked list holding data for extrinsic properties.
hide
hide
Specifies how an element is docked while inside a DockPanel
Shorthand for setting the MatchKey
property on the implicit Each
created when using the Items
attached property.
Called when a Visual receives input focus.
Called when a Visual loses input focus.
The index of the column the element occupies while in a Grid. If not set, the grid will place the element in a cell according to its position in the child list.
The number of columns this element occupies in a Grid. Defaults to 1.
The index of the row the element occupies while in a Grid. If not set, the grid will place the element in a cell according to its position in the child list.
The number of rows this element occupies in a Grid. Defaults to 1.
Called when a Visual receives a key press event while having input focus. On mobile devices, keyboard input only applies to physical buttons (such as BackButton), not soft keyboards.
Called when a Visual receives a key release event while having input focus. On mobile devices, keyboard input only applies to physical buttons (such as BackButton), not soft keyboards.
Determines how the layout of the master element is used to control the size of this one.
Adds a handler for when the page is Activated
Adds a handler for when the page is Deactivated
Called when a pointer enters a visual.
Called when a pointer leaves a visual.
Called when a pointer is moved on a visual.
Called when a pointer is pressed on the visual.
Called when a pointer is released on a visual.
Called when a pointer wheel is moved on a visual.
Interface for objects that can have a script engine representation
hide