New to Kendo UI for jQuery? Start a free 30-day trial

Center

methods

Returns the center of the extent.

Returns:kendo.dataviz.map.Location

The extent center location.

<div id="map"></div>
<script>
var extent = new kendo.dataviz.map.Extent(
    new kendo.dataviz.map.Location(42.3601, -71.0589), // Boston
    new kendo.dataviz.map.Location(40.7128, -74.0060)  // New York
);

var centerLocation = extent.center();
console.log("Center latitude:", centerLocation.lat);
console.log("Center longitude:", centerLocation.lng);

$("#map").kendoMap({
    center: centerLocation,
    zoom: 8
});
</script>
Not finding the help you need?
Contact Support