1(function(){"use strict";var __webpack_modules__={
1"./src/js/components/map.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createMaps\": function() { return /* binding */ createMaps; }\n/* harmony export */ });\n/* harmony import */ var _google_maps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../google-maps */ \"./src/js/google-maps.js\");\n/* harmony import */ var _google_map_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../google-map-styles */ \"./src/js/google-map-styles.js\");\n/* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observer */ \"./src/js/observer.js\");\n\n\n\nfunction AKWMap(el) {\n this.el = el;\n this.apiOptions = {};\n this.places = [];\n this.positions = [];\n this.google = null;\n this.container = null;\n this.markers = [];\n this.map = null;\n this.mapListeners = {\n idle: null,\n dragstart: null,\n dragend: null,\n markers: []\n };\n this.colors = {\n primary: '#000000'\n };\n this.infoWindow = null;\n this.openInfoWindow = (marker, content) => {\n this.infoWindow.setContent(content);\n this.infoWindow.open(this.map, marker);\n };\n this.getPlacePosition = place => ({\n lat: parseFloat(place.location.lat),\n lng: parseFloat(place.location.lng)\n });\n this.fitToBounds = positions => {\n const bounds = new this.google.maps.LatLngBounds();\n positions.forEach(pos => bounds.extend(new this.google.maps.LatLng(pos.lat, pos.lng)));\n this.map.fitBounds(bounds);\n };\n this.createMarkers = () => {\n this.markers = this.places.map((place, i) => {\n const width = 48;\n const height = 48;\n const position = this.positions[i];\n const address = place.address ?? place.location.address;\n const marker = new this.google.maps.Marker({\n position,\n map: this.map,\n opacity: 1,\n optimized: false,\n icon: {\n scaledSize: new this.google.maps.Size(width, height),\n origin: new this.google.maps.Point(0, 0),\n anchor: new this.google.maps.Point(width / 2, height),\n scale: 1,\n url: `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 00-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 00-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z' fill='${encodeURIComponent(this.colors.primary)}'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E`\n }\n });\n const content = `\n <div class=\"info-window\">\n <div class=\"info-window-content\">\n <div class=\"info-window-title\">${place.name}</div>\n <div class=\"info-window-address\">${address}</div>\n <div class=\"info-window-links\">\n <a class=\"info-window-link\" href=\"https://www.google.fi/maps/dir//${position.lat},${position.lng}/@${position.lat},${position.lng}z\" target=\"_blank\" rel=\"noopener nofollow\">Reittiohjeet\n </a>\n </div>\n </div>\n \n </div>\n `;\n this.mapListeners.markers.push(marker.addListener('click', () => {\n this.openInfoWindow(marker, content);\n }));\n return marker;\n });\n };\n this.create = () => {\n // Create container\n // this.container = document.createElement('div');\n // this.container.classList.add('map__container');\n // this.el.appendChild(this.container);\n\n this.map = new this.google.maps.Map(this.el, {\n center: this.positions[0],\n zoom: 7,\n styles: _google_map_styles__WEBPACK_IMPORTED_MODULE_1__[\"default\"].monochrome,\n streetViewControl: false,\n mapTypeControl: false\n });\n this.infoWindow = new this.google.maps.InfoWindow({\n disableAutoPan: false,\n maxWidth: 260\n });\n this.createMarkers();\n };\n this.load = async () => {\n try {\n this.google = await (0,_google_maps__WEBPACK_IMPORTED_MODULE_0__.initGoogleMaps)(this.apiOptions);\n this.create();\n } catch (error) {\n console.log(error);\n }\n };\n this.init = () => {\n this.apiOptions = JSON.parse(this.el.getAttribute('data-akw-ma
1p-options'));\n this.places = JSON.parse(this.el.getAttribute('data-akw-map-places'));\n this.positions = this.places.map(place => this.getPlacePosition(place));\n this.colors.primary = getComputedStyle(document.documentElement).getPropertyValue('--color-primary');\n (0,_observer__WEBPACK_IMPORTED_MODULE_2__.observe)(this.el, this.load, {\n rootMargin: '100px'\n });\n };\n this.init();\n}\nconst createMaps = () => {\n [...document.querySelectorAll('.map')].map(el => new AKWMap(el));\n};\ncreateMaps();\n\n//# sourceURL=webpack://akw/./src/js/components/map.js?")},
1"./src/js/google-map-styles.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n monochrome: [{\n stylers: [{\n saturation: -100\n }, {\n lightness: 20\n }]\n }, {\n featureType: 'poi',\n stylers: [{\n visibility: 'off'\n }]\n }],\n default2: [{\n stylers: [{\n saturation: -20\n }, {\n lightness: 25\n }, {\n hue: '#60c6e6'\n }]\n }, {\n featureType: 'poi.attraction',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.business',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.government',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.medical',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.place_of_worship',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.school',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.sports_complex',\n stylers: [{\n visibility: 'off'\n }]\n }],\n default: [{\n featureType: 'poi.attraction',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.business',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.government',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.medical',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.park',\n stylers: [{\n color: '#E6F4DC'\n }]\n }, {\n featureType: 'poi.place_of_worship',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.school',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'poi.sports_complex',\n stylers: [{\n visibility: 'off'\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.fill',\n stylers: [{\n color: '#D9ABE4'\n }]\n }, {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{\n color: '#CE94DC'\n }]\n }, {\n featureType: 'water',\n stylers: [{\n color: '#CFEEFF'\n }]\n }, {\n featureType: 'landscape',\n stylers: [{\n hue: '#52B900'\n }, {\n lightness: 50\n }, {\n saturation: 0\n }]\n }, {\n featureType: 'administrative.province',\n stylers: [{\n visibility: 'off'\n }]\n }]\n});\n\n//# sourceURL=webpack://akw/./src/js/google-map-styles.js?")},
1"./src/js/google-maps.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"initGoogleMaps\": function() { return /* binding */ initGoogleMaps; }\n/* harmony export */ });\n// Your personal API key.\n// Get it here: https://console.cloud.google.com/google/maps-apis\nconst CALLBACK_NAME = 'gmapsCallback';\nlet initialized = !!window.google;\nlet resolveInitPromise;\nlet rejectInitPromise;\n// This promise handles the initialization\n// status of the google maps script.\nconst initPromise = new Promise((resolve, reject) => {\n resolveInitPromise = resolve;\n rejectInitPromise = reject;\n});\nconst initGoogleMaps = function () {\n let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const options = {\n apiKey: null,\n libraries: '',\n region: 'FI',\n language: 'fi',\n ...opts\n };\n // Require api key\n if (!options.apiKey) return rejectInitPromise;\n\n // If Google Maps already is initialized\n // the `initPromise` should get resolved\n // eventually.\n if (initialized) return initPromise;\n initialized = true;\n // The callback function is called by\n // the Google Maps script if it is\n // successfully loaded.\n window[CALLBACK_NAME] = () => resolveInitPromise(window.google);\n\n // We inject a new script tag into\n // the `<head>` of our HTML to load\n // the Google Maps script.\n const script = document.createElement('script');\n script.async = true;\n script.defer = true;\n script.src = `//maps.googleapis.com/maps/api/js?key=${options.apiKey}&libraries=${options.libraries}&language=${options.language}®ion=${options.region}&callback=${CALLBACK_NAME}`;\n script.onerror = rejectInitPromise;\n document.querySelector('head').appendChild(script);\n return initPromise;\n};\n\n//# sourceURL=webpack://akw/./src/js/google-maps.js?")},
1"./src/js/observer.js":function(__unused_webpack_module,__webpack_exports__,__webpack_require__){eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createObserver\": function() { return /* binding */ createObserver; },\n/* harmony export */ \"isObservable\": function() { return /* binding */ isObservable; },\n/* harmony export */ \"observe\": function() { return /* binding */ observe; }\n/* harmony export */ });\nconst isObservable = 'IntersectionObserver' in window || 'IntersectionObserverEntry' in window;\nconst createObserver = function (cb) {\n let {\n destroy = true,\n threshold = 0,\n rootMargin = '0px'\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n cb(entry);\n if (destroy) {\n observer.unobserve(entry.target);\n }\n }\n });\n }, {\n threshold,\n rootMargin\n });\n return observer;\n};\nconst observe = function (el, cb) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!isObservable) {\n cb();\n return;\n }\n const observer = createObserver(cb, options);\n observer.observe(el);\n};\n\n//# sourceURL=webpack://akw/./src/js/observer.js?")}
1},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](t,t.exports,__webpack_require__),t.exports}__webpack_require__.d=function(e,n){for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/js/components/map.js")})() 2;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.