Benutzen Sie unseren Store Locator, um die nächstgelegene OTS-Filiale und Veranstaltungen in Ihrer Nähe zu finden.
Home
'); } function subbutactive(state) { jQuery("#search-button").removeClass("clickable"); if (state) { jQuery("#search-button").addClass("clickable"); } } function fitMap(){ if (markers.length > 1) { var bounds = new google.maps.LatLngBounds(); for (var i = 0; i < markers.length; i++) { bounds.extend(markers[i].getPosition()); } map.fitBounds(bounds); } } function displayTiles(row){ storeinfobox.empty(); var row1 = jQuery("", { class: "store-locator__tiles-row" }); row1.append(tiles[row].slice(0, 2)); row1.appendTo(storeinfobox); if (tiles[row].length > 2) { var row2 = jQuery("", { class: "store-locator__tiles-row" }); row2.append(tiles[row].slice(2, 4)); row2.appendTo(storeinfobox); } jQuery(".page-number").removeClass("active"); jQuery("#pageid-"+row).addClass("active"); } function populatePagination() { var pagination = jQuery("#store-locator__pagination .pagination-center"); pagination.empty(); if (tiles.length < 2) { return; } for (var i = 0; i < tiles.length; i++) { jQuery("", { value: i, text: i + 1, id: "pageid-" + i, class: "page-number", onclick: "displayTiles(" + i + ")" }).appendTo(pagination); } } function createInfoItem(data, itemtype) { switch (itemtype) { case "Store Name": return '' + data["Store Name"] + '
'; break; case "distance": return 'Distance: ' + data["distance"].toFixed(1) + 'mi
'; break; case "location": return 'Location: ' + data["City"] + ", " + data["Country/Region"] + "
"; break; case "directionurl": return 'Tel: ' + data["Telephone Number"] + '
Email: ' + data["E-mail Address"] + '
Max players: ' + data["Max Capacity"] + '
'; break; case "Event Date DD/MM/YY": return '' + data["Event Date DD/MM/YY"] + '
'; break; case "Registration Start": return '' + data["Registration Start"] + '
'; break; case "Discord Server Link": if (data["Discord Server Link"]) { return ''; break; default: break } return ""; } function createInfoString(data, infoType) { var sinfo = ''; data["directionurl"] = encodeURI("https://www.google.com/maps/dir/?api=1&" + "origin=" + place.geometry.location.lat() + "," + place.geometry.location.lng() + "&" + "destination=" + data["Address_string"]); sinfo += '
'; sinfo += createInfoItem(data, "Store Name"); sinfo += '
'; sinfo += createInfoItem(data, "distance"); sinfo += createInfoItem(data, "location"); sinfo += createInfoItem(data, "directionurl"); sinfo += '
'; sinfo += createInfoItem(data, "Telephone Number"); sinfo += createInfoItem(data, "E-mail Address"); sinfo += '
'; switch(infoType){ case "WCQ Regionals": sinfo += createInfoItem(data, "Event Date DD/MM/YY"); sinfo += createInfoItem(data, "Registration Start"); sinfo += createInfoItem(data, "Max Capacity"); break; default: if (data["sneak_dates"]) { datesaftertoday = data["sneak_dates"].filter(function(a) { splita = a.split("/"); return new Date(splita[2], splita[1]-1, splita[0]).getTime() > today; } ); sorteddates = datesaftertoday.sort(function(a,b) { splita = a.split("/"); splitb = b.split("/"); return new Date(splita[2], splita[1]-1, splita[0]) - new Date(splitb[2], splitb[1]-1, splitb[0]); }); if (sorteddates.length < 1) { return false; } else { sinfo += '
Event dates: '; if (sorteddates.length > 4) { sinfo += sorteddates.length; } else { sinfo += sorteddates.join(", "); } sinfo += '
'; } } break; } sinfo += createInfoItem(data, "Discord Server Link"); sinfo += createInfoItem(data, "kcgnlink"); return sinfo; } function getStores(loc, rad) { if (jQuery("#search-milesorkm").val() == "KM") { rad = rad * 0.621371; } var searchtype = jQuery("#search-type").val(), dat = { lat: loc.lat(), lng: loc.lng(), radius: rad, type: searchtype }; jQuery.ajax({ url: '/eu/_store-locator/store-locator-get-info.php', dataType: 'json', data: dat, success: function(data) { var counter = 0, storeinfodatastring = ""; setTimeout(function() { subbutactive(true); }, 2000); clearLocations(); markHome(loc); jQuery.each(data, function(key, val) { if (tiles[counter].length > 5) { tiles.push([]); counter++; } var infostr = createInfoString(val, searchtype); if (infostr) { markers.push(createMarkerWithInfo(parseFloat(val["Latitude"]), parseFloat(val["Longitude"]), val["Store Name"], kuri, infostr)); tiles[counter].push(createTile(val["Store Name"], infostr, val)) } }); populatePagination(); fitMap(); displayTiles(0); }, error: function( jqXHR, textStatus, errorThrown ) { console.log('jqXHR: ', jqXHR); console.log('textStatus: ', textStatus); console.log('errorThrown: ', errorThrown); console.log('dat:', dat); }, statusCode: { 404: function() { alert('There was a problem with the server. Try again soon!'); } } }); } var selectFirstOnEnter = function(input) { // store the original event binding function var _addEventListener = (input.addEventListener) ? input.addEventListener : input.attachEvent; // Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected, and then trigger the original listener. function addEventListenerWrapper(type, listener) { if (type == "keydown") { var orig_listener = listener; listener = function (event) { var suggestion_selected = jQuery(".pac-item-selected").length > 0; if (event.which == 13 && !suggestion_selected) { var simulated_downarrow = jQuery.Event("keydown", { keyCode: 40, which: 40 }); orig_listener.apply(input, [simulated_downarrow]); } orig_listener.apply(input, [event]); }; } // add the modified listener _addEventListener.apply(input, [type, listener]); } if (input.addEventListener) { input.addEventListener = addEventListenerWrapper; } else if (input.attachEvent) { input.attachEvent = addEventListenerWrapper; } }