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://solvi-web/./app/packs/entrypoints/external.js"],"sourcesContent":["// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/packs and only use these pack files to reference\n// that code so it'll be compiled.\n//\n// To reference this file, add <%= javascript_pack_tag 'external' %> to the appropriate\n// layout file, like app/views/layouts/external.html.erb\n\n// Uncomment to copy all static images under ../images to the output folder and reference\n// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)\n// or the `imagePath` JavaScript helper below.\n//\n// const images = require.context('../images', true)\n// const imagePath = (name) => images(name, true)\n\nimport './external.css'\nimport TileLayer from 'ol/layer/Tile'\nimport Map from 'ol/Map'\nimport View from 'ol/View'\nimport * as olProj from 'ol/proj'\nimport VectorLayer from 'ol/layer/Vector'\nimport VectorSource from 'ol/source/Vector'\nimport Feature from 'ol/Feature'\nimport Point from 'ol/geom/Point'\nimport Style from 'ol/style/Style'\nimport Fill from 'ol/style/Fill'\nimport Stroke from 'ol/style/Stroke'\nimport Circle from 'ol/style/Circle'\nimport XYZSource from 'ol/source/XYZ'\nimport { boundingExtent } from 'ol/extent'\n\nwindow.solviExternal = Object.assign(window.solviExternal || {}, {\n addSmoothScroll: function () {\n document.querySelectorAll('a[href^=\"#\"]').forEach(anchor => {\n anchor.addEventListener('click', function (e) {\n e.preventDefault()\n\n document.querySelector(this.getAttribute('href')).scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n })\n })\n })\n },\n findUs: function (mapboxToken) {\n const locations = [\n [11.966835, 57.708104],\n [-78.851039, 35.732172],\n ].map(location => olProj.fromLonLat(location))\n const extent = boundingExtent(locations)\n const view = new View()\n\n const map = new Map({\n target: 'map',\n controls: [],\n layers: [\n new TileLayer({\n source: new XYZSource({\n maxZoom: 17,\n tileSize: [512, 512],\n url:\n 'https://api.mapbox.com/styles/v1/mapbox/light-v10/tiles/{z}/{x}/{y}?access_token=' +\n mapboxToken,\n }),\n }),\n ],\n view,\n })\n\n const contactBox = document.querySelector('#contact-box')\n\n view.fit(extent, { padding: [30, contactBox.clientWidth + 60, 30, 30] })\n\n const layer = new VectorLayer({\n source: new VectorSource({\n features: locations.map(\n location =>\n new Feature({\n geometry: new Point(location),\n })\n ),\n }),\n style: new Style({\n image: new Circle({\n radius: 10,\n fill: new Fill({ color: [255, 255, 255, 1] }),\n stroke: new Stroke({ color: [0, 166, 204], width: 9 }),\n }),\n }),\n })\n map.addLayer(layer)\n },\n})\n"],"names":["window","solviExternal","Object","assign","addSmoothScroll","document","querySelectorAll","forEach","anchor","addEventListener","e","preventDefault","querySelector","this","getAttribute","scrollIntoView","behavior","block","findUs","mapboxToken","locations","map","location","olProj","extent","boundingExtent","view","View","Map","target","controls","layers","TileLayer","source","XYZSource","maxZoom","tileSize","url","contactBox","fit","padding","clientWidth","layer","VectorLayer","VectorSource","features","Feature","geometry","Point","style","Style","image","Circle","radius","fill","Fill","color","stroke","Stroke","width","addLayer"],"sourceRoot":""}