Adds a map marker to a MapView

To annotate the map, you must decorate it with MapMarker nodes. MapMarker nodes are simple value objects that contain a Latitude, a Longitude and a Label

<NativeViewHost>
    <MapView>
        <MapMarker Label="Fuse HQ" Latitude="59.9115573" Longitude="10.73888" />
    </MapView>
</NativeViewHost>

If you need to generate MapMarkers dynamically from JS, data binding and Each are your friends. While we're scripting we might as well hook into the MapMarker's Tapped event to detect when the user has selected a marker.

<JavaScript>
    var Observable = require("FuseJS/Observable");
    module.exports = {
        markers : Observable({latitude:30.282786, longitude:-97.741736, label:"Austin, Texas", hometown:true}),
        onMarkerTapped : function(args) {
            console.log("Marker tapped: "+args.data.hometown);
        }
    }
</JavaScript>

<NativeViewHost>
    <MapView>
        <Each Items={markers}>
            <MapMarker Latitude="{latitude}" Longitude="{longitude}" Label="{label}" Tapped={onMarkerTapped} />
        </Each>
    </MapView>
</NativeViewHost>

Location

Namespace
Fuse.Controls
Package
Fuse.Maps 2.9.1
Show Uno properties and methods

Interface of MapMarker

IconAnchorX : float ux

The normalized X-position of the Icon image to use as the icon/map contact point

IconAnchorY : float ux

The normalized Y-position of the Icon image to use as the icon/map contact point

Inherited from Node

ContextParent : Node uno

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.

FindNodeByName(Selector, Predicate<Node> (Node)) : Node uno

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.

IsRootingStarted : bool uno

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.

Name : Selector ux

Run-time name of the node. This property is automatically set using the ux:Name attribute.

OnRooted uno

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.

Inherited from PropertyObject

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces

IScriptObject uno

Interface for objects that can have a script engine representation