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

Defines the fluent API for configuring MapLayer

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class MapLayerBuilder

Inheritance: objectMapLayerBuilder

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

Constructors

MapLayerBuilder method.

C#
public MapLayerBuilder(MapLayer container)
Parameters:containerMapLayer

Properties

Gets the settings being configured.

C#
protected MapLayer Container { get; }

Methods

The attribution for the layer. String values are HTML-encoded by default. To render trusted HTML, pass an object with a text property and set encoded: false.

C#
public MapLayerBuilder Attribution(Action<MapLayerAttributionSettingsBuilder> configurator)
Parameters:configuratorAction<MapLayerAttributionSettingsBuilder>

The MapLayerAttributionSettingsBuilder for the attribution setting.

Returns:

MapLayerBuilder

Returns the current instance of MapLayerBuilder .

The attribution for the layer. String values are HTML-encoded by default. To render trusted HTML, pass an object with a text property and set encoded: false.

C#
public MapLayerBuilder Attribution(string attribution)
Parameters:attributionstring

The attribution.

Returns:

MapLayerBuilder

Returns the current instance of MapLayerBuilder .

If set to false the layer will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

C#
public MapLayerBuilder AutoBind(bool value)
Parameters:valuebool

The value for AutoBind

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Marker)
.AutoBind(false)
.DataSource(dataSource =&gt; dataSource.Read(read =&gt; read.Action("_StoreLocations", "Map")))
);
})
)

The culture to be used for the bing map tiles.

C#
public MapLayerBuilder Culture(string value)
Parameters:valuestring

The value for Culture

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bing)
.Culture("de-DE");
})
)

Defines the DataSource of the Map layer.

C#
public MapLayerBuilder DataSource(Action<MapLayerDataSourceBuilder> configurator)
Parameters:configuratorAction<MapLayerDataSourceBuilder>

The action that configures of the DataSource settings.

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource =&gt; dataSource.Read(read =&gt; read.Action("_StoreLocations", "Map")))
);
})
)

Specifies the extent of the region covered by this layer. The layer will be hidden when the specified area is out of view.Accepts a four-element array that specifies the extent covered by this layer: North-West lat, longitude, South-East latitude, longitude.If not specified, the layer is always visible.

C#
public MapLayerBuilder Extent(params double[] value)
Parameters:valuedouble[]

The value for Extent

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Tile)
.Extent(new double[]{43.4350, 22.2556, 42.2265, 27.4850});
})
)

The bing map tile types. Possible options.

C#
public MapLayerBuilder ImagerySet(MapLayersImagerySet value)
Parameters:valueMapLayersImagerySet

The value for ImagerySet

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add().Type(MapLayerType.Bing).ImagerySet(MapLayersImagerySet.AerialWithLabels);
})
)

The API key for the layer. Currently supported only for Bing (tm) tile layers.

C#
public MapLayerBuilder Key(string value)
Parameters:valuestring

The value for Key

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bing)
.Key("API key value");
})
)

The data item field which contains the marker (symbol) location. The field should be an array with two numbers - latitude and longitude in decimal degrees.Requires the dataSource option to be set.Only applicable to "marker" and "bubble" layers.

C#
public MapLayerBuilder LocationField(string value)
Parameters:valuestring

The value for LocationField

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Marker)
.LocationField("LatLng")
.DataSource(dataSource =&gt; dataSource.Read(read =&gt; read.Action("_StoreLocations", "Map")))
);
})
)

The maximum symbol size for bubble layer symbols.

C#
public MapLayerBuilder MaxSize(double value)
Parameters:valuedouble

The value for MaxSize

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bubble)
.MaxSize(50)
.DataSource(dataSource =&gt; dataSource.Read(read =&gt; read.Action("_UrbanAreas", "Map")))
);
})
)

The maximum zoom level at which to show this layer.

C#
public MapLayerBuilder MaxZoom(double value)
Parameters:valuedouble

The value for MaxZoom

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Tile)
.MaxZoom(13);
})
)

The minimum symbol size for bubble layer symbols.

C#
public MapLayerBuilder MinSize(double value)
Parameters:valuedouble

The value for MinSize

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bubble)
.MinSize(10)
.DataSource(dataSource =&gt; dataSource.Read(read =&gt; read.Action("_UrbanAreas", "Map")))
);
})
)

The minimum zoom level at which to show this layer.

C#
public MapLayerBuilder MinZoom(double value)
Parameters:valuedouble

The value for MinZoom

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Tile)
.MinZoom(14);
})
)

The opacity for the layer.

C#
public MapLayerBuilder Opacity(double value)
Parameters:valuedouble

The value for Opacity

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Tile)
.Opacity(1);
})
)

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

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

The value for Shape

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

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

Sets the marker shape. The available shapes are "pin" and "pinTarget".

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

The name of the marker shape.

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

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

The default style for shapes.

C#
public MapLayerBuilder Style(Action<MapLayerStyleSettingsBuilder> configurator)
Parameters:configuratorAction<MapLayerStyleSettingsBuilder>

The MapLayerStyleSettingsBuilder for the style setting.

Returns:

MapLayerBuilder

Returns the current instance of MapLayerBuilder .

A list of subdomains to use for loading tiles. Alternating between different subdomains allows more requests to be executed in parallel.

C#
public MapLayerBuilder Subdomains(params string[] value)
Parameters:valuestring[]

The value for Subdomains

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplate("https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c");
})
)

The bubble layer symbol type. Supported symbols are "circle" and "square".

C#
public MapLayerBuilder Symbol(MapSymbol value)
Parameters:valueMapSymbol

The value for Symbol

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bubble)
.Symbol("square");
})
)

Defines the bubble layer symbol type. The possible values are "circle" and "square".

C#
public MapLayerBuilder Symbol(string symbol)
Parameters:symbolstring

The value that configures the symbol type.

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bubble)
.Symbol("square");
})
)

Sets a client-side function that will draw the bubble layer symbol type.

C#
public MapLayerBuilder SymbolHandler(string handler)
Parameters:handlerstring

The name of the JavaScript function that will draw the symbol.

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bubble)
.SymbolHandler("getSymbolType");
})
)
&lt;script&gt;
function getSymbolType(data) {
...//return kendo.drawing.Shape
}
&lt;/script&gt;

The size of the image tile in pixels.

C#
public MapLayerBuilder TileSize(double value)
Parameters:valuedouble

The value for TileSize

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Tile)
.TileSize(200);
})
)

The data item field which contains the marker title. Requires the dataSource option to be set.

C#
public MapLayerBuilder TitleField(string value)
Parameters:valuestring

The value for TitleField

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Marker)
.TitleField("Name")
.DataSource(dataSource =&gt; dataSource.Read(read =&gt; read.Action("_StoreLocations", "Map")))
);
})
)

Configures the Tooltip component options for data-bound markers.

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

The action that configures the tooltip settings.

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Marker)
.Tooltip(tooltip =&gt; tooltip.Content("City X"));
})
)

The layer type. Supported types are "tile", "bing", "shape", "marker" and "bubble".

C#
public MapLayerBuilder Type(MapLayerType value)
Parameters:valueMapLayerType

The value for Type

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add().Type(MapLayerType.Tile);
})
)

The URL template for tile layers. Template variables: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile. See subdomains.

C#
public MapLayerBuilder UrlTemplate(string value)
Parameters:valuestring

The value for UrlTemplate

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

The URL template for tile layers. Template variables: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile. See subdomains.

C#
public MapLayerBuilder UrlTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the urltemplate.

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

The URL template for tile layers. Template variables: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile. See subdomains.

C#
public MapLayerBuilder UrlTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for UrlTemplate

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

The URL template for tile layers. Template variables: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile. See subdomains.

C#
public MapLayerBuilder UrlTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for UrlTemplate

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

The URL template for tile layers. Template variables: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile. See subdomains.

C#
public MapLayerBuilder UrlTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for UrlTemplate

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

The value field for bubble layer symbols. The data item field should be a number.

C#
public MapLayerBuilder ValueField(string value)
Parameters:valuestring

The value for ValueField

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Bubble)
.ValueField("Val")
.DataSource(dataSource =&gt; dataSource.Read(read =&gt; read.Action("_UrbanAreas", "Map")))
);
})
)

The zIndex for this layer.Layers are normally stacked in declaration order (last one is on top).

C#
public MapLayerBuilder ZIndex(double value)
Parameters:valuedouble

The value for ZIndex

Returns:

MapLayerBuilder

Returns the current MapLayerBuilder instance.

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =&gt;
{
layers.Add()
.Type(MapLayerType.Tile)
.ZIndex(1);
})
)