{"version":3,"sources":["map.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"map.js","sourcesContent":["(function ($, undefined) {\r\n window.initMap = function () {\r\n const $map = $('.js-contact-map');\r\n\r\n const mapPosition = {lat: 47.014080840325, lng: 28.85455516390801};\r\n\r\n const map = new google.maps.Map($map[0], {\r\n mapId: '212b1dc8432b2dbe',\r\n zoom: 15,\r\n center: mapPosition\r\n });\r\n\r\n const $mapElements = $('.js-map-marker');\r\n const bounds = new google.maps.LatLngBounds();\r\n const points = [];\r\n\r\n $mapElements.each(function () {\r\n const $this = $(this),\r\n lat = $this.attr(\"data-location-lat\"),\r\n lng = $this.attr(\"data-location-lng\");\r\n\r\n const isMapElement = (lat.length && lng.length);\r\n\r\n if (isMapElement) {\r\n points.push({\r\n position: {lat: +lat, lng: +lng}\r\n });\r\n }\r\n\r\n points.forEach(point => {\r\n const marker = new google.maps.Marker({\r\n map,\r\n position: point.position,\r\n icon: '/wp-content/themes/project/assets/build/img/domus-pin.svg'\r\n });\r\n bounds.extend(marker.position);\r\n });\r\n\r\n map.fitBounds(bounds);\r\n });\r\n }\r\n})(jQuery);"]}