New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring MapMarker

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class MapMarkerBuilder

Inheritance: objectMapMarkerBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

MapMarkerBuilder method.

C#
public MapMarkerBuilder(MapMarker container)
Parameters:containerMapMarker

Properties

Gets the settings being configured.

C#
protected MapMarker Container { get; }

Methods

Sets the HTML attributes of the Map marker.

C#
public virtual MapMarkerBuilder HtmlAttributes(IDictionary<string, object> attributes)
Parameters:attributesIDictionary<string, object>

The HTML attributes.

Returns:

MapMarkerBuilder

Returns the current MapMarkerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =&gt;
{
markers.Add()
.HtmlAttributes(new Dictionary&lt;string, object&gt;() { ["style"] = "color: red;" });
})
)

Sets the HTML attributes of the Map marker.

C#
public virtual MapMarkerBuilder HtmlAttributes(object attributes)
Parameters:attributesobject

The HTML attributes.

Returns:

MapMarkerBuilder

Returns the current MapMarkerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =&gt;
{
markers.Add()
.HtmlAttributes(new { style = "color: red;" });
})
)

The marker location on the map. Coordinates are listed as [Latitude, Longitude].

C#
public MapMarkerBuilder Location(params double[] value)
Parameters:valuedouble[]

The value for Location

Returns:

MapMarkerBuilder

Returns the current MapMarkerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =&gt;
{
markers.Add().Location(30.268107, -97.744821);
})
)

The marker shape. Supported shapes are "pin" and "pinTarget".

C#
public MapMarkerBuilder Shape(MapMarkersShape value)
Parameters:valueMapMarkersShape

The value for Shape

Returns:

MapMarkerBuilder

Returns the current MapMarkerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =&gt;
{
markers.Add().Shape("pinTarget");
})
)

Sets the marker shape name. The available pre-defined marker shapes are "pin" and "pinTarget".

C#
public MapMarkerBuilder Shape(string name)
Parameters:namestring

The name of the marker shape.

Returns:

MapMarkerBuilder

Returns the current MapMarkerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =&gt;
{
markers.Add().Shape("pin");
})
)

The marker title. Displayed as browser tooltip.

C#
public MapMarkerBuilder Title(string value)
Parameters:valuestring

The value for Title

Returns:

MapMarkerBuilder

Returns the current MapMarkerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =&gt;
{
markers.Add().Title("POI");
})
)

Sets the tooltip options of the Map marker.

C#
public MapMarkerBuilder Tooltip(Action<MapMarkerTooltipBuilder> configurator)
Parameters:configuratorAction<MapMarkerTooltipBuilder>

The action that configures the tooltip settings.

Returns:

MapMarkerBuilder

Returns the current MapMarkerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =&gt;
{
markers.Add()
.Tooltip(tooltip =&gt; tooltip.Content("City X").AutoHide(true));
})
)