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

Contains

methods

Tests if a location is contained within the extent.

Parameters:locationkendo.dataviz.map.Location

The location to test for.

Returns:Boolean

true if the extent contains the location, false otherwise.

<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 testLocation1 = new kendo.dataviz.map.Location(41.4993, -81.6944); // Cleveland (inside)
var testLocation2 = new kendo.dataviz.map.Location(25.7617, -80.1918); // Miami (outside)

console.log("Cleveland is in extent:", extent.contains(testLocation1)); // true
console.log("Miami is in extent:", extent.contains(testLocation2));    // false

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