Kansas Resorts, Occasions, Issues to Do, Eating places & Journey Instruments

Kansas Resorts, Occasions, Issues to Do, Eating places & Journey Instruments

view my plan

” }); gtm.replace(); } return false; }); root.on(‘click on’, ‘.map-filter-button-cont button’, perform() { geolocationLib.getGeolocationPosition({ checkRange : { latitude : web site.siteConfig.latitude, longitude : web site.siteConfig.longitude, maxRangeMiles : web site.siteConfig.maxRangeMiles } }, perform(err, consequence) { if(consequence.error) { // consumer blocked or didn’t settle for geolocation immediate inside timeout interval sendEvents({ tCore : { motion : “widget_explore_kansas_geolocation_” + consequence.errType, nonInteractiveHit : true } }); return; } if(consequence.inRange) { sendEvents({ tCore : { motion : “widget_explore_kansas_geolocation_approved_in_range”, nonInteractiveHit : true } }); geolocation = consequence; root.discover(‘type’).submit(); } else { //alert(‘You aren’t inside ‘ + web site.siteConfig.maxRangeMiles + ‘ miles of any listings.’); sendEvents({ tCore : { motion : “widget_explore_kansas_error_notify”, label : “Geolocation not in vary”, nonInteractiveHit : true } }); root.discover(‘.map-error-alert-description span’).textual content(‘You aren’t inside ‘ + web site.siteConfig.maxRangeMiles + ‘ miles of any listings.’); root.discover(‘.map-error-alert’).removeClass(‘conceal’); root.discover(‘.map-filter-button-cont button’).prop(‘disabled’, true); } }); return false; }); root.on(‘change’, ‘choose.areas’, perform(occasion, customized) { var regionid = Quantity($(this).val()); var optionText = $(this).discover(“choice:chosen”).textual content(); sendEvents({ tCore : { motion : “widget_explore_kansas_region_select”, label : optionText, worth : 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 : ‘/contains/rest_v2/plugins_listings_listings/combination/’, information : { json : JSON.stringify(json), token : core.simpleToken }, success : perform(information, textStatus, jqXHR) { cities = information.docs; root.discover(‘choose.cities choice’).not(‘:first’).take away(); root.discover(‘choose.cities’).append(perform() { return cities.map(perform(metropolis) { return $(”, {
textual content : metropolis._id,
worth : metropolis._id
});
});
});
if(customized && customized.init) root.discover(‘choose.cities’).val(widget.metropolis);
else root.discover(‘type’).submit();
}
});
});

root.on(‘change’, ‘choose.cities’, perform() {
sendEvents({ tCore : { motion : “widget_explore_kansas_city_select”, label : $(this).val() } });

root.discover(‘type’).submit();
});

root.on(‘change’, ‘enter[type=checkbox]’, perform() {
var motion;
var label = $(this).mum or dad().textual content().trim();

if ($(this).hasClass(“curiosity”)) {
motion = “curiosity”
} else if ($(this).hasClass(“subcategory”)) {
motion = “subcategory”;
}

sendEvents({ tCore : { motion : “widget_explore_kansas_filter_change_”+motion, label : label, worth : Quantity($(this).val()) } });
root.discover(‘type’).submit();
});

root.on(‘submit’, ‘type’, perform(e) {
e.preventDefault();

root.discover(‘.map-error-alert’).addClass(‘conceal’);

var filter = {
loc : {
$exists : true
}
};
var choices = {
depend : true,
restrict : 100,
kind : {
rankorder : 1,
sortcompany : 1
},
fields : {
_id : 0,
‘classes.catid’ : 1,
metropolis : 1,
‘crmtracking.core_itinerary’ : 1,
dtn : 1,
‘listingudfs_object.346.valuearray’ : 1,
loc : 1,
primary_image_url : 1,
recid : 1,
title : 1
}
};

if(active_tab === ‘pursuits’) filter[‘listingudfs_object.346’] = { $exists : true };

var regionid = root.discover(‘choose.areas’).val();
if(regionid) filter.regionid = Quantity(regionid);

var metropolis = root.discover(‘choose.cities’).val();
if(metropolis) filter.metropolis = metropolis;

var interestids = root.discover(‘enter.curiosity:checked’).map(perform() {
return Quantity($(this).val());
}).toArray();
if(interestids.size) filter[‘listingudfs_object.346.valuearray.listid’] = { $in : interestids };

var categoryids = root.discover(‘enter.subcategory:checked’).map(perform() {
return Quantity($(this).information(‘categoryid’));
}).toArray();
var subcategoryids = root.discover(‘enter.subcategory:checked’).map(perform() {
return Quantity($(this).val());
}).toArray();
var filter_tags = subcategoryids.map(perform(subcategoryid) {
return ‘subcatid_’ + subcategoryid;
});
if(filter_tags.size) filter.filter_tags = { $in : filter_tags };

if(geolocation) {
filter.solrOptions = {
kind : ‘distance’,
level : geolocation.latitude + ‘,’ + geolocation.longitude
};
}

$.ajax({
url : ‘/contains/rest_v2/plugins_listings_listings/discover/’,
information : {
json : JSON.stringify({
filter : filter,
choices : choices
}),
token : core.simpleToken
},
success : perform(information, textStatus, jqXHR) {
depend = information.docs.depend;
listings = information.docs.docs;
if(listings.size) {
bounds = new google.maps.LatLngBounds();
if(richmarkers) {
richmarkers.forEach(perform(richmarker) {
richmarker.setMap(null);
});
}
richmarkers = listings.map(perform(itemizing) {
if(geolocation) {
itemizing.distance = new Geodist({
begin : { lat : itemizing.latitude, lon : itemizing.longitude },
finish : { lat : geolocation.latitude, lon : geolocation.longitude }
});
}
var content material = goatee.fill(richmarker_template, itemizing, {}, { active_tab : active_tab, interestids : interestids, categoryids : categoryids, category_icons : category_icons });
var place = new google.maps.LatLng({ lat : itemizing.latitude, lng : itemizing.longitude });
bounds.prolong(place);
return new RichMarker({
map : map._map,
place : place,
content material : content material,
shadow : false
});
});
map._map.fitBounds(bounds);
} else {
//alert(‘There are not any listings that match your question.’);
root.discover(‘.map-error-alert-description span’).textual content(‘No outcomes discovered, please take away some filters and take a look at once more.’);
root.discover(‘.map-error-alert’).removeClass(‘conceal’);
sendEvents({ tCore : { motion : “widget_explore_kansas_error_notify”, label : “No outcomes discovered”, nonInteractiveHit : true } });
// No outcomes discovered, please take away some filters and take a look at once more
}
}
});

return false;
});

$(doc).on(‘map:resize’, resize);
perform resize() {
if(map && root.is(‘:seen’)) {
google.maps.occasion.set off(map._map, ‘resize’);
if(bounds) map._map.fitBounds(bounds);
}
}

$(doc).one(‘map:init’, init);
perform init() {
async.parallel({
listingmeta : perform(callback) {
$.ajax({
url : ‘/contains/rest_v2/plugins_listings_listingmeta/discover/’,
information : {
json : JSON.stringify({
filter : {},
choices : {
fields : {
_id : 0,
areas : 1,
listingcats : 1,
listingsubcats : 1,
‘listingudfs_object.346.values’:1
}
}
}),
token : core.simpleToken
},
success : perform(information, textStatus, jqXHR) {
areas = information.docs[0].areas;
classes = information.docs[0].listingcats.kind(perform(a, b) {
if(a.sortorder b.sortorder) return 1;
else return 0;
});
subcategories = information.docs[0].listingsubcats;
pursuits = information.docs[0].listingudfs_object[346].values;
return callback(null, true);
}
});
},
cities : perform(callback) {
$.ajax({
url : ‘/contains/rest_v2/plugins_listings_listings/combination/’,
information : {
json : JSON.stringify({
pipeline : [
{ $match : { city : { $exists : true } } },
{ $project : { city : 1 } },
{ $group : { _id : ‘$city’ } },
{ $sort : { _id : 1 } }
]
}),
token : core.simpleToken
},
success : perform(information, textStatus, jqXHR) {
cities = information.docs;
return callback(null, true);
}
});
}
}, perform(err, outcomes) {
root.html(goatee.fill(template, {
widget : widget,
cities : cities,
areas : areas,
pursuits : pursuits,
classes : classes,
subcategories : subcategories,
category_icons : category_icons
})).basis();
map = new mapLib.GoogleMap({
node : root.discover(‘.map’),
mapOptions : {
streetViewControl : false,
mapTypeControlOptions : {
place: google.maps.ControlPosition.TOP_RIGHT
}
}
});
region_overlay_bounds = new google.maps.LatLngBounds({ lat : 36.993016, lng : -102.0517689 }, { lat : 40.004542, lng : -94.58838709999999});
region_overlay = new google.maps.GroundOverlay(‘/contains/public/property/map-region-overlay.png’, region_overlay_bounds, { clickable : false, map : map._map });
if(widget.regionid) root.discover(‘choose.areas’).val(widget.regionid).set off(‘change’, { init : true });
if(widget.metropolis) root.discover(‘choose.cities’).val(widget.metropolis);
if(widget.interestids) root.discover(‘enter.curiosity’).prop(‘checked’, perform() {
return widget.interestids.indexOf($(this).attr(‘worth’)) > -1;
});
if(widget.subcategoryids) root.discover(‘enter.subcategory’).prop(‘checked’, perform() {
var checked = widget.subcategoryids.indexOf($(this).attr(‘worth’)) > -1;
if(checked) $(this).mum or dad(‘label’).mum or dad(‘.content material’).prev(‘a’).click on();
return checked;
});
root.discover(‘.tab-title.energetic a’).set off(“click on”, { sv_init : true });

root.on(‘click on’, ‘.gm-fullscreen-control’, perform() {
sendEvents({ tCore : { motion : “widget_explore_kansas_toggle_fullscreen”, label : “Toggle Fullscreen” } });
});

var zoomFn = lodash.debounce(perform() {
sendEvents({ tCore : { motion : “widget_explore_kansas_map_zoom”, worth : map._map.getZoom() } });
});

var panFn = lodash.debounce(perform() {
sendEvents({ tCore : { motion : “widget_explore_kansas_map_pan” } });
});

// These will fireplace on init except they solely occur after preliminary tiles loaded.
// Must debounce as a result of tilesloaded fires a number of instances.
map._map.addListener(“tilesloaded”, perform() {
// map._map.addListener(“zoom_changed”, zoomFn);
map._map.addListener(“dragstart”, panFn);

root.discover(“.gm-bundled-control”).bind(“click on”, zoomFn);
});

});
};

});

Source

Auto Business Travel News