MapLayerDefaultsTileSettingsBuilder
Methods
UrlTemplate(System.String)
Defines the default URL template for Tile layers. The template variables are: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile.
Parameters
value - System.String
The value that configures the URL template.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =>
{
layerDef.Tile(t => t.UrlTemplate("https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png"));
})
)
UrlTemplateId(System.String)
Defines the default URL template for Tile layers. The template variables are: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile.
Parameters
value - System.String
The name of the external Kendo UI template.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =>
{
layerDef.Tile(t => t.UrlTemplateId("urlMapTemplate"));
})
)
<script id="urlMapTemplate" type="text/x-kendo-template">
http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png
</script>
UrlTemplateView(System.Web.Mvc.MvcHtmlString)
Defines the default URL template for Tile layers. The template variables are: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile.
Parameters
value - System.Web.Mvc.MvcHtmlString
The Razor View that will be used for rendering the tile layer URL template.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =>
{
layerDef.Tile(t => t.UrlTemplateView(Html.Partial("MapUrlTemplateView")));
})
)
UrlTemplateHandler(System.String)
Defines the default URL template for Tile layers. The template variables are: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile.
Parameters
value - System.String
The JavaScript function that will return the tile layer URL template.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =>
{
layerDef.Tile(t => t.UrlTemplateHandler("getUrlTemplate"));
})
)
<script>
function getUrlTemplate(data) {
return `http://${data.subdomain}.tile.openstreetmap.org/${data.zoom}/${data.x}/${data.y}.png`;
}
</script>
UrlTemplate(Kendo.Mvc.UI.TemplateBuilder)
Defines the default URL template for Tile layers. The template variables are: x - X coordinate of the tile; y - Y coordinate of the tile; zoom - zoom level or subdomain - Subdomain for this tile.
Parameters
template - TemplateBuilder<TModel>
A Template component that configures the URL template.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =>
{
layerDef.Tile(t => t.UrlTemplate(Html.Kendo().Template().AddHtml("http://${data.subdomain}.tile.openstreetmap.org/${data.zoom}/${data.x}/${data.y}.png")));
})
)
Attribution(System.String)
Defines the attribution of all Tile layers.
Parameters
value - System.String
The value that configures the attribution.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =>
{
layerDef.Tile(t => t.Attribution("© OpenStreetMap"));
})
)
Opacity(System.Double)
Defines the opacity of all Tile layers.
Parameters
value - System.Double
The value that configures the opacity.
Example
@(Html.Kendo().Map()
.Name("map")
.LayerDefaults(layerDef =>
{
layerDef.Tile(t => t.Opacity(0.4));
})
)