MapBuilder
Methods
Controls(System.Action)
Defines the configuration of built-in Map controls.
Parameters
configurator - System.Action<MapControlsSettingsBuilder>
The action that configures the controls settings.
Example
@(Html.Kendo().Map()
.Name("map")
.Controls(controls => controls.Attribution(false).Navigator(false))
)
LayerDefaults(System.Action)
Defines the default configuration for the Map layers by type.
Parameters
configurator - System.Action<MapLayerDefaultsSettingsBuilder>
The action that configures the default layer options.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef => layerDef.Tile(tile => tile.Opacity(0.5)))
)
MinZoom(System.Double)
Configures the minimum zoom level. The typical web maps use zoom levels from 0 (the whole world) to 19 (sub-meter features).
Parameters
value - System.Double
The value that configures the minimum zoom level.
Example
@(Html.Kendo().Map()
.Name("map")
.MinZoom(3)
)
MaxZoom(System.Double)
The maximum zoom level. The typical web maps use zoom levels from 0 (the whole world) to 19 (sub-meter features).
Parameters
value - System.Double
The value that configures the maximum zoom level.
Example
@(Html.Kendo().Map()
.Name("map")
.MaxZoom(15)
)
MinSize(System.Double)
Sets the size of the Map in pixels at zoom level 0.
Parameters
value - System.Double
The value that configures the size.
Example
@(Html.Kendo().Map()
.Name("map")
.MinSize(200)
)
Messages(System.Action)
Allows localization of the strings that are used in the widget.
Parameters
configurator - System.Action<MapMessagesSettingsBuilder>
The action that configures the messages.
Pannable(System.Boolean)
Parameters
value - System.Boolean
Wraparound(System.Boolean)
Specifies whether the Map must wrap around the east-west edges.
Parameters
value - System.Boolean
The value that configures the wrap around option.
Example
@(Html.Kendo().Map()
.Name("map")
.Wraparound(false)
)
Zoom(System.Double)
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
Parameters
value - System.Double
The value that configures the initial zoom level.
Example
@(Html.Kendo().Map()
.Name("map")
.Zoom(3)
)
Zoomable(System.Boolean)
Controls whether the Map zoom level can be changed by the user.
Parameters
value - System.Boolean
The value that configures the Zoomable option.
Example
@(Html.Kendo().Map()
.Name("map")
.Zoomable(false)
)
Center(System.Double,System.Double)
Configures the center of the Map.
Parameters
latitude - System.Double
The latitude value.
longtitude - System.Double
The longitude value.
Example
@(Html.Kendo().Map()
.Name("map")
.Center(30.268107, -97.744821)
)
Layers(System.Action)
Defines the configuration of the Map layers. The layer type is determined by the value of the type field.
Parameters
configurator - System.Action<MapLayerFactory>
The action that configures the layers options.
Example
@(Html.Kendo().Map()
.Name("map")
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplate("https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c");
})
)
Markers(System.Action)
Defines the configuration of the Map markers.
Parameters
configurator - System.Action<MapMarkerFactory>
The action that configures the markers.
Example
@(Html.Kendo().Map()
.Name("map")
.Markers(markers =>
{
markers.Add().Location(30.268107, -97.744821);
})
)
MarkerDefaults(System.Action)
Defines the default options for all markers.
Parameters
configurator - System.Action<MapMarkerDefaultsSettingsBuilder>
The action that configures the default marker options.
Example
@(Html.Kendo().Map()
.Name("map")
.MarkerDefaults(mdef =>
{
mdef.Shape("pinTarget");
})
)
Events(System.Action)
Configures the handled client-side events of the Map.
Parameters
configurator - System.Action<MapEventBuilder>
The action that configures the available events.
Example
@(Html.Kendo().Map()
.Name("map")
.Events(events => events
.Click("onClick")
)
)
ToComponent()
Returns the internal view component.
Name(System.String)
Sets the name of the component.
Parameters
componentName - System.String
The name of the component.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Deferred(System.Boolean)
Suppress initialization script rendering. Note that this options should be used in conjunction with
Parameters
deferred - System.Boolean
ModelMetadata(System.Web.Mvc.ModelMetadata)
Uses the Metadata of the Model.
Parameters
modelMetadata - System.Web.Mvc.ModelMetadata
The metadata set for the Model
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
HtmlAttributes(System.Collections.Generic.IDictionary)
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
AsModule(System.Boolean)
Specifies whether the initialization script of the component will be rendered as a JavaScript module.
Parameters
value - System.Boolean
Render()
Renders the component.
Example
@(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
@( Html.Kendo().Grid(Model)
.Name("grid")
.DetailTemplate(product => {
)
Product Details:
<div>Product Name: @( product.ProductName )</div>
<div>Units In Stock: @( product.UnitsInStock )</div>
@(
})
.Render();
)
ScriptAttributes(System.Object,System.Boolean)
Sets the JavaScript attributes to the initialization script.
Parameters
attributes - System.Object
The JavaScript attributes.
overrideAttributes - System.Boolean
Argument which determines whether attributes should be overriden.
ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)
Sets the JavaScript attributes to the initialization script.
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
The JavaScript attributes.
overrideAttributes - System.Boolean
Argument which determines whether attributes should be overriden.