const $ = require('jquery'); const Bloodhound = require("typeahead.js/dist/bloodhound.js"); const Typeahead = require("typeahead.js/dist/typeahead.jquery.js"); class Finder { constructor(section) { const t = this; this.serviceUrlBase = "/blueprint/servlet/serviceport/ihkfinder"; this.ihklListUrl = 'services/ihkList.json';//this.serviceUrlBase + "/ihk/all"; this.communitiesUrl = 'services/communities.json';//this.serviceUrlBase + "/community/all"; // berechnen d // center ist geolocation aus js api // item die IHK /* const p = 0.017453292519943295; const c = Math.cos; const a = 0.5 - c((item.lat - center.lat) * p) / 2 + c(center.lat * p) * c(item.lat * p) * (1 - c((item.lng - center.lng) * p)) / 2; const distance = 12742 * Math.asin(Math.sqrt(a)); */ $(section).addClass("initialized"); t.section = section; t.map = section.find('.map'); t.form = section.find('.ihk-finder'); t.charMap = { 'a': /[àáâ]/gi, 'c': /[ç]/gi, 'e': /[èéêë]/gi, 'i': /[ï]/gi, 'o': /[ô]/gi, 'oe': /[œ]/gi, 'u': /[ü]/gi, 's': /[ß]/gi }; t.loadLocations(); } loadLocations() { const t = this; $('.page-header .toggle-ihk-list').on('click', function (e) { e.preventDefault(); $('.page-header').toggleClass('nav-open'); }); t.mapBox = { top: 55.1, right: 15.2, bottom: 47.1, left: 5.8 }; t.indexLetter = ""; t.ihkIndex = $('