"
});
gtm.update();
}
return false;
});
root.on('click', '.map-filter-button-cont button', function() {
geolocationLib.getGeolocationPosition({
checkRange : {
latitude : site.siteConfig.latitude,
longitude : site.siteConfig.longitude,
maxRangeMiles : site.siteConfig.maxRangeMiles
}
}, function(err, result) {
if(result.error) {
// user blocked or did not accept geolocation prompt within timeout period
sendEvents({ tCore : { action : "widget_explore_kansas_geolocation_" + result.errType, nonInteractiveHit : true } });
return;
}
if(result.inRange) {
sendEvents({ tCore : { action : "widget_explore_kansas_geolocation_approved_in_range", nonInteractiveHit : true } });
geolocation = result;
root.find('form').submit();
} else {
//alert('You are not within ' + site.siteConfig.maxRangeMiles + ' miles of any listings.');
sendEvents({ tCore : { action : "widget_explore_kansas_error_notify", label : "Geolocation not in range", nonInteractiveHit : true } });
root.find('.map-error-alert-description span').text('You are not within ' + site.siteConfig.maxRangeMiles + ' miles of any listings.');
root.find('.map-error-alert').removeClass('hide');
root.find('.map-filter-button-cont button').prop('disabled', true);
}
});
return false;
});
root.on('change', 'select.regions', function(event, custom) {
var regionid = Number($(this).val());
var optionText = $(this).find("option:selected").text();
sendEvents({ tCore : { action : "widget_explore_kansas_region_select", label : optionText, value : regionid } });
var json = {
pipeline : [
{ $match : { city : { $exists : true } } },
{ $project : { city : 1 } },
{ $group : { _id : '$city' } },
{ $sort : { _id : 1 } }
]
};
if(regionid) json.pipeline[0].$match.regionid = regionid;
$.ajax({
url : '/includes/rest_v2/plugins_listings_listings/aggregate/',
data : {
json : JSON.stringify(json),
token : core.simpleToken
},
success : function(data, textStatus, jqXHR) {
cities = data.docs;
root.find('select.cities option').not(':first').remove();
root.find('select.cities').append(function() {
return cities.map(function(city) {
return $('
To the Stars
The Kansas experience is a salute to the real. To the rowdy. To the wide-eyed wanderers.
To the dreamers. To The Stars. Learn more
Safe Travels!
The safety and health of everyone who travels in Kansas is our mission.
Enjoy the state in a way that is most comfortable for you. You are free to roam our wide-open spaces and explore the unexpected. Find travel resources below.
We’ve made it simple to see the Sunflower State safely from home. Visit our virtual travel page to see some of Kansas’ best exhibits and points of interest from your couch. Explore them now, plan to see them in person in the future!
Hike the Flint Hills, bike in Lawrence, or float at Lake Wilson and you’ll discover Kansas isn’t actually flat. But what we lack in flatness, we make up for in downright memorable adventure. Kansas is where it’s real, the place to find great people and a flat-out good time.