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

Defines the fluent API for configuring the Telerik UI for ASP.NET MVC Map.

Definition

Constructors

Initializes a new instance of the Map class.

C#
public MapBuilder(Map component)
Parameters:componentMap

The component.

Methods

Configures the center of the Map.

C#
public MapBuilder Center(double latitude, double longtitude)
Parameters:latitudedouble

The latitude value.

longtitudedouble

The longitude value.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Center(30.268107, -97.744821)
)

Defines the configuration of built-in Map controls.

C#
public MapBuilder Controls(Action<MapControlsSettingsBuilder> configurator)
Parameters:configuratorAction<MapControlsSettingsBuilder>

The action that configures the controls settings.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Controls(controls =&gt; controls.Attribution(false).Navigator(false))
)

Configures the handled client-side events of the Map.

C#
public MapBuilder Events(Action<MapEventBuilder> configurator)
Parameters:configuratorAction<MapEventBuilder>

The action that configures the available events.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Events(events =&gt; events
.Click("onClick")
)
)

Defines the default configuration for the Map layers by type.

C#
public MapBuilder LayerDefaults(Action<MapLayerDefaultsSettingsBuilder> configurator)
Parameters:configuratorAction<MapLayerDefaultsSettingsBuilder>

The action that configures the default layer options.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =&gt; layerDef.Tile(tile =&gt; tile.Opacity(0.5)))
)

Defines the configuration of the Map layers. The layer type is determined by the value of the type field.

C#
public MapBuilder Layers(Action<MapLayerFactory> configurator)
Parameters:configuratorAction<MapLayerFactory>

The action that configures the layers options.

Returns:

MapBuilder

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");
})
)

Defines the default options for all markers.

C#
public MapBuilder MarkerDefaults(Action<MapMarkerDefaultsSettingsBuilder> configurator)
Parameters:configuratorAction<MapMarkerDefaultsSettingsBuilder>

The action that configures the default marker options.

Returns:

MapBuilder

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

Defines the configuration of the Map markers.

C#
public MapBuilder Markers(Action<MapMarkerFactory> configurator)
Parameters:configuratorAction<MapMarkerFactory>

The action that configures the markers.

Returns:

MapBuilder

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

The maximum zoom level. The typical web maps use zoom levels from 0 (the whole world) to 19 (sub-meter features).

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

The value that configures the maximum zoom level.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.MaxZoom(15)
)

Allows localization of the strings that are used in the widget.

C#
public MapBuilder Messages(Action<MapMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<MapMessagesSettingsBuilder>

The action that configures the messages.

Returns:

MapBuilder

Sets the size of the Map in pixels at zoom level 0.

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

The value that configures the size.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.MinSize(200)
)

Configures the minimum zoom level. The typical web maps use zoom levels from 0 (the whole world) to 19 (sub-meter features).

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

The value that configures the minimum zoom level.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.MinZoom(3)
)

Specifies whether the map can be panned by the user.

C#
public MapBuilder Pannable(bool value)
Parameters:valuebool

The value that enables or disables the pan feature.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Pannable(false)
)

Specifies whether the Map must wrap around the east-west edges.

C#
public MapBuilder Wraparound(bool value)
Parameters:valuebool

The value that configures the wrap around option.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Wraparound(false)
)

Defines the initial zoom level. The typical web maps use zoom levels from 0 (the whole world) to 19 (sub-meter features). The map size is derived from the zoom level and minScale options: size = (2 ^ zoom) * minSize

C#
public MapBuilder Zoom(double value)
Parameters:valuedouble

The value that configures the initial zoom level.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Zoom(3)
)

Controls whether the Map zoom level can be changed by the user.

C#
public MapBuilder Zoomable(bool value)
Parameters:valuebool

The value that configures the Zoomable option.

Returns:

MapBuilder

Example:
C#
@(Html.Kendo().Map()
.Name("map")
.Zoomable(false)
)