{"id":24,"date":"2017-03-30T17:47:25","date_gmt":"2017-03-30T17:47:25","guid":{"rendered":"http:\/\/drdouglascaetano.med.br\/novo\/?page_id=24"},"modified":"2023-06-11T13:31:16","modified_gmt":"2023-06-11T13:31:16","slug":"consultorios","status":"publish","type":"page","link":"https:\/\/drdouglascaetano.med.br\/novo\/consultorios\/","title":{"rendered":"Consult\u00f3rios"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"24\" class=\"elementor elementor-24\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-55c823bb elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"55c823bb\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-15bfe496\" data-id=\"15bfe496\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3e289b41 elementor-widget elementor-widget-text-editor\" data-id=\"3e289b41\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: left;\"><b>CAMPO GRANDE<\/b><br \/>Estrada do Mendanha, 789, sala 308<br \/>WHATSAPP:\u00a0 (21) 99483-3877<br \/>Atendimento: segundas-feiras (16h \u00e0s 19h)\u00a0<\/p><p style=\"text-align: center;\"><iframe style=\"border: 0;\" src=\"https:\/\/www.google.com\/maps\/embed?pb=!1m18!1m12!1m3!1d3675.833629650738!2d-43.558965785189926!3d-22.882603442761013!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x9be17cb1590e33%3A0x3605d051ef48be69!2sEstr.%20do%20Mendanha%2C%20789%20-%20Campo%20Grande%2C%20Rio%20de%20Janeiro%20-%20RJ%2C%2023087-286!5e0!3m2!1spt-BR!2sbr!4v1582983920961!5m2!1spt-BR!2sbr\" width=\"600\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p><p><b>BARRA DA TIJUCA\u00a0<\/b><br \/>Avenida das Am\u00e9ricas, 3.255, sala 328, Shopping Barra Square, Barra da Tijuca<br \/>TEL: (21) 3284-5187 \/ WHATAPP: (21) 99483-3877<br \/>Atendimento: ter\u00e7as-feiras (13h \u00e0s 17h)<\/p><p style=\"text-align: left;\"><iframe style=\"border: 0;\" src=\"https:\/\/www.google.com\/maps\/embed?pb=!1m18!1m12!1m3!1d3672.6278723608275!2d-43.34274619999999!3d-23.0007077!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x9bda14ef06d9db%3A0x9e65b774f534b18a!2sBarra%20Garden%20Shopping!5e0!3m2!1spt-PT!2sbr!4v1655319872862!5m2!1spt-PT!2sbr\" width=\"600\" height=\"450\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p><p style=\"text-align: left;\"><b>CABO FRIO.\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/b><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight );\">Avenida J\u00falia Kubitschek 16, Sala 301 &#8211; Centro.\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Edif\u00edcio Premier Center<\/span><\/p><p>\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4cda7c9 elementor-widget elementor-widget-google_maps\" data-id=\"4cda7c9\" data-element_type=\"widget\" data-widget_type=\"google_maps.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-custom-embed\">\n\t\t\t<iframe loading=\"lazy\"\n\t\t\t\t\tsrc=\"https:\/\/www.google.com\/maps\/embed\/v1\/place?key=&lt;!--%20%20%20Copyright%202021%20Google%20LLC%20%20%20%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20&quot;License&quot;);%20%20%20you%20may%20not%20use%20this%20file%20except%20in%20compliance%20with%20the%20License.%20%20%20You%20may%20obtain%20a%20copy%20of%20the%20License%20at%20%20%20%20%20%20%20%20https:\/\/www.apache.org\/licenses\/LICENSE-2.0%20%20%20%20Unless%20required%20by%20applicable%20law%20or%20agreed%20to%20in%20writing,%20software%20%20%20distributed%20under%20the%20License%20is%20distributed%20on%20an%20&quot;AS%20IS&quot;%20BASIS,%20%20%20WITHOUT%20WARRANTIES%20OR%20CONDITIONS%20OF%20ANY%20KIND,%20either%20express%20or%20implied.%20%20%20See%20the%20License%20for%20the%20specific%20language%20governing%20permissions%20and%20%20%20limitations%20under%20the%20License.%20--&gt;%20&lt;!DOCTYPE%20html&gt;%20&lt;html&gt;%20%20%20&lt;head&gt;%20%20%20%20%20&lt;title&gt;Locator&lt;\/title&gt;%20%20%20%20%20&lt;meta%20charset=&quot;utf-8&quot;&gt;%20%20%20%20%20&lt;meta%20name=&quot;viewport&quot;%20content=&quot;width=device-width,initial-scale=1&quot;&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/polyfill.io\/v3\/polyfill.min.js?features=default&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/handlebars\/4.7.7\/handlebars.min.js&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;link%20href=&quot;https:\/\/fonts.googleapis.com\/css?family=Roboto&quot;%20rel=&quot;stylesheet&quot;&gt;%20%20%20%20%20&lt;style&gt;%20%20%20%20%20%20%20html,%20%20%20%20%20%20%20body%20%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20font-family:%20&quot;Roboto&quot;,%20sans-serif;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20a%20%20%20%20%20%20%20%20%20%20text-decoration:%20none;%20%20%20%20%20%20%20%20%20color:%20#1967d2;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20button%20%20%20%20%20%20%20%20%20%20background:%20none;%20%20%20%20%20%20%20%20%20color:%20inherit;%20%20%20%20%20%20%20%20%20border:%20none;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20font:%20inherit;%20%20%20%20%20%20%20%20%20font-size:%20inherit;%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20width:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20overflow-y:%20auto;%20%20%20%20%20%20%20%20%20background:%20white;%20%20%20%20%20%20%20%20%20padding:%200.5em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20@media%20only%20screen%20and%20(max-width:%20876px)%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20%20%20bottom:%2050%;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20%20%20top:%2050%;%20%20%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20%20%20width:%20unset;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20&gt;%20header%20%20%20%20%20%20%20%20%20%20padding:%201.4em%201.4em%200%201.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20&gt;%20img%20%20%20%20%20%20%20%20%20%20vertical-align:%20bottom;%20%20%20%20%20%20%20%20%20margin-top:%20-1em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20margin-top:%200.8em;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20border:%201px%20solid%20rgba(0,%200,%200,%200.2);%20%20%20%20%20%20%20%20%20border-radius:%200.3em;%20%20%20%20%20%20%20%20%20height:%202.2em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20padding:%200%202.5em%200%201em;%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20%20%20%20%20%20%20%20%20%20right:%202px;%20%20%20%20%20%20%20%20%20top:%202px;%20%20%20%20%20%20%20%20%20bottom:%202px;%20%20%20%20%20%20%20%20%20width:%202.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20button%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20border-radius:%200.2em;%20%20%20%20%20%20%20%20%20color:%20black;%20%20%20%20%20%20%20%20%20background:%20transparent;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20.icon%20%20%20%20%20%20%20%20%20%20margin-top:%200.05em;%20%20%20%20%20%20%20%20%20vertical-align:%20top;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.section-name%20%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin:%201.8em%200%201em%201.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20padding:%200.8em%203.5em%200.8em%201.4em;%20%20%20%20%20%20%20%20%20border-bottom:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:first-of-type%20%20%20%20%20%20%20%20%20%20border-top:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:last-of-type%20%20%20%20%20%20%20%20%20%20border-bottom:%20none;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result.selected%20%20%20%20%20%20%20%20%20%20outline:%202px%20solid%20#4285f4;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20button.select-location%20%20%20%20%20%20%20%20%20%20margin-bottom:%200.6em;%20%20%20%20%20%20%20%20%20text-align:%20left;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20h2.name%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.address%20%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin-bottom:%200.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20right:%201.2em;%20%20%20%20%20%20%20%20%20top:%202.3em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background:hover%20%20%20%20%20%20%20%20%20%20fill:%20rgba(116,120,127,0.1);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background%20%20%20%20%20%20%20%20%20%20fill:%20rgba(255,255,255,0.01);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.distance%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20top:%200.9em;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20text-align:%20center;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20width:%205em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#location-results-list%20%20%20%20%20%20%20%20%20%20list-style-type:%20none;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/style&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20&#039;use%20strict&#039;;%20%20%20%20%20%20%20%20\/**%20Helper%20function%20to%20generate%20a%20Google%20Maps%20directions%20URL%20*\/%20%20%20%20%20%20%20function%20generateDirectionsURL(origin,%20destination)%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrlBase%20=%20&#039;https:\/\/www.google.com\/maps\/dir\/?&#039;;%20%20%20%20%20%20%20%20%20const%20searchParams%20=%20new%20URLSearchParams(&#039;api=1&#039;);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;origin&#039;,%20origin);%20%20%20%20%20%20%20%20%20const%20destinationParam%20=%20[];%20%20%20%20%20%20%20%20%20\/\/%20Add%20title%20to%20destinationParam%20except%20in%20cases%20where%20Quick%20Builder%20set%20%20%20%20%20%20%20%20%20\/\/%20the%20title%20to%20the%20first%20line%20of%20the%20address%20%20%20%20%20%20%20%20%20if%20(destination.title%20!==%20destination.address1)%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.title);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.address1,%20destination.address2);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;destination&#039;,%20destinationParam.join(&#039;,&#039;));%20%20%20%20%20%20%20%20%20return%20googleMapsUrlBase%20+%20searchParams.toString();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20%20%20%20%20%20%20%20*%20Defines%20an%20instance%20of%20the%20Locator+%20solution,%20to%20be%20instantiated%20%20%20%20%20%20%20%20*%20when%20the%20Maps%20library%20is%20loaded.%20%20%20%20%20%20%20%20*\/%20%20%20%20%20%20%20function%20LocatorPlus(configuration)%20%20%20%20%20%20%20%20%20%20const%20locator%20=%20this;%20%20%20%20%20%20%20%20%20%20locator.locations%20=%20configuration.locations%20||%20[];%20%20%20%20%20%20%20%20%20locator.capabilities%20=%20configuration.capabilities%20||%20;%20%20%20%20%20%20%20%20%20%20const%20mapEl%20=%20document.getElementById(&#039;gmp-map&#039;);%20%20%20%20%20%20%20%20%20const%20panelEl%20=%20document.getElementById(&#039;locations-panel&#039;);%20%20%20%20%20%20%20%20%20locator.panelListEl%20=%20document.getElementById(&#039;locations-panel-list&#039;);%20%20%20%20%20%20%20%20%20const%20sectionNameEl%20=%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;location-results-section-name&#039;);%20%20%20%20%20%20%20%20%20const%20resultsContainerEl%20=%20document.getElementById(&#039;location-results-list&#039;);%20%20%20%20%20%20%20%20%20%20const%20itemsTemplate%20=%20Handlebars.compile(%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;locator-result-items-tmpl&#039;).innerHTML);%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20null;%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20null;%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20null;%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20the%20map%20-------------------------------------------------------%20%20%20%20%20%20%20%20%20locator.map%20=%20new%20google.maps.Map(mapEl,%20configuration.mapOptions);%20%20%20%20%20%20%20%20%20%20\/\/%20Store%20selection.%20%20%20%20%20%20%20%20%20const%20selectResultItem%20=%20function(locationIdx,%20panToMarker,%20scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20locationIdx;%20%20%20%20%20%20%20%20%20%20%20for%20(let%20locationElem%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.remove(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(getResultIndex(locationElem)%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20panelEl.scrollTop%20=%20locationElem.offsetTop;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(panToMarker%20&#038;&#038;%20(locationIdx%20!=%20null))%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.panTo(locator.locations[locationIdx].coords);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Create%20a%20marker%20for%20each%20location.%20%20%20%20%20%20%20%20%20const%20markers%20=%20locator.locations.map(function(location,%20index)%20%20%20%20%20%20%20%20%20%20%20%20const%20marker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location.coords,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20location.title,%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20marker.addListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(index,%20false,%20true);%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20return%20marker;%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Fit%20map%20to%20marker%20bounds.%20%20%20%20%20%20%20%20%20locator.updateBounds%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20bounds%20=%20new%20google.maps.LatLngBounds();%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(locator.searchLocationMarker.getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20markers.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(markers[i].getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.fitBounds(bounds);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20if%20(locator.locations.length)%20%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Get%20the%20distance%20of%20a%20store%20location%20to%20the%20user&#039;s%20location,%20%20%20%20%20%20%20%20%20\/\/%20used%20in%20sorting%20the%20list.%20%20%20%20%20%20%20%20%20const%20getLocationDistance%20=%20function(location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return%20null;%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Use%20travel%20distance%20if%20available%20(from%20Distance%20Matrix).%20%20%20%20%20%20%20%20%20%20%20if%20(location.travelDistanceValue%20!=%20null)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20location.travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Fall%20back%20to%20straight-line%20distance.%20%20%20%20%20%20%20%20%20%20%20return%20google.maps.geometry.spherical.computeDistanceBetween(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20new%20google.maps.LatLng(location.coords),%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Render%20the%20results%20list%20--------------------------------------------------%20%20%20%20%20%20%20%20%20const%20getResultIndex%20=%20function(elem)%20%20%20%20%20%20%20%20%20%20%20%20return%20parseInt(elem.getAttribute(&#039;data-location-index&#039;));%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20locator.renderResultsList%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20let%20locations%20=%20locator.locations.slice();%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20locations.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locations[i].index%20=%20i;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocation)%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;Nearest%20locations%20(&#039;%20+%20locations.length%20+%20&#039;)&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20locations.sort(function(a,%20b)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20getLocationDistance(a)%20-%20getLocationDistance(b);%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20else%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20All%20locations%20($locations.length);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultItemContext%20=%20locations:%20locations;%20%20%20%20%20%20%20%20%20%20%20resultsContainerEl.innerHTML%20=%20itemsTemplate(resultItemContext);%20%20%20%20%20%20%20%20%20%20%20for%20(let%20item%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultIndex%20=%20getResultIndex(item);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20item.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultSelectionHandler%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20!==%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(resultIndex,%20true,%20false);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20anywhere%20on%20the%20item%20selects%20this%20location.%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Additionally,%20create%20a%20button%20element%20to%20make%20this%20behavior%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20accessible%20under%20tab%20navigation.%20%20%20%20%20%20%20%20%20%20%20%20%20item.addEventListener(&#039;click&#039;,%20resultSelectionHandler);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.select-location&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.addEventListener(&#039;click&#039;,%20function(e)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20resultSelectionHandler();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20e.stopPropagation();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20the%20directions%20button%20will%20open%20Google%20Maps%20directions%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20new%20tab%20%20%20%20%20%20%20%20%20%20%20%20%20const%20origin%20=%20(locator.searchLocation%20!=%20null)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20const%20destination%20=%20locator.locations[resultIndex];%20%20%20%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrl%20=%20generateDirectionsURL(origin,%20destination);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.directions-button&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.setAttribute(&#039;href&#039;,%20googleMapsUrl);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Optional%20capability%20initialization%20--------------------------------------%20%20%20%20%20%20%20%20%20initializeSearchInput(locator);%20%20%20%20%20%20%20%20%20initializeDistanceMatrix(locator);%20%20%20%20%20%20%20%20%20%20\/\/%20Initial%20render%20of%20results%20-----------------------------------------------%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20When%20the%20search%20input%20capability%20is%20enabled,%20initialize%20it.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInput(locator)%20%20%20%20%20%20%20%20%20%20const%20geocodeCache%20=%20new%20Map();%20%20%20%20%20%20%20%20%20const%20geocoder%20=%20new%20google.maps.Geocoder();%20%20%20%20%20%20%20%20%20%20const%20searchInputEl%20=%20document.getElementById(&#039;location-search-input&#039;);%20%20%20%20%20%20%20%20%20const%20searchButtonEl%20=%20document.getElementById(&#039;location-search-button&#039;);%20%20%20%20%20%20%20%20%20%20const%20updateSearchLocation%20=%20function(address,%20location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker.setMap(null);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(!location)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20&#039;address&#039;:%20address,%20&#039;location&#039;:%20location;%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20&#039;My%20location&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20icon:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20path:%20google.maps.SymbolPath.CIRCLE,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20scale:%2012,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillColor:%20&#039;#3367D6&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillOpacity:%200.5,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20strokeOpacity:%200,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20locator&#039;s%20idea%20of%20the%20user&#039;s%20country,%20used%20for%20units.%20Use%20%20%20%20%20%20%20%20%20%20%20\/\/%20formatted_address%20instead%20of%20the%20more%20structured%20address_components%20%20%20%20%20%20%20%20%20%20%20\/\/%20to%20avoid%20an%20additional%20billed%20call.%20%20%20%20%20%20%20%20%20%20%20const%20addressParts%20=%20address.split(&#039;%20&#039;);%20%20%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20addressParts[addressParts.length%20-%201];%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20map%20bounds%20to%20include%20the%20new%20location%20marker.%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20result%20list%20so%20we%20can%20sort%20it%20by%20proximity.%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20locator.updateTravelTimes();%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20const%20geocodeSearch%20=%20function(query)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!query)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20handleResult%20=%20function(geocodeResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchInputEl.value%20=%20geocodeResult.formatted_address;%20%20%20%20%20%20%20%20%20%20%20%20%20updateSearchLocation(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeResult.formatted_address,%20geocodeResult.geometry.location);%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20if%20(geocodeCache.has(query))%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(geocodeCache.get(query));%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20address:%20query,%20bounds:%20locator.map.getBounds();%20%20%20%20%20%20%20%20%20%20%20geocoder.geocode(request,%20function(results,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(results.length%20&gt;%200)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20result%20=%20results[0];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeCache.set(query,%20result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20geocoding%20on%20the%20search%20input.%20%20%20%20%20%20%20%20%20searchButtonEl.addEventListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20geocodeSearch(searchInputEl.value.trim());%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20Autocomplete.%20%20%20%20%20%20%20%20%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20geocodeSearch,%20updateSearchLocation);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Add%20Autocomplete%20to%20the%20search%20input.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20fallbackSearch,%20searchLocationUpdater)%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20Autocomplete%20on%20the%20search%20input.%20Bias%20results%20to%20map%20viewport.%20%20%20%20%20%20%20%20%20const%20autocomplete%20=%20new%20google.maps.places.Autocomplete(searchInputEl,%20%20%20%20%20%20%20%20%20%20%20%20types:%20[&#039;geocode&#039;],%20%20%20%20%20%20%20%20%20%20%20fields:%20[&#039;place_id&#039;,%20&#039;formatted_address&#039;,%20&#039;geometry.location&#039;]%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20autocomplete.bindTo(&#039;bounds&#039;,%20locator.map);%20%20%20%20%20%20%20%20%20autocomplete.addListener(&#039;place_changed&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20placeResult%20=%20autocomplete.getPlace();%20%20%20%20%20%20%20%20%20%20%20if%20(!placeResult.geometry)%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Hitting%20&#039;Enter&#039;%20without%20selecting%20a%20suggestion%20will%20result%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20placeResult%20with%20only%20the%20text%20input%20value%20as%20the%20&#039;name&#039;%20field.%20%20%20%20%20%20%20%20%20%20%20%20%20fallbackSearch(placeResult.name);%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchLocationUpdater(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20placeResult.formatted_address,%20placeResult.geometry.location);%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Initialize%20Distance%20Matrix%20for%20the%20locator.%20*\/%20%20%20%20%20%20%20function%20initializeDistanceMatrix(locator)%20%20%20%20%20%20%20%20%20%20const%20distanceMatrixService%20=%20new%20google.maps.DistanceMatrixService();%20%20%20%20%20%20%20%20%20%20\/\/%20Annotate%20travel%20times%20to%20the%20selected%20location%20using%20Distance%20Matrix.%20%20%20%20%20%20%20%20%20locator.updateTravelTimes%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return;%20%20%20%20%20%20%20%20%20%20%20%20const%20units%20=%20(locator.userCountry%20===%20&#039;USA&#039;)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.IMPERIAL%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.METRIC;%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20origins:%20[locator.searchLocation.location],%20%20%20%20%20%20%20%20%20%20%20%20%20destinations:%20locator.locations.map(function(x)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20x.coords;%20%20%20%20%20%20%20%20%20%20%20%20%20),%20%20%20%20%20%20%20%20%20%20%20%20%20travelMode:%20google.maps.TravelMode.DRIVING,%20%20%20%20%20%20%20%20%20%20%20%20%20unitSystem:%20units,%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20const%20callback%20=%20function(response,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distances%20=%20response.rows[0].elements;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20distances.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distResult%20=%20distances[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20let%20travelDistanceText,%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(distResult.status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceText%20=%20distResult.distance.text;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceValue%20=%20distResult.distance.value;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20location%20=%20locator.locations[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceText%20=%20travelDistanceText;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceValue%20=%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Re-render%20the%20results%20list,%20in%20case%20the%20ordering%20has%20changed.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20distanceMatrixService.getDistanceMatrix(request,%20callback);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20const%20CONFIGURATION%20=%20%20%20%20%20%20%20%20%20%20&quot;locations&quot;:%20[%20%20%20%20%20%20%20%20%20%20%20&quot;title&quot;:&quot;Av.%20J\u00falia%20Kubitschek,%2016&quot;,&quot;address1&quot;:&quot;Av.%20J\u00falia%20Kubitschek&quot;,&quot;address2&quot;:&quot;16%20-%20Centro,%20Cabo%20Frio%20-%20RJ,%2028905-000,%20Brasil&quot;,&quot;coords&quot;:&quot;lat&quot;:-22.881008453731294,&quot;lng&quot;:-42.02655682023774,&quot;placeId&quot;:&quot;ChIJI1MfGM0ElwARoCvZM3AAu6w&quot;%20%20%20%20%20%20%20%20%20],%20%20%20%20%20%20%20%20%20&quot;mapOptions&quot;:%20&quot;center&quot;:&quot;lat&quot;:38.0,&quot;lng&quot;:-100.0,&quot;fullscreenControl&quot;:true,&quot;mapTypeControl&quot;:false,&quot;streetViewControl&quot;:false,&quot;zoom&quot;:4,&quot;zoomControl&quot;:true,&quot;maxZoom&quot;:17,&quot;mapId&quot;:&quot;&quot;,%20%20%20%20%20%20%20%20%20&quot;mapsApiKey&quot;:%20&quot;YOUR_API_KEY_HERE&quot;,%20%20%20%20%20%20%20%20%20&quot;capabilities&quot;:%20&quot;input&quot;:true,&quot;autocomplete&quot;:true,&quot;directions&quot;:false,&quot;distanceMatrix&quot;:true,&quot;details&quot;:false,&quot;actions&quot;:false%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20function%20initMap()%20%20%20%20%20%20%20%20%20%20new%20LocatorPlus(CONFIGURATION);%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script%20id=&quot;locator-result-items-tmpl&quot;%20type=&quot;text\/x-handlebars-template&quot;&gt;%20%20%20%20%20%20%20#each%20locations%20%20%20%20%20%20%20%20%20&lt;li%20class=&quot;location-result&quot;%20data-location-index=&quot;index&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;button%20class=&quot;select-location&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h2%20class=&quot;name&quot;&gt;title&lt;\/h2&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;address&quot;&gt;address1&lt;br&gt;address2&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20#if%20travelDistanceText%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;distance&quot;&gt;travelDistanceText&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20\/if%20%20%20%20%20%20%20%20%20%20%20&lt;a%20class=&quot;directions-button&quot;%20href=&quot;&quot;%20target=&quot;_blank&quot;%20title=&quot;Get%20directions%20to%20this%20location%20on%20Google%20Maps&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;svg%20width=&quot;34&quot;%20height=&quot;34&quot;%20viewBox=&quot;0%200%2034%2034&quot;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fill=&quot;none&quot;%20xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20d=&quot;M17.5867%209.24375L17.9403%208.8902V8.8902L17.5867%209.24375ZM16.4117%209.24375L16.7653%209.59731L16.7675%209.59502L16.4117%209.24375ZM8.91172%2016.7437L8.55817%2016.3902L8.91172%2016.7437ZM8.91172%2017.9229L8.55817%2018.2765L8.55826%2018.2766L8.91172%2017.9229ZM16.4117%2025.4187H16.9117V25.2116L16.7652%2025.0651L16.4117%2025.4187ZM16.4117%2025.4229H15.9117V25.63L16.0582%2025.7765L16.4117%2025.4229ZM25.0909%2017.9229L25.4444%2018.2765L25.4467%2018.2742L25.0909%2017.9229ZM25.4403%2016.3902L17.9403%208.8902L17.2332%209.5973L24.7332%2017.0973L25.4403%2016.3902ZM17.9403%208.8902C17.4213%208.3712%2016.5737%208.3679%2016.0559%208.89248L16.7675%209.59502C16.8914%209.4696%2017.1022%209.4663%2017.2332%209.5973L17.9403%208.8902ZM16.0582%208.8902L8.55817%2016.3902L9.26527%2017.0973L16.7653%209.5973L16.0582%208.8902ZM8.55817%2016.3902C8.0379%2016.9105%208.0379%2017.7562%208.55817%2018.2765L9.26527%2017.5694C9.13553%2017.4396%209.13553%2017.227%209.26527%2017.0973L8.55817%2016.3902ZM8.55826%2018.2766L16.0583%2025.7724L16.7652%2025.0651L9.26517%2017.5693L8.55826%2018.2766ZM15.9117%2025.4187V25.4229H16.9117V25.4187H15.9117ZM16.0582%2025.7765C16.5784%2026.2967%2017.4242%2026.2967%2017.9444%2025.7765L17.2373%2025.0694C17.1076%2025.1991%2016.895%2025.1991%2016.7653%2025.0694L16.0582%2025.7765ZM17.9444%2025.7765L25.4444%2018.2765L24.7373%2017.5694L17.2373%2025.0694L17.9444%2025.7765ZM25.4467%2018.2742C25.9631%2017.7512%2025.9663%2016.9096%2025.438%2016.3879L24.7354%2017.0995C24.8655%2017.2279%2024.8687%2017.4363%2024.7351%2017.5716L25.4467%2018.2742Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20fill-rule=&quot;evenodd&quot;%20clip-rule=&quot;evenodd&quot;%20d=&quot;M19%2019.8333V17.75H15.6667V20.25H14V16.9167C14%2016.4542%2014.3708%2016.0833%2014.8333%2016.0833H19V14L21.9167%2016.9167L19%2019.8333Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;circle%20class=&quot;directions-button-background&quot;%20cx=&quot;17&quot;%20cy=&quot;17&quot;%20r=&quot;16.5&quot;%20stroke=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/svg&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/a&gt;%20%20%20%20%20%20%20%20%20&lt;\/li&gt;%20%20%20%20%20%20%20\/each%20%20%20%20%20&lt;\/script&gt;%20%20%20&lt;\/head&gt;%20%20%20&lt;body&gt;%20%20%20%20%20&lt;div%20id=&quot;map-container&quot;&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel&quot;&gt;%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel-list&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;header&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h1%20class=&quot;search-title&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/place\/v15\/24px.svg&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Find%20a%20location%20near%20you%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/h1&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;search-input&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;input%20id=&quot;location-search-input&quot;%20placeholder=&quot;Enter%20your%20address%20or%20zip%20code&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;search-overlay-search&quot;%20class=&quot;search-input-overlay%20search&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;button%20id=&quot;location-search-button&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20class=&quot;icon&quot;%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/search\/v11\/24px.svg&quot;%20alt=&quot;Search&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/header&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;section-name&quot;%20id=&quot;location-results-section-name&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20All%20locations%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;results&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;ul%20id=&quot;location-results-list&quot;&gt;&lt;\/ul&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;gmp-map&quot;&gt;&lt;\/div&gt;%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY_HERE&#038;callback=initMap&#038;libraries=places,geometry&#038;solution_channel=GMP_QB_locatorplus_v6_cABD&quot;%20async%20defer&gt;&lt;\/script&gt;%20%20%20&lt;\/body&gt;%20&lt;\/html&gt;&#038;q=dr%20douglas&#038;zoom=10\"\n\t\t\t\t\ttitle=\"dr douglas\"\n\t\t\t\t\taria-label=\"dr douglas\"\n\t\t\t><\/iframe>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b2a1306 elementor-widget elementor-widget-google_maps\" data-id=\"b2a1306\" data-element_type=\"widget\" data-widget_type=\"google_maps.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-custom-embed\">\n\t\t\t<iframe loading=\"lazy\"\n\t\t\t\t\tsrc=\"https:\/\/www.google.com\/maps\/embed\/v1\/place?key=&lt;!--%20%20%20Copyright%202021%20Google%20LLC%20%20%20%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20&quot;License&quot;);%20%20%20you%20may%20not%20use%20this%20file%20except%20in%20compliance%20with%20the%20License.%20%20%20You%20may%20obtain%20a%20copy%20of%20the%20License%20at%20%20%20%20%20%20%20%20https:\/\/www.apache.org\/licenses\/LICENSE-2.0%20%20%20%20Unless%20required%20by%20applicable%20law%20or%20agreed%20to%20in%20writing,%20software%20%20%20distributed%20under%20the%20License%20is%20distributed%20on%20an%20&quot;AS%20IS&quot;%20BASIS,%20%20%20WITHOUT%20WARRANTIES%20OR%20CONDITIONS%20OF%20ANY%20KIND,%20either%20express%20or%20implied.%20%20%20See%20the%20License%20for%20the%20specific%20language%20governing%20permissions%20and%20%20%20limitations%20under%20the%20License.%20--&gt;%20&lt;!DOCTYPE%20html&gt;%20&lt;html&gt;%20%20%20&lt;head&gt;%20%20%20%20%20&lt;title&gt;Locator&lt;\/title&gt;%20%20%20%20%20&lt;meta%20charset=&quot;utf-8&quot;&gt;%20%20%20%20%20&lt;meta%20name=&quot;viewport&quot;%20content=&quot;width=device-width,initial-scale=1&quot;&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/polyfill.io\/v3\/polyfill.min.js?features=default&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/handlebars\/4.7.7\/handlebars.min.js&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;link%20href=&quot;https:\/\/fonts.googleapis.com\/css?family=Roboto&quot;%20rel=&quot;stylesheet&quot;&gt;%20%20%20%20%20&lt;style&gt;%20%20%20%20%20%20%20html,%20%20%20%20%20%20%20body%20%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20font-family:%20&quot;Roboto&quot;,%20sans-serif;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20a%20%20%20%20%20%20%20%20%20%20text-decoration:%20none;%20%20%20%20%20%20%20%20%20color:%20#1967d2;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20button%20%20%20%20%20%20%20%20%20%20background:%20none;%20%20%20%20%20%20%20%20%20color:%20inherit;%20%20%20%20%20%20%20%20%20border:%20none;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20font:%20inherit;%20%20%20%20%20%20%20%20%20font-size:%20inherit;%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20width:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20overflow-y:%20auto;%20%20%20%20%20%20%20%20%20background:%20white;%20%20%20%20%20%20%20%20%20padding:%200.5em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20@media%20only%20screen%20and%20(max-width:%20876px)%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20%20%20bottom:%2050%;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20%20%20top:%2050%;%20%20%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20%20%20width:%20unset;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20&gt;%20header%20%20%20%20%20%20%20%20%20%20padding:%201.4em%201.4em%200%201.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20&gt;%20img%20%20%20%20%20%20%20%20%20%20vertical-align:%20bottom;%20%20%20%20%20%20%20%20%20margin-top:%20-1em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20margin-top:%200.8em;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20border:%201px%20solid%20rgba(0,%200,%200,%200.2);%20%20%20%20%20%20%20%20%20border-radius:%200.3em;%20%20%20%20%20%20%20%20%20height:%202.2em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20padding:%200%202.5em%200%201em;%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20%20%20%20%20%20%20%20%20%20right:%202px;%20%20%20%20%20%20%20%20%20top:%202px;%20%20%20%20%20%20%20%20%20bottom:%202px;%20%20%20%20%20%20%20%20%20width:%202.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20button%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20border-radius:%200.2em;%20%20%20%20%20%20%20%20%20color:%20black;%20%20%20%20%20%20%20%20%20background:%20transparent;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20.icon%20%20%20%20%20%20%20%20%20%20margin-top:%200.05em;%20%20%20%20%20%20%20%20%20vertical-align:%20top;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.section-name%20%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin:%201.8em%200%201em%201.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20padding:%200.8em%203.5em%200.8em%201.4em;%20%20%20%20%20%20%20%20%20border-bottom:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:first-of-type%20%20%20%20%20%20%20%20%20%20border-top:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:last-of-type%20%20%20%20%20%20%20%20%20%20border-bottom:%20none;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result.selected%20%20%20%20%20%20%20%20%20%20outline:%202px%20solid%20#4285f4;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20button.select-location%20%20%20%20%20%20%20%20%20%20margin-bottom:%200.6em;%20%20%20%20%20%20%20%20%20text-align:%20left;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20h2.name%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.address%20%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin-bottom:%200.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20right:%201.2em;%20%20%20%20%20%20%20%20%20top:%202.3em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background:hover%20%20%20%20%20%20%20%20%20%20fill:%20rgba(116,120,127,0.1);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background%20%20%20%20%20%20%20%20%20%20fill:%20rgba(255,255,255,0.01);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.distance%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20top:%200.9em;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20text-align:%20center;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20width:%205em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#location-results-list%20%20%20%20%20%20%20%20%20%20list-style-type:%20none;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/style&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20&#039;use%20strict&#039;;%20%20%20%20%20%20%20%20\/**%20Helper%20function%20to%20generate%20a%20Google%20Maps%20directions%20URL%20*\/%20%20%20%20%20%20%20function%20generateDirectionsURL(origin,%20destination)%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrlBase%20=%20&#039;https:\/\/www.google.com\/maps\/dir\/?&#039;;%20%20%20%20%20%20%20%20%20const%20searchParams%20=%20new%20URLSearchParams(&#039;api=1&#039;);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;origin&#039;,%20origin);%20%20%20%20%20%20%20%20%20const%20destinationParam%20=%20[];%20%20%20%20%20%20%20%20%20\/\/%20Add%20title%20to%20destinationParam%20except%20in%20cases%20where%20Quick%20Builder%20set%20%20%20%20%20%20%20%20%20\/\/%20the%20title%20to%20the%20first%20line%20of%20the%20address%20%20%20%20%20%20%20%20%20if%20(destination.title%20!==%20destination.address1)%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.title);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.address1,%20destination.address2);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;destination&#039;,%20destinationParam.join(&#039;,&#039;));%20%20%20%20%20%20%20%20%20return%20googleMapsUrlBase%20+%20searchParams.toString();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20%20%20%20%20%20%20%20*%20Defines%20an%20instance%20of%20the%20Locator+%20solution,%20to%20be%20instantiated%20%20%20%20%20%20%20%20*%20when%20the%20Maps%20library%20is%20loaded.%20%20%20%20%20%20%20%20*\/%20%20%20%20%20%20%20function%20LocatorPlus(configuration)%20%20%20%20%20%20%20%20%20%20const%20locator%20=%20this;%20%20%20%20%20%20%20%20%20%20locator.locations%20=%20configuration.locations%20||%20[];%20%20%20%20%20%20%20%20%20locator.capabilities%20=%20configuration.capabilities%20||%20;%20%20%20%20%20%20%20%20%20%20const%20mapEl%20=%20document.getElementById(&#039;gmp-map&#039;);%20%20%20%20%20%20%20%20%20const%20panelEl%20=%20document.getElementById(&#039;locations-panel&#039;);%20%20%20%20%20%20%20%20%20locator.panelListEl%20=%20document.getElementById(&#039;locations-panel-list&#039;);%20%20%20%20%20%20%20%20%20const%20sectionNameEl%20=%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;location-results-section-name&#039;);%20%20%20%20%20%20%20%20%20const%20resultsContainerEl%20=%20document.getElementById(&#039;location-results-list&#039;);%20%20%20%20%20%20%20%20%20%20const%20itemsTemplate%20=%20Handlebars.compile(%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;locator-result-items-tmpl&#039;).innerHTML);%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20null;%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20null;%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20null;%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20the%20map%20-------------------------------------------------------%20%20%20%20%20%20%20%20%20locator.map%20=%20new%20google.maps.Map(mapEl,%20configuration.mapOptions);%20%20%20%20%20%20%20%20%20%20\/\/%20Store%20selection.%20%20%20%20%20%20%20%20%20const%20selectResultItem%20=%20function(locationIdx,%20panToMarker,%20scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20locationIdx;%20%20%20%20%20%20%20%20%20%20%20for%20(let%20locationElem%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.remove(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(getResultIndex(locationElem)%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20panelEl.scrollTop%20=%20locationElem.offsetTop;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(panToMarker%20&#038;&#038;%20(locationIdx%20!=%20null))%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.panTo(locator.locations[locationIdx].coords);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Create%20a%20marker%20for%20each%20location.%20%20%20%20%20%20%20%20%20const%20markers%20=%20locator.locations.map(function(location,%20index)%20%20%20%20%20%20%20%20%20%20%20%20const%20marker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location.coords,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20location.title,%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20marker.addListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(index,%20false,%20true);%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20return%20marker;%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Fit%20map%20to%20marker%20bounds.%20%20%20%20%20%20%20%20%20locator.updateBounds%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20bounds%20=%20new%20google.maps.LatLngBounds();%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(locator.searchLocationMarker.getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20markers.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(markers[i].getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.fitBounds(bounds);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20if%20(locator.locations.length)%20%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Get%20the%20distance%20of%20a%20store%20location%20to%20the%20user&#039;s%20location,%20%20%20%20%20%20%20%20%20\/\/%20used%20in%20sorting%20the%20list.%20%20%20%20%20%20%20%20%20const%20getLocationDistance%20=%20function(location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return%20null;%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Use%20travel%20distance%20if%20available%20(from%20Distance%20Matrix).%20%20%20%20%20%20%20%20%20%20%20if%20(location.travelDistanceValue%20!=%20null)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20location.travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Fall%20back%20to%20straight-line%20distance.%20%20%20%20%20%20%20%20%20%20%20return%20google.maps.geometry.spherical.computeDistanceBetween(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20new%20google.maps.LatLng(location.coords),%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Render%20the%20results%20list%20--------------------------------------------------%20%20%20%20%20%20%20%20%20const%20getResultIndex%20=%20function(elem)%20%20%20%20%20%20%20%20%20%20%20%20return%20parseInt(elem.getAttribute(&#039;data-location-index&#039;));%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20locator.renderResultsList%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20let%20locations%20=%20locator.locations.slice();%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20locations.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locations[i].index%20=%20i;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocation)%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;Nearest%20locations%20(&#039;%20+%20locations.length%20+%20&#039;)&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20locations.sort(function(a,%20b)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20getLocationDistance(a)%20-%20getLocationDistance(b);%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20else%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20All%20locations%20($locations.length);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultItemContext%20=%20locations:%20locations;%20%20%20%20%20%20%20%20%20%20%20resultsContainerEl.innerHTML%20=%20itemsTemplate(resultItemContext);%20%20%20%20%20%20%20%20%20%20%20for%20(let%20item%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultIndex%20=%20getResultIndex(item);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20item.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultSelectionHandler%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20!==%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(resultIndex,%20true,%20false);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20anywhere%20on%20the%20item%20selects%20this%20location.%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Additionally,%20create%20a%20button%20element%20to%20make%20this%20behavior%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20accessible%20under%20tab%20navigation.%20%20%20%20%20%20%20%20%20%20%20%20%20item.addEventListener(&#039;click&#039;,%20resultSelectionHandler);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.select-location&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.addEventListener(&#039;click&#039;,%20function(e)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20resultSelectionHandler();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20e.stopPropagation();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20the%20directions%20button%20will%20open%20Google%20Maps%20directions%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20new%20tab%20%20%20%20%20%20%20%20%20%20%20%20%20const%20origin%20=%20(locator.searchLocation%20!=%20null)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20const%20destination%20=%20locator.locations[resultIndex];%20%20%20%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrl%20=%20generateDirectionsURL(origin,%20destination);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.directions-button&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.setAttribute(&#039;href&#039;,%20googleMapsUrl);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Optional%20capability%20initialization%20--------------------------------------%20%20%20%20%20%20%20%20%20initializeSearchInput(locator);%20%20%20%20%20%20%20%20%20initializeDistanceMatrix(locator);%20%20%20%20%20%20%20%20%20%20\/\/%20Initial%20render%20of%20results%20-----------------------------------------------%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20When%20the%20search%20input%20capability%20is%20enabled,%20initialize%20it.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInput(locator)%20%20%20%20%20%20%20%20%20%20const%20geocodeCache%20=%20new%20Map();%20%20%20%20%20%20%20%20%20const%20geocoder%20=%20new%20google.maps.Geocoder();%20%20%20%20%20%20%20%20%20%20const%20searchInputEl%20=%20document.getElementById(&#039;location-search-input&#039;);%20%20%20%20%20%20%20%20%20const%20searchButtonEl%20=%20document.getElementById(&#039;location-search-button&#039;);%20%20%20%20%20%20%20%20%20%20const%20updateSearchLocation%20=%20function(address,%20location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker.setMap(null);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(!location)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20&#039;address&#039;:%20address,%20&#039;location&#039;:%20location;%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20&#039;My%20location&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20icon:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20path:%20google.maps.SymbolPath.CIRCLE,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20scale:%2012,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillColor:%20&#039;#3367D6&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillOpacity:%200.5,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20strokeOpacity:%200,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20locator&#039;s%20idea%20of%20the%20user&#039;s%20country,%20used%20for%20units.%20Use%20%20%20%20%20%20%20%20%20%20%20\/\/%20formatted_address%20instead%20of%20the%20more%20structured%20address_components%20%20%20%20%20%20%20%20%20%20%20\/\/%20to%20avoid%20an%20additional%20billed%20call.%20%20%20%20%20%20%20%20%20%20%20const%20addressParts%20=%20address.split(&#039;%20&#039;);%20%20%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20addressParts[addressParts.length%20-%201];%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20map%20bounds%20to%20include%20the%20new%20location%20marker.%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20result%20list%20so%20we%20can%20sort%20it%20by%20proximity.%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20locator.updateTravelTimes();%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20const%20geocodeSearch%20=%20function(query)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!query)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20handleResult%20=%20function(geocodeResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchInputEl.value%20=%20geocodeResult.formatted_address;%20%20%20%20%20%20%20%20%20%20%20%20%20updateSearchLocation(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeResult.formatted_address,%20geocodeResult.geometry.location);%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20if%20(geocodeCache.has(query))%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(geocodeCache.get(query));%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20address:%20query,%20bounds:%20locator.map.getBounds();%20%20%20%20%20%20%20%20%20%20%20geocoder.geocode(request,%20function(results,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(results.length%20&gt;%200)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20result%20=%20results[0];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeCache.set(query,%20result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20geocoding%20on%20the%20search%20input.%20%20%20%20%20%20%20%20%20searchButtonEl.addEventListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20geocodeSearch(searchInputEl.value.trim());%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20Autocomplete.%20%20%20%20%20%20%20%20%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20geocodeSearch,%20updateSearchLocation);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Add%20Autocomplete%20to%20the%20search%20input.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20fallbackSearch,%20searchLocationUpdater)%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20Autocomplete%20on%20the%20search%20input.%20Bias%20results%20to%20map%20viewport.%20%20%20%20%20%20%20%20%20const%20autocomplete%20=%20new%20google.maps.places.Autocomplete(searchInputEl,%20%20%20%20%20%20%20%20%20%20%20%20types:%20[&#039;geocode&#039;],%20%20%20%20%20%20%20%20%20%20%20fields:%20[&#039;place_id&#039;,%20&#039;formatted_address&#039;,%20&#039;geometry.location&#039;]%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20autocomplete.bindTo(&#039;bounds&#039;,%20locator.map);%20%20%20%20%20%20%20%20%20autocomplete.addListener(&#039;place_changed&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20placeResult%20=%20autocomplete.getPlace();%20%20%20%20%20%20%20%20%20%20%20if%20(!placeResult.geometry)%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Hitting%20&#039;Enter&#039;%20without%20selecting%20a%20suggestion%20will%20result%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20placeResult%20with%20only%20the%20text%20input%20value%20as%20the%20&#039;name&#039;%20field.%20%20%20%20%20%20%20%20%20%20%20%20%20fallbackSearch(placeResult.name);%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchLocationUpdater(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20placeResult.formatted_address,%20placeResult.geometry.location);%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Initialize%20Distance%20Matrix%20for%20the%20locator.%20*\/%20%20%20%20%20%20%20function%20initializeDistanceMatrix(locator)%20%20%20%20%20%20%20%20%20%20const%20distanceMatrixService%20=%20new%20google.maps.DistanceMatrixService();%20%20%20%20%20%20%20%20%20%20\/\/%20Annotate%20travel%20times%20to%20the%20selected%20location%20using%20Distance%20Matrix.%20%20%20%20%20%20%20%20%20locator.updateTravelTimes%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return;%20%20%20%20%20%20%20%20%20%20%20%20const%20units%20=%20(locator.userCountry%20===%20&#039;USA&#039;)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.IMPERIAL%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.METRIC;%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20origins:%20[locator.searchLocation.location],%20%20%20%20%20%20%20%20%20%20%20%20%20destinations:%20locator.locations.map(function(x)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20x.coords;%20%20%20%20%20%20%20%20%20%20%20%20%20),%20%20%20%20%20%20%20%20%20%20%20%20%20travelMode:%20google.maps.TravelMode.DRIVING,%20%20%20%20%20%20%20%20%20%20%20%20%20unitSystem:%20units,%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20const%20callback%20=%20function(response,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distances%20=%20response.rows[0].elements;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20distances.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distResult%20=%20distances[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20let%20travelDistanceText,%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(distResult.status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceText%20=%20distResult.distance.text;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceValue%20=%20distResult.distance.value;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20location%20=%20locator.locations[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceText%20=%20travelDistanceText;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceValue%20=%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Re-render%20the%20results%20list,%20in%20case%20the%20ordering%20has%20changed.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20distanceMatrixService.getDistanceMatrix(request,%20callback);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20const%20CONFIGURATION%20=%20%20%20%20%20%20%20%20%20%20&quot;locations&quot;:%20[%20%20%20%20%20%20%20%20%20%20%20&quot;title&quot;:&quot;Av.%20J\u00falia%20Kubitschek,%2016&quot;,&quot;address1&quot;:&quot;Av.%20J\u00falia%20Kubitschek&quot;,&quot;address2&quot;:&quot;16%20-%20Centro,%20Cabo%20Frio%20-%20RJ,%2028905-000,%20Brasil&quot;,&quot;coords&quot;:&quot;lat&quot;:-22.881008453731294,&quot;lng&quot;:-42.02655682023774,&quot;placeId&quot;:&quot;ChIJI1MfGM0ElwARoCvZM3AAu6w&quot;%20%20%20%20%20%20%20%20%20],%20%20%20%20%20%20%20%20%20&quot;mapOptions&quot;:%20&quot;center&quot;:&quot;lat&quot;:38.0,&quot;lng&quot;:-100.0,&quot;fullscreenControl&quot;:true,&quot;mapTypeControl&quot;:false,&quot;streetViewControl&quot;:false,&quot;zoom&quot;:4,&quot;zoomControl&quot;:true,&quot;maxZoom&quot;:17,&quot;mapId&quot;:&quot;&quot;,%20%20%20%20%20%20%20%20%20&quot;mapsApiKey&quot;:%20&quot;YOUR_API_KEY_HERE&quot;,%20%20%20%20%20%20%20%20%20&quot;capabilities&quot;:%20&quot;input&quot;:true,&quot;autocomplete&quot;:true,&quot;directions&quot;:false,&quot;distanceMatrix&quot;:true,&quot;details&quot;:false,&quot;actions&quot;:false%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20function%20initMap()%20%20%20%20%20%20%20%20%20%20new%20LocatorPlus(CONFIGURATION);%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script%20id=&quot;locator-result-items-tmpl&quot;%20type=&quot;text\/x-handlebars-template&quot;&gt;%20%20%20%20%20%20%20#each%20locations%20%20%20%20%20%20%20%20%20&lt;li%20class=&quot;location-result&quot;%20data-location-index=&quot;index&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;button%20class=&quot;select-location&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h2%20class=&quot;name&quot;&gt;title&lt;\/h2&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;address&quot;&gt;address1&lt;br&gt;address2&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20#if%20travelDistanceText%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;distance&quot;&gt;travelDistanceText&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20\/if%20%20%20%20%20%20%20%20%20%20%20&lt;a%20class=&quot;directions-button&quot;%20href=&quot;&quot;%20target=&quot;_blank&quot;%20title=&quot;Get%20directions%20to%20this%20location%20on%20Google%20Maps&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;svg%20width=&quot;34&quot;%20height=&quot;34&quot;%20viewBox=&quot;0%200%2034%2034&quot;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fill=&quot;none&quot;%20xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20d=&quot;M17.5867%209.24375L17.9403%208.8902V8.8902L17.5867%209.24375ZM16.4117%209.24375L16.7653%209.59731L16.7675%209.59502L16.4117%209.24375ZM8.91172%2016.7437L8.55817%2016.3902L8.91172%2016.7437ZM8.91172%2017.9229L8.55817%2018.2765L8.55826%2018.2766L8.91172%2017.9229ZM16.4117%2025.4187H16.9117V25.2116L16.7652%2025.0651L16.4117%2025.4187ZM16.4117%2025.4229H15.9117V25.63L16.0582%2025.7765L16.4117%2025.4229ZM25.0909%2017.9229L25.4444%2018.2765L25.4467%2018.2742L25.0909%2017.9229ZM25.4403%2016.3902L17.9403%208.8902L17.2332%209.5973L24.7332%2017.0973L25.4403%2016.3902ZM17.9403%208.8902C17.4213%208.3712%2016.5737%208.3679%2016.0559%208.89248L16.7675%209.59502C16.8914%209.4696%2017.1022%209.4663%2017.2332%209.5973L17.9403%208.8902ZM16.0582%208.8902L8.55817%2016.3902L9.26527%2017.0973L16.7653%209.5973L16.0582%208.8902ZM8.55817%2016.3902C8.0379%2016.9105%208.0379%2017.7562%208.55817%2018.2765L9.26527%2017.5694C9.13553%2017.4396%209.13553%2017.227%209.26527%2017.0973L8.55817%2016.3902ZM8.55826%2018.2766L16.0583%2025.7724L16.7652%2025.0651L9.26517%2017.5693L8.55826%2018.2766ZM15.9117%2025.4187V25.4229H16.9117V25.4187H15.9117ZM16.0582%2025.7765C16.5784%2026.2967%2017.4242%2026.2967%2017.9444%2025.7765L17.2373%2025.0694C17.1076%2025.1991%2016.895%2025.1991%2016.7653%2025.0694L16.0582%2025.7765ZM17.9444%2025.7765L25.4444%2018.2765L24.7373%2017.5694L17.2373%2025.0694L17.9444%2025.7765ZM25.4467%2018.2742C25.9631%2017.7512%2025.9663%2016.9096%2025.438%2016.3879L24.7354%2017.0995C24.8655%2017.2279%2024.8687%2017.4363%2024.7351%2017.5716L25.4467%2018.2742Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20fill-rule=&quot;evenodd&quot;%20clip-rule=&quot;evenodd&quot;%20d=&quot;M19%2019.8333V17.75H15.6667V20.25H14V16.9167C14%2016.4542%2014.3708%2016.0833%2014.8333%2016.0833H19V14L21.9167%2016.9167L19%2019.8333Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;circle%20class=&quot;directions-button-background&quot;%20cx=&quot;17&quot;%20cy=&quot;17&quot;%20r=&quot;16.5&quot;%20stroke=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/svg&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/a&gt;%20%20%20%20%20%20%20%20%20&lt;\/li&gt;%20%20%20%20%20%20%20\/each%20%20%20%20%20&lt;\/script&gt;%20%20%20&lt;\/head&gt;%20%20%20&lt;body&gt;%20%20%20%20%20&lt;div%20id=&quot;map-container&quot;&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel&quot;&gt;%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel-list&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;header&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h1%20class=&quot;search-title&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/place\/v15\/24px.svg&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Find%20a%20location%20near%20you%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/h1&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;search-input&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;input%20id=&quot;location-search-input&quot;%20placeholder=&quot;Enter%20your%20address%20or%20zip%20code&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;search-overlay-search&quot;%20class=&quot;search-input-overlay%20search&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;button%20id=&quot;location-search-button&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20class=&quot;icon&quot;%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/search\/v11\/24px.svg&quot;%20alt=&quot;Search&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/header&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;section-name&quot;%20id=&quot;location-results-section-name&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20All%20locations%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;results&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;ul%20id=&quot;location-results-list&quot;&gt;&lt;\/ul&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;gmp-map&quot;&gt;&lt;\/div&gt;%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY_HERE&#038;callback=initMap&#038;libraries=places,geometry&#038;solution_channel=GMP_QB_locatorplus_v6_cABD&quot;%20async%20defer&gt;&lt;\/script&gt;%20%20%20&lt;\/body&gt;%20&lt;\/html&gt;&#038;q=brazil&#038;zoom=10\"\n\t\t\t\t\ttitle=\"brazil\"\n\t\t\t\t\taria-label=\"brazil\"\n\t\t\t><\/iframe>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e0b1888 elementor-widget elementor-widget-google_maps\" data-id=\"e0b1888\" data-element_type=\"widget\" data-widget_type=\"google_maps.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-custom-embed\">\n\t\t\t<iframe loading=\"lazy\"\n\t\t\t\t\tsrc=\"https:\/\/www.google.com\/maps\/embed\/v1\/place?key=&lt;!--%20%20%20Copyright%202021%20Google%20LLC%20%20%20%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20&quot;License&quot;);%20%20%20you%20may%20not%20use%20this%20file%20except%20in%20compliance%20with%20the%20License.%20%20%20You%20may%20obtain%20a%20copy%20of%20the%20License%20at%20%20%20%20%20%20%20%20https:\/\/www.apache.org\/licenses\/LICENSE-2.0%20%20%20%20Unless%20required%20by%20applicable%20law%20or%20agreed%20to%20in%20writing,%20software%20%20%20distributed%20under%20the%20License%20is%20distributed%20on%20an%20&quot;AS%20IS&quot;%20BASIS,%20%20%20WITHOUT%20WARRANTIES%20OR%20CONDITIONS%20OF%20ANY%20KIND,%20either%20express%20or%20implied.%20%20%20See%20the%20License%20for%20the%20specific%20language%20governing%20permissions%20and%20%20%20limitations%20under%20the%20License.%20--&gt;%20&lt;!DOCTYPE%20html&gt;%20&lt;html&gt;%20%20%20&lt;head&gt;%20%20%20%20%20&lt;title&gt;Locator&lt;\/title&gt;%20%20%20%20%20&lt;meta%20charset=&quot;utf-8&quot;&gt;%20%20%20%20%20&lt;meta%20name=&quot;viewport&quot;%20content=&quot;width=device-width,initial-scale=1&quot;&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/polyfill.io\/v3\/polyfill.min.js?features=default&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/handlebars\/4.7.7\/handlebars.min.js&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;link%20href=&quot;https:\/\/fonts.googleapis.com\/css?family=Roboto&quot;%20rel=&quot;stylesheet&quot;&gt;%20%20%20%20%20&lt;style&gt;%20%20%20%20%20%20%20html,%20%20%20%20%20%20%20body%20%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20font-family:%20&quot;Roboto&quot;,%20sans-serif;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20a%20%20%20%20%20%20%20%20%20%20text-decoration:%20none;%20%20%20%20%20%20%20%20%20color:%20#1967d2;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20button%20%20%20%20%20%20%20%20%20%20background:%20none;%20%20%20%20%20%20%20%20%20color:%20inherit;%20%20%20%20%20%20%20%20%20border:%20none;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20font:%20inherit;%20%20%20%20%20%20%20%20%20font-size:%20inherit;%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20width:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20overflow-y:%20auto;%20%20%20%20%20%20%20%20%20background:%20white;%20%20%20%20%20%20%20%20%20padding:%200.5em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20@media%20only%20screen%20and%20(max-width:%20876px)%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20%20%20bottom:%2050%;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20%20%20top:%2050%;%20%20%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20%20%20width:%20unset;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20&gt;%20header%20%20%20%20%20%20%20%20%20%20padding:%201.4em%201.4em%200%201.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20&gt;%20img%20%20%20%20%20%20%20%20%20%20vertical-align:%20bottom;%20%20%20%20%20%20%20%20%20margin-top:%20-1em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20margin-top:%200.8em;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20border:%201px%20solid%20rgba(0,%200,%200,%200.2);%20%20%20%20%20%20%20%20%20border-radius:%200.3em;%20%20%20%20%20%20%20%20%20height:%202.2em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20padding:%200%202.5em%200%201em;%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20%20%20%20%20%20%20%20%20%20right:%202px;%20%20%20%20%20%20%20%20%20top:%202px;%20%20%20%20%20%20%20%20%20bottom:%202px;%20%20%20%20%20%20%20%20%20width:%202.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20button%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20border-radius:%200.2em;%20%20%20%20%20%20%20%20%20color:%20black;%20%20%20%20%20%20%20%20%20background:%20transparent;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20.icon%20%20%20%20%20%20%20%20%20%20margin-top:%200.05em;%20%20%20%20%20%20%20%20%20vertical-align:%20top;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.section-name%20%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin:%201.8em%200%201em%201.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20padding:%200.8em%203.5em%200.8em%201.4em;%20%20%20%20%20%20%20%20%20border-bottom:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:first-of-type%20%20%20%20%20%20%20%20%20%20border-top:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:last-of-type%20%20%20%20%20%20%20%20%20%20border-bottom:%20none;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result.selected%20%20%20%20%20%20%20%20%20%20outline:%202px%20solid%20#4285f4;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20button.select-location%20%20%20%20%20%20%20%20%20%20margin-bottom:%200.6em;%20%20%20%20%20%20%20%20%20text-align:%20left;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20h2.name%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.address%20%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin-bottom:%200.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20right:%201.2em;%20%20%20%20%20%20%20%20%20top:%202.3em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background:hover%20%20%20%20%20%20%20%20%20%20fill:%20rgba(116,120,127,0.1);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background%20%20%20%20%20%20%20%20%20%20fill:%20rgba(255,255,255,0.01);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.distance%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20top:%200.9em;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20text-align:%20center;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20width:%205em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#location-results-list%20%20%20%20%20%20%20%20%20%20list-style-type:%20none;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/style&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20&#039;use%20strict&#039;;%20%20%20%20%20%20%20%20\/**%20Helper%20function%20to%20generate%20a%20Google%20Maps%20directions%20URL%20*\/%20%20%20%20%20%20%20function%20generateDirectionsURL(origin,%20destination)%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrlBase%20=%20&#039;https:\/\/www.google.com\/maps\/dir\/?&#039;;%20%20%20%20%20%20%20%20%20const%20searchParams%20=%20new%20URLSearchParams(&#039;api=1&#039;);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;origin&#039;,%20origin);%20%20%20%20%20%20%20%20%20const%20destinationParam%20=%20[];%20%20%20%20%20%20%20%20%20\/\/%20Add%20title%20to%20destinationParam%20except%20in%20cases%20where%20Quick%20Builder%20set%20%20%20%20%20%20%20%20%20\/\/%20the%20title%20to%20the%20first%20line%20of%20the%20address%20%20%20%20%20%20%20%20%20if%20(destination.title%20!==%20destination.address1)%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.title);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.address1,%20destination.address2);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;destination&#039;,%20destinationParam.join(&#039;,&#039;));%20%20%20%20%20%20%20%20%20return%20googleMapsUrlBase%20+%20searchParams.toString();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20%20%20%20%20%20%20%20*%20Defines%20an%20instance%20of%20the%20Locator+%20solution,%20to%20be%20instantiated%20%20%20%20%20%20%20%20*%20when%20the%20Maps%20library%20is%20loaded.%20%20%20%20%20%20%20%20*\/%20%20%20%20%20%20%20function%20LocatorPlus(configuration)%20%20%20%20%20%20%20%20%20%20const%20locator%20=%20this;%20%20%20%20%20%20%20%20%20%20locator.locations%20=%20configuration.locations%20||%20[];%20%20%20%20%20%20%20%20%20locator.capabilities%20=%20configuration.capabilities%20||%20;%20%20%20%20%20%20%20%20%20%20const%20mapEl%20=%20document.getElementById(&#039;gmp-map&#039;);%20%20%20%20%20%20%20%20%20const%20panelEl%20=%20document.getElementById(&#039;locations-panel&#039;);%20%20%20%20%20%20%20%20%20locator.panelListEl%20=%20document.getElementById(&#039;locations-panel-list&#039;);%20%20%20%20%20%20%20%20%20const%20sectionNameEl%20=%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;location-results-section-name&#039;);%20%20%20%20%20%20%20%20%20const%20resultsContainerEl%20=%20document.getElementById(&#039;location-results-list&#039;);%20%20%20%20%20%20%20%20%20%20const%20itemsTemplate%20=%20Handlebars.compile(%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;locator-result-items-tmpl&#039;).innerHTML);%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20null;%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20null;%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20null;%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20the%20map%20-------------------------------------------------------%20%20%20%20%20%20%20%20%20locator.map%20=%20new%20google.maps.Map(mapEl,%20configuration.mapOptions);%20%20%20%20%20%20%20%20%20%20\/\/%20Store%20selection.%20%20%20%20%20%20%20%20%20const%20selectResultItem%20=%20function(locationIdx,%20panToMarker,%20scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20locationIdx;%20%20%20%20%20%20%20%20%20%20%20for%20(let%20locationElem%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.remove(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(getResultIndex(locationElem)%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20panelEl.scrollTop%20=%20locationElem.offsetTop;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(panToMarker%20&#038;&#038;%20(locationIdx%20!=%20null))%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.panTo(locator.locations[locationIdx].coords);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Create%20a%20marker%20for%20each%20location.%20%20%20%20%20%20%20%20%20const%20markers%20=%20locator.locations.map(function(location,%20index)%20%20%20%20%20%20%20%20%20%20%20%20const%20marker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location.coords,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20location.title,%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20marker.addListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(index,%20false,%20true);%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20return%20marker;%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Fit%20map%20to%20marker%20bounds.%20%20%20%20%20%20%20%20%20locator.updateBounds%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20bounds%20=%20new%20google.maps.LatLngBounds();%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(locator.searchLocationMarker.getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20markers.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(markers[i].getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.fitBounds(bounds);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20if%20(locator.locations.length)%20%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Get%20the%20distance%20of%20a%20store%20location%20to%20the%20user&#039;s%20location,%20%20%20%20%20%20%20%20%20\/\/%20used%20in%20sorting%20the%20list.%20%20%20%20%20%20%20%20%20const%20getLocationDistance%20=%20function(location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return%20null;%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Use%20travel%20distance%20if%20available%20(from%20Distance%20Matrix).%20%20%20%20%20%20%20%20%20%20%20if%20(location.travelDistanceValue%20!=%20null)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20location.travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Fall%20back%20to%20straight-line%20distance.%20%20%20%20%20%20%20%20%20%20%20return%20google.maps.geometry.spherical.computeDistanceBetween(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20new%20google.maps.LatLng(location.coords),%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Render%20the%20results%20list%20--------------------------------------------------%20%20%20%20%20%20%20%20%20const%20getResultIndex%20=%20function(elem)%20%20%20%20%20%20%20%20%20%20%20%20return%20parseInt(elem.getAttribute(&#039;data-location-index&#039;));%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20locator.renderResultsList%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20let%20locations%20=%20locator.locations.slice();%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20locations.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locations[i].index%20=%20i;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocation)%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;Nearest%20locations%20(&#039;%20+%20locations.length%20+%20&#039;)&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20locations.sort(function(a,%20b)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20getLocationDistance(a)%20-%20getLocationDistance(b);%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20else%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20All%20locations%20($locations.length);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultItemContext%20=%20locations:%20locations;%20%20%20%20%20%20%20%20%20%20%20resultsContainerEl.innerHTML%20=%20itemsTemplate(resultItemContext);%20%20%20%20%20%20%20%20%20%20%20for%20(let%20item%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultIndex%20=%20getResultIndex(item);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20item.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultSelectionHandler%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20!==%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(resultIndex,%20true,%20false);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20anywhere%20on%20the%20item%20selects%20this%20location.%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Additionally,%20create%20a%20button%20element%20to%20make%20this%20behavior%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20accessible%20under%20tab%20navigation.%20%20%20%20%20%20%20%20%20%20%20%20%20item.addEventListener(&#039;click&#039;,%20resultSelectionHandler);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.select-location&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.addEventListener(&#039;click&#039;,%20function(e)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20resultSelectionHandler();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20e.stopPropagation();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20the%20directions%20button%20will%20open%20Google%20Maps%20directions%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20new%20tab%20%20%20%20%20%20%20%20%20%20%20%20%20const%20origin%20=%20(locator.searchLocation%20!=%20null)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20const%20destination%20=%20locator.locations[resultIndex];%20%20%20%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrl%20=%20generateDirectionsURL(origin,%20destination);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.directions-button&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.setAttribute(&#039;href&#039;,%20googleMapsUrl);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Optional%20capability%20initialization%20--------------------------------------%20%20%20%20%20%20%20%20%20initializeSearchInput(locator);%20%20%20%20%20%20%20%20%20initializeDistanceMatrix(locator);%20%20%20%20%20%20%20%20%20%20\/\/%20Initial%20render%20of%20results%20-----------------------------------------------%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20When%20the%20search%20input%20capability%20is%20enabled,%20initialize%20it.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInput(locator)%20%20%20%20%20%20%20%20%20%20const%20geocodeCache%20=%20new%20Map();%20%20%20%20%20%20%20%20%20const%20geocoder%20=%20new%20google.maps.Geocoder();%20%20%20%20%20%20%20%20%20%20const%20searchInputEl%20=%20document.getElementById(&#039;location-search-input&#039;);%20%20%20%20%20%20%20%20%20const%20searchButtonEl%20=%20document.getElementById(&#039;location-search-button&#039;);%20%20%20%20%20%20%20%20%20%20const%20updateSearchLocation%20=%20function(address,%20location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker.setMap(null);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(!location)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20&#039;address&#039;:%20address,%20&#039;location&#039;:%20location;%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20&#039;My%20location&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20icon:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20path:%20google.maps.SymbolPath.CIRCLE,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20scale:%2012,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillColor:%20&#039;#3367D6&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillOpacity:%200.5,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20strokeOpacity:%200,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20locator&#039;s%20idea%20of%20the%20user&#039;s%20country,%20used%20for%20units.%20Use%20%20%20%20%20%20%20%20%20%20%20\/\/%20formatted_address%20instead%20of%20the%20more%20structured%20address_components%20%20%20%20%20%20%20%20%20%20%20\/\/%20to%20avoid%20an%20additional%20billed%20call.%20%20%20%20%20%20%20%20%20%20%20const%20addressParts%20=%20address.split(&#039;%20&#039;);%20%20%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20addressParts[addressParts.length%20-%201];%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20map%20bounds%20to%20include%20the%20new%20location%20marker.%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20result%20list%20so%20we%20can%20sort%20it%20by%20proximity.%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20locator.updateTravelTimes();%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20const%20geocodeSearch%20=%20function(query)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!query)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20handleResult%20=%20function(geocodeResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchInputEl.value%20=%20geocodeResult.formatted_address;%20%20%20%20%20%20%20%20%20%20%20%20%20updateSearchLocation(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeResult.formatted_address,%20geocodeResult.geometry.location);%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20if%20(geocodeCache.has(query))%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(geocodeCache.get(query));%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20address:%20query,%20bounds:%20locator.map.getBounds();%20%20%20%20%20%20%20%20%20%20%20geocoder.geocode(request,%20function(results,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(results.length%20&gt;%200)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20result%20=%20results[0];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeCache.set(query,%20result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20geocoding%20on%20the%20search%20input.%20%20%20%20%20%20%20%20%20searchButtonEl.addEventListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20geocodeSearch(searchInputEl.value.trim());%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20Autocomplete.%20%20%20%20%20%20%20%20%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20geocodeSearch,%20updateSearchLocation);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Add%20Autocomplete%20to%20the%20search%20input.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20fallbackSearch,%20searchLocationUpdater)%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20Autocomplete%20on%20the%20search%20input.%20Bias%20results%20to%20map%20viewport.%20%20%20%20%20%20%20%20%20const%20autocomplete%20=%20new%20google.maps.places.Autocomplete(searchInputEl,%20%20%20%20%20%20%20%20%20%20%20%20types:%20[&#039;geocode&#039;],%20%20%20%20%20%20%20%20%20%20%20fields:%20[&#039;place_id&#039;,%20&#039;formatted_address&#039;,%20&#039;geometry.location&#039;]%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20autocomplete.bindTo(&#039;bounds&#039;,%20locator.map);%20%20%20%20%20%20%20%20%20autocomplete.addListener(&#039;place_changed&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20placeResult%20=%20autocomplete.getPlace();%20%20%20%20%20%20%20%20%20%20%20if%20(!placeResult.geometry)%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Hitting%20&#039;Enter&#039;%20without%20selecting%20a%20suggestion%20will%20result%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20placeResult%20with%20only%20the%20text%20input%20value%20as%20the%20&#039;name&#039;%20field.%20%20%20%20%20%20%20%20%20%20%20%20%20fallbackSearch(placeResult.name);%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchLocationUpdater(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20placeResult.formatted_address,%20placeResult.geometry.location);%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Initialize%20Distance%20Matrix%20for%20the%20locator.%20*\/%20%20%20%20%20%20%20function%20initializeDistanceMatrix(locator)%20%20%20%20%20%20%20%20%20%20const%20distanceMatrixService%20=%20new%20google.maps.DistanceMatrixService();%20%20%20%20%20%20%20%20%20%20\/\/%20Annotate%20travel%20times%20to%20the%20selected%20location%20using%20Distance%20Matrix.%20%20%20%20%20%20%20%20%20locator.updateTravelTimes%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return;%20%20%20%20%20%20%20%20%20%20%20%20const%20units%20=%20(locator.userCountry%20===%20&#039;USA&#039;)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.IMPERIAL%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.METRIC;%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20origins:%20[locator.searchLocation.location],%20%20%20%20%20%20%20%20%20%20%20%20%20destinations:%20locator.locations.map(function(x)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20x.coords;%20%20%20%20%20%20%20%20%20%20%20%20%20),%20%20%20%20%20%20%20%20%20%20%20%20%20travelMode:%20google.maps.TravelMode.DRIVING,%20%20%20%20%20%20%20%20%20%20%20%20%20unitSystem:%20units,%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20const%20callback%20=%20function(response,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distances%20=%20response.rows[0].elements;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20distances.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distResult%20=%20distances[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20let%20travelDistanceText,%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(distResult.status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceText%20=%20distResult.distance.text;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceValue%20=%20distResult.distance.value;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20location%20=%20locator.locations[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceText%20=%20travelDistanceText;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceValue%20=%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Re-render%20the%20results%20list,%20in%20case%20the%20ordering%20has%20changed.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20distanceMatrixService.getDistanceMatrix(request,%20callback);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20const%20CONFIGURATION%20=%20%20%20%20%20%20%20%20%20%20&quot;locations&quot;:%20[%20%20%20%20%20%20%20%20%20%20%20&quot;title&quot;:&quot;Av.%20J\u00falia%20Kubitschek,%2016&quot;,&quot;address1&quot;:&quot;Av.%20J\u00falia%20Kubitschek&quot;,&quot;address2&quot;:&quot;16%20-%20Centro,%20Cabo%20Frio%20-%20RJ,%2028905-000,%20Brasil&quot;,&quot;coords&quot;:&quot;lat&quot;:-22.881008453731294,&quot;lng&quot;:-42.02655682023774,&quot;placeId&quot;:&quot;ChIJI1MfGM0ElwARoCvZM3AAu6w&quot;%20%20%20%20%20%20%20%20%20],%20%20%20%20%20%20%20%20%20&quot;mapOptions&quot;:%20&quot;center&quot;:&quot;lat&quot;:38.0,&quot;lng&quot;:-100.0,&quot;fullscreenControl&quot;:true,&quot;mapTypeControl&quot;:false,&quot;streetViewControl&quot;:false,&quot;zoom&quot;:4,&quot;zoomControl&quot;:true,&quot;maxZoom&quot;:17,&quot;mapId&quot;:&quot;&quot;,%20%20%20%20%20%20%20%20%20&quot;mapsApiKey&quot;:%20&quot;YOUR_API_KEY_HERE&quot;,%20%20%20%20%20%20%20%20%20&quot;capabilities&quot;:%20&quot;input&quot;:true,&quot;autocomplete&quot;:true,&quot;directions&quot;:false,&quot;distanceMatrix&quot;:true,&quot;details&quot;:false,&quot;actions&quot;:false%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20function%20initMap()%20%20%20%20%20%20%20%20%20%20new%20LocatorPlus(CONFIGURATION);%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script%20id=&quot;locator-result-items-tmpl&quot;%20type=&quot;text\/x-handlebars-template&quot;&gt;%20%20%20%20%20%20%20#each%20locations%20%20%20%20%20%20%20%20%20&lt;li%20class=&quot;location-result&quot;%20data-location-index=&quot;index&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;button%20class=&quot;select-location&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h2%20class=&quot;name&quot;&gt;title&lt;\/h2&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;address&quot;&gt;address1&lt;br&gt;address2&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20#if%20travelDistanceText%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;distance&quot;&gt;travelDistanceText&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20\/if%20%20%20%20%20%20%20%20%20%20%20&lt;a%20class=&quot;directions-button&quot;%20href=&quot;&quot;%20target=&quot;_blank&quot;%20title=&quot;Get%20directions%20to%20this%20location%20on%20Google%20Maps&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;svg%20width=&quot;34&quot;%20height=&quot;34&quot;%20viewBox=&quot;0%200%2034%2034&quot;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fill=&quot;none&quot;%20xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20d=&quot;M17.5867%209.24375L17.9403%208.8902V8.8902L17.5867%209.24375ZM16.4117%209.24375L16.7653%209.59731L16.7675%209.59502L16.4117%209.24375ZM8.91172%2016.7437L8.55817%2016.3902L8.91172%2016.7437ZM8.91172%2017.9229L8.55817%2018.2765L8.55826%2018.2766L8.91172%2017.9229ZM16.4117%2025.4187H16.9117V25.2116L16.7652%2025.0651L16.4117%2025.4187ZM16.4117%2025.4229H15.9117V25.63L16.0582%2025.7765L16.4117%2025.4229ZM25.0909%2017.9229L25.4444%2018.2765L25.4467%2018.2742L25.0909%2017.9229ZM25.4403%2016.3902L17.9403%208.8902L17.2332%209.5973L24.7332%2017.0973L25.4403%2016.3902ZM17.9403%208.8902C17.4213%208.3712%2016.5737%208.3679%2016.0559%208.89248L16.7675%209.59502C16.8914%209.4696%2017.1022%209.4663%2017.2332%209.5973L17.9403%208.8902ZM16.0582%208.8902L8.55817%2016.3902L9.26527%2017.0973L16.7653%209.5973L16.0582%208.8902ZM8.55817%2016.3902C8.0379%2016.9105%208.0379%2017.7562%208.55817%2018.2765L9.26527%2017.5694C9.13553%2017.4396%209.13553%2017.227%209.26527%2017.0973L8.55817%2016.3902ZM8.55826%2018.2766L16.0583%2025.7724L16.7652%2025.0651L9.26517%2017.5693L8.55826%2018.2766ZM15.9117%2025.4187V25.4229H16.9117V25.4187H15.9117ZM16.0582%2025.7765C16.5784%2026.2967%2017.4242%2026.2967%2017.9444%2025.7765L17.2373%2025.0694C17.1076%2025.1991%2016.895%2025.1991%2016.7653%2025.0694L16.0582%2025.7765ZM17.9444%2025.7765L25.4444%2018.2765L24.7373%2017.5694L17.2373%2025.0694L17.9444%2025.7765ZM25.4467%2018.2742C25.9631%2017.7512%2025.9663%2016.9096%2025.438%2016.3879L24.7354%2017.0995C24.8655%2017.2279%2024.8687%2017.4363%2024.7351%2017.5716L25.4467%2018.2742Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20fill-rule=&quot;evenodd&quot;%20clip-rule=&quot;evenodd&quot;%20d=&quot;M19%2019.8333V17.75H15.6667V20.25H14V16.9167C14%2016.4542%2014.3708%2016.0833%2014.8333%2016.0833H19V14L21.9167%2016.9167L19%2019.8333Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;circle%20class=&quot;directions-button-background&quot;%20cx=&quot;17&quot;%20cy=&quot;17&quot;%20r=&quot;16.5&quot;%20stroke=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/svg&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/a&gt;%20%20%20%20%20%20%20%20%20&lt;\/li&gt;%20%20%20%20%20%20%20\/each%20%20%20%20%20&lt;\/script&gt;%20%20%20&lt;\/head&gt;%20%20%20&lt;body&gt;%20%20%20%20%20&lt;div%20id=&quot;map-container&quot;&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel&quot;&gt;%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel-list&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;header&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h1%20class=&quot;search-title&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/place\/v15\/24px.svg&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Find%20a%20location%20near%20you%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/h1&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;search-input&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;input%20id=&quot;location-search-input&quot;%20placeholder=&quot;Enter%20your%20address%20or%20zip%20code&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;search-overlay-search&quot;%20class=&quot;search-input-overlay%20search&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;button%20id=&quot;location-search-button&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20class=&quot;icon&quot;%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/search\/v11\/24px.svg&quot;%20alt=&quot;Search&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/header&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;section-name&quot;%20id=&quot;location-results-section-name&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20All%20locations%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;results&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;ul%20id=&quot;location-results-list&quot;&gt;&lt;\/ul&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;gmp-map&quot;&gt;&lt;\/div&gt;%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY_HERE&#038;callback=initMap&#038;libraries=places,geometry&#038;solution_channel=GMP_QB_locatorplus_v6_cABD&quot;%20async%20defer&gt;&lt;\/script&gt;%20%20%20&lt;\/body&gt;%20&lt;\/html&gt;&#038;q=London%20Eye%2C%20Londres%2C%20Reino%20Unido&#038;zoom=10\"\n\t\t\t\t\ttitle=\"London Eye, Londres, Reino Unido\"\n\t\t\t\t\taria-label=\"London Eye, Londres, Reino Unido\"\n\t\t\t><\/iframe>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c91817a elementor-widget elementor-widget-google_maps\" data-id=\"c91817a\" data-element_type=\"widget\" data-widget_type=\"google_maps.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-custom-embed\">\n\t\t\t<iframe loading=\"lazy\"\n\t\t\t\t\tsrc=\"https:\/\/www.google.com\/maps\/embed\/v1\/place?key=&lt;!--%20%20%20Copyright%202021%20Google%20LLC%20%20%20%20Licensed%20under%20the%20Apache%20License,%20Version%202.0%20(the%20&quot;License&quot;);%20%20%20you%20may%20not%20use%20this%20file%20except%20in%20compliance%20with%20the%20License.%20%20%20You%20may%20obtain%20a%20copy%20of%20the%20License%20at%20%20%20%20%20%20%20%20https:\/\/www.apache.org\/licenses\/LICENSE-2.0%20%20%20%20Unless%20required%20by%20applicable%20law%20or%20agreed%20to%20in%20writing,%20software%20%20%20distributed%20under%20the%20License%20is%20distributed%20on%20an%20&quot;AS%20IS&quot;%20BASIS,%20%20%20WITHOUT%20WARRANTIES%20OR%20CONDITIONS%20OF%20ANY%20KIND,%20either%20express%20or%20implied.%20%20%20See%20the%20License%20for%20the%20specific%20language%20governing%20permissions%20and%20%20%20limitations%20under%20the%20License.%20--&gt;%20&lt;!DOCTYPE%20html&gt;%20&lt;html&gt;%20%20%20&lt;head&gt;%20%20%20%20%20&lt;title&gt;Locator&lt;\/title&gt;%20%20%20%20%20&lt;meta%20charset=&quot;utf-8&quot;&gt;%20%20%20%20%20&lt;meta%20name=&quot;viewport&quot;%20content=&quot;width=device-width,initial-scale=1&quot;&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/polyfill.io\/v3\/polyfill.min.js?features=default&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/handlebars\/4.7.7\/handlebars.min.js&quot;&gt;&lt;\/script&gt;%20%20%20%20%20&lt;link%20href=&quot;https:\/\/fonts.googleapis.com\/css?family=Roboto&quot;%20rel=&quot;stylesheet&quot;&gt;%20%20%20%20%20&lt;style&gt;%20%20%20%20%20%20%20html,%20%20%20%20%20%20%20body%20%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20font-family:%20&quot;Roboto&quot;,%20sans-serif;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20a%20%20%20%20%20%20%20%20%20%20text-decoration:%20none;%20%20%20%20%20%20%20%20%20color:%20#1967d2;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#map-container%20button%20%20%20%20%20%20%20%20%20%20background:%20none;%20%20%20%20%20%20%20%20%20color:%20inherit;%20%20%20%20%20%20%20%20%20border:%20none;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20font:%20inherit;%20%20%20%20%20%20%20%20%20font-size:%20inherit;%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20width:%2022em;%20%20%20%20%20%20%20%20%20top:%200;%20%20%20%20%20%20%20%20%20bottom:%200;%20%20%20%20%20%20%20%20%20overflow-y:%20auto;%20%20%20%20%20%20%20%20%20background:%20white;%20%20%20%20%20%20%20%20%20padding:%200.5em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20@media%20only%20screen%20and%20(max-width:%20876px)%20%20%20%20%20%20%20%20%20%20#gmp-map%20%20%20%20%20%20%20%20%20%20%20%20left:%200;%20%20%20%20%20%20%20%20%20%20%20bottom:%2050%;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel%20%20%20%20%20%20%20%20%20%20%20%20top:%2050%;%20%20%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20%20%20width:%20unset;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20&gt;%20header%20%20%20%20%20%20%20%20%20%20padding:%201.4em%201.4em%200%201.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20h1.search-title%20&gt;%20img%20%20%20%20%20%20%20%20%20%20vertical-align:%20bottom;%20%20%20%20%20%20%20%20%20margin-top:%20-1em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20margin-top:%200.8em;%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input%20input%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20border:%201px%20solid%20rgba(0,%200,%200,%200.2);%20%20%20%20%20%20%20%20%20border-radius:%200.3em;%20%20%20%20%20%20%20%20%20height:%202.2em;%20%20%20%20%20%20%20%20%20box-sizing:%20border-box;%20%20%20%20%20%20%20%20%20padding:%200%202.5em%200%201em;%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20%20%20%20%20%20%20%20%20%20right:%202px;%20%20%20%20%20%20%20%20%20top:%202px;%20%20%20%20%20%20%20%20%20bottom:%202px;%20%20%20%20%20%20%20%20%20width:%202.4em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20button%20%20%20%20%20%20%20%20%20%20width:%20100%;%20%20%20%20%20%20%20%20%20height:%20100%;%20%20%20%20%20%20%20%20%20border-radius:%200.2em;%20%20%20%20%20%20%20%20%20color:%20black;%20%20%20%20%20%20%20%20%20background:%20transparent;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.search-input-overlay.search%20.icon%20%20%20%20%20%20%20%20%20%20margin-top:%200.05em;%20%20%20%20%20%20%20%20%20vertical-align:%20top;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.section-name%20%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin:%201.8em%200%201em%201.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20%20%20%20%20%20%20%20%20%20position:%20relative;%20%20%20%20%20%20%20%20%20padding:%200.8em%203.5em%200.8em%201.4em;%20%20%20%20%20%20%20%20%20border-bottom:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20cursor:%20pointer;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:first-of-type%20%20%20%20%20%20%20%20%20%20border-top:%201px%20solid%20rgba(0,%200,%200,%200.12);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result:last-of-type%20%20%20%20%20%20%20%20%20%20border-bottom:%20none;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result.selected%20%20%20%20%20%20%20%20%20%20outline:%202px%20solid%20#4285f4;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20button.select-location%20%20%20%20%20%20%20%20%20%20margin-bottom:%200.6em;%20%20%20%20%20%20%20%20%20text-align:%20left;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20h2.name%20%20%20%20%20%20%20%20%20%20font-size:%201em;%20%20%20%20%20%20%20%20%20font-weight:%20500;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.address%20%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20margin-bottom:%200.5em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20right:%201.2em;%20%20%20%20%20%20%20%20%20top:%202.3em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background:hover%20%20%20%20%20%20%20%20%20%20fill:%20rgba(116,120,127,0.1);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.directions-button-background%20%20%20%20%20%20%20%20%20%20fill:%20rgba(255,255,255,0.01);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#locations-panel-list%20.location-result%20.distance%20%20%20%20%20%20%20%20%20%20position:%20absolute;%20%20%20%20%20%20%20%20%20top:%200.9em;%20%20%20%20%20%20%20%20%20right:%200;%20%20%20%20%20%20%20%20%20text-align:%20center;%20%20%20%20%20%20%20%20%20font-size:%200.9em;%20%20%20%20%20%20%20%20%20width:%205em;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20#location-results-list%20%20%20%20%20%20%20%20%20%20list-style-type:%20none;%20%20%20%20%20%20%20%20%20margin:%200;%20%20%20%20%20%20%20%20%20padding:%200;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/style&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20&#039;use%20strict&#039;;%20%20%20%20%20%20%20%20\/**%20Helper%20function%20to%20generate%20a%20Google%20Maps%20directions%20URL%20*\/%20%20%20%20%20%20%20function%20generateDirectionsURL(origin,%20destination)%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrlBase%20=%20&#039;https:\/\/www.google.com\/maps\/dir\/?&#039;;%20%20%20%20%20%20%20%20%20const%20searchParams%20=%20new%20URLSearchParams(&#039;api=1&#039;);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;origin&#039;,%20origin);%20%20%20%20%20%20%20%20%20const%20destinationParam%20=%20[];%20%20%20%20%20%20%20%20%20\/\/%20Add%20title%20to%20destinationParam%20except%20in%20cases%20where%20Quick%20Builder%20set%20%20%20%20%20%20%20%20%20\/\/%20the%20title%20to%20the%20first%20line%20of%20the%20address%20%20%20%20%20%20%20%20%20if%20(destination.title%20!==%20destination.address1)%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.title);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20destinationParam.push(destination.address1,%20destination.address2);%20%20%20%20%20%20%20%20%20searchParams.append(&#039;destination&#039;,%20destinationParam.join(&#039;,&#039;));%20%20%20%20%20%20%20%20%20return%20googleMapsUrlBase%20+%20searchParams.toString();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20%20%20%20%20%20%20%20*%20Defines%20an%20instance%20of%20the%20Locator+%20solution,%20to%20be%20instantiated%20%20%20%20%20%20%20%20*%20when%20the%20Maps%20library%20is%20loaded.%20%20%20%20%20%20%20%20*\/%20%20%20%20%20%20%20function%20LocatorPlus(configuration)%20%20%20%20%20%20%20%20%20%20const%20locator%20=%20this;%20%20%20%20%20%20%20%20%20%20locator.locations%20=%20configuration.locations%20||%20[];%20%20%20%20%20%20%20%20%20locator.capabilities%20=%20configuration.capabilities%20||%20;%20%20%20%20%20%20%20%20%20%20const%20mapEl%20=%20document.getElementById(&#039;gmp-map&#039;);%20%20%20%20%20%20%20%20%20const%20panelEl%20=%20document.getElementById(&#039;locations-panel&#039;);%20%20%20%20%20%20%20%20%20locator.panelListEl%20=%20document.getElementById(&#039;locations-panel-list&#039;);%20%20%20%20%20%20%20%20%20const%20sectionNameEl%20=%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;location-results-section-name&#039;);%20%20%20%20%20%20%20%20%20const%20resultsContainerEl%20=%20document.getElementById(&#039;location-results-list&#039;);%20%20%20%20%20%20%20%20%20%20const%20itemsTemplate%20=%20Handlebars.compile(%20%20%20%20%20%20%20%20%20%20%20%20%20document.getElementById(&#039;locator-result-items-tmpl&#039;).innerHTML);%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20null;%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20null;%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20null;%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20the%20map%20-------------------------------------------------------%20%20%20%20%20%20%20%20%20locator.map%20=%20new%20google.maps.Map(mapEl,%20configuration.mapOptions);%20%20%20%20%20%20%20%20%20%20\/\/%20Store%20selection.%20%20%20%20%20%20%20%20%20const%20selectResultItem%20=%20function(locationIdx,%20panToMarker,%20scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20locator.selectedLocationIdx%20=%20locationIdx;%20%20%20%20%20%20%20%20%20%20%20for%20(let%20locationElem%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.remove(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(getResultIndex(locationElem)%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locationElem.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(scrollToResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20panelEl.scrollTop%20=%20locationElem.offsetTop;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(panToMarker%20&#038;&#038;%20(locationIdx%20!=%20null))%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.panTo(locator.locations[locationIdx].coords);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Create%20a%20marker%20for%20each%20location.%20%20%20%20%20%20%20%20%20const%20markers%20=%20locator.locations.map(function(location,%20index)%20%20%20%20%20%20%20%20%20%20%20%20const%20marker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location.coords,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20location.title,%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20marker.addListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(index,%20false,%20true);%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20return%20marker;%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Fit%20map%20to%20marker%20bounds.%20%20%20%20%20%20%20%20%20locator.updateBounds%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20bounds%20=%20new%20google.maps.LatLngBounds();%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(locator.searchLocationMarker.getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20markers.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20bounds.extend(markers[i].getPosition());%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.map.fitBounds(bounds);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20if%20(locator.locations.length)%20%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Get%20the%20distance%20of%20a%20store%20location%20to%20the%20user&#039;s%20location,%20%20%20%20%20%20%20%20%20\/\/%20used%20in%20sorting%20the%20list.%20%20%20%20%20%20%20%20%20const%20getLocationDistance%20=%20function(location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return%20null;%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Use%20travel%20distance%20if%20available%20(from%20Distance%20Matrix).%20%20%20%20%20%20%20%20%20%20%20if%20(location.travelDistanceValue%20!=%20null)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20location.travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Fall%20back%20to%20straight-line%20distance.%20%20%20%20%20%20%20%20%20%20%20return%20google.maps.geometry.spherical.computeDistanceBetween(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20new%20google.maps.LatLng(location.coords),%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Render%20the%20results%20list%20--------------------------------------------------%20%20%20%20%20%20%20%20%20const%20getResultIndex%20=%20function(elem)%20%20%20%20%20%20%20%20%20%20%20%20return%20parseInt(elem.getAttribute(&#039;data-location-index&#039;));%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20locator.renderResultsList%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20let%20locations%20=%20locator.locations.slice();%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20locations.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locations[i].index%20=%20i;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocation)%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;Nearest%20locations%20(&#039;%20+%20locations.length%20+%20&#039;)&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20locations.sort(function(a,%20b)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20getLocationDistance(a)%20-%20getLocationDistance(b);%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20else%20%20%20%20%20%20%20%20%20%20%20%20%20%20sectionNameEl.textContent%20=%20All%20locations%20($locations.length);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultItemContext%20=%20locations:%20locations;%20%20%20%20%20%20%20%20%20%20%20resultsContainerEl.innerHTML%20=%20itemsTemplate(resultItemContext);%20%20%20%20%20%20%20%20%20%20%20for%20(let%20item%20of%20resultsContainerEl.children)%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultIndex%20=%20getResultIndex(item);%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20===%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20item.classList.add(&#039;selected&#039;);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20resultSelectionHandler%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(resultIndex%20!==%20locator.selectedLocationIdx)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectResultItem(resultIndex,%20true,%20false);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20anywhere%20on%20the%20item%20selects%20this%20location.%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Additionally,%20create%20a%20button%20element%20to%20make%20this%20behavior%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20accessible%20under%20tab%20navigation.%20%20%20%20%20%20%20%20%20%20%20%20%20item.addEventListener(&#039;click&#039;,%20resultSelectionHandler);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.select-location&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.addEventListener(&#039;click&#039;,%20function(e)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20resultSelectionHandler();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20e.stopPropagation();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Clicking%20the%20directions%20button%20will%20open%20Google%20Maps%20directions%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20new%20tab%20%20%20%20%20%20%20%20%20%20%20%20%20const%20origin%20=%20(locator.searchLocation%20!=%20null)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation.location%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&#039;&#039;;%20%20%20%20%20%20%20%20%20%20%20%20%20const%20destination%20=%20locator.locations[resultIndex];%20%20%20%20%20%20%20%20%20%20%20%20%20const%20googleMapsUrl%20=%20generateDirectionsURL(origin,%20destination);%20%20%20%20%20%20%20%20%20%20%20%20%20item.querySelector(&#039;.directions-button&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.setAttribute(&#039;href&#039;,%20googleMapsUrl);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Optional%20capability%20initialization%20--------------------------------------%20%20%20%20%20%20%20%20%20initializeSearchInput(locator);%20%20%20%20%20%20%20%20%20initializeDistanceMatrix(locator);%20%20%20%20%20%20%20%20%20%20\/\/%20Initial%20render%20of%20results%20-----------------------------------------------%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20When%20the%20search%20input%20capability%20is%20enabled,%20initialize%20it.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInput(locator)%20%20%20%20%20%20%20%20%20%20const%20geocodeCache%20=%20new%20Map();%20%20%20%20%20%20%20%20%20const%20geocoder%20=%20new%20google.maps.Geocoder();%20%20%20%20%20%20%20%20%20%20const%20searchInputEl%20=%20document.getElementById(&#039;location-search-input&#039;);%20%20%20%20%20%20%20%20%20const%20searchButtonEl%20=%20document.getElementById(&#039;location-search-button&#039;);%20%20%20%20%20%20%20%20%20%20const%20updateSearchLocation%20=%20function(address,%20location)%20%20%20%20%20%20%20%20%20%20%20%20if%20(locator.searchLocationMarker)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker.setMap(null);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(!location)%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20null;%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.searchLocation%20=%20&#039;address&#039;:%20address,%20&#039;location&#039;:%20location;%20%20%20%20%20%20%20%20%20%20%20locator.searchLocationMarker%20=%20new%20google.maps.Marker(%20%20%20%20%20%20%20%20%20%20%20%20%20position:%20location,%20%20%20%20%20%20%20%20%20%20%20%20%20map:%20locator.map,%20%20%20%20%20%20%20%20%20%20%20%20%20title:%20&#039;My%20location&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20icon:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20path:%20google.maps.SymbolPath.CIRCLE,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20scale:%2012,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillColor:%20&#039;#3367D6&#039;,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fillOpacity:%200.5,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20strokeOpacity:%200,%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20locator&#039;s%20idea%20of%20the%20user&#039;s%20country,%20used%20for%20units.%20Use%20%20%20%20%20%20%20%20%20%20%20\/\/%20formatted_address%20instead%20of%20the%20more%20structured%20address_components%20%20%20%20%20%20%20%20%20%20%20\/\/%20to%20avoid%20an%20additional%20billed%20call.%20%20%20%20%20%20%20%20%20%20%20const%20addressParts%20=%20address.split(&#039;%20&#039;);%20%20%20%20%20%20%20%20%20%20%20locator.userCountry%20=%20addressParts[addressParts.length%20-%201];%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20map%20bounds%20to%20include%20the%20new%20location%20marker.%20%20%20%20%20%20%20%20%20%20%20locator.updateBounds();%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Update%20the%20result%20list%20so%20we%20can%20sort%20it%20by%20proximity.%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20locator.updateTravelTimes();%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20const%20geocodeSearch%20=%20function(query)%20%20%20%20%20%20%20%20%20%20%20%20if%20(!query)%20%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20handleResult%20=%20function(geocodeResult)%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchInputEl.value%20=%20geocodeResult.formatted_address;%20%20%20%20%20%20%20%20%20%20%20%20%20updateSearchLocation(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeResult.formatted_address,%20geocodeResult.geometry.location);%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20if%20(geocodeCache.has(query))%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(geocodeCache.get(query));%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20address:%20query,%20bounds:%20locator.map.getBounds();%20%20%20%20%20%20%20%20%20%20%20geocoder.geocode(request,%20function(results,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(results.length%20&gt;%200)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20result%20=%20results[0];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20geocodeCache.set(query,%20result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20handleResult(result);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20geocoding%20on%20the%20search%20input.%20%20%20%20%20%20%20%20%20searchButtonEl.addEventListener(&#039;click&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20geocodeSearch(searchInputEl.value.trim());%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20\/\/%20Initialize%20Autocomplete.%20%20%20%20%20%20%20%20%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20geocodeSearch,%20updateSearchLocation);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Add%20Autocomplete%20to%20the%20search%20input.%20*\/%20%20%20%20%20%20%20function%20initializeSearchInputAutocomplete(%20%20%20%20%20%20%20%20%20%20%20locator,%20searchInputEl,%20fallbackSearch,%20searchLocationUpdater)%20%20%20%20%20%20%20%20%20%20\/\/%20Set%20up%20Autocomplete%20on%20the%20search%20input.%20Bias%20results%20to%20map%20viewport.%20%20%20%20%20%20%20%20%20const%20autocomplete%20=%20new%20google.maps.places.Autocomplete(searchInputEl,%20%20%20%20%20%20%20%20%20%20%20%20types:%20[&#039;geocode&#039;],%20%20%20%20%20%20%20%20%20%20%20fields:%20[&#039;place_id&#039;,%20&#039;formatted_address&#039;,%20&#039;geometry.location&#039;]%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20autocomplete.bindTo(&#039;bounds&#039;,%20locator.map);%20%20%20%20%20%20%20%20%20autocomplete.addListener(&#039;place_changed&#039;,%20function()%20%20%20%20%20%20%20%20%20%20%20%20const%20placeResult%20=%20autocomplete.getPlace();%20%20%20%20%20%20%20%20%20%20%20if%20(!placeResult.geometry)%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Hitting%20&#039;Enter&#039;%20without%20selecting%20a%20suggestion%20will%20result%20in%20a%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20placeResult%20with%20only%20the%20text%20input%20value%20as%20the%20&#039;name&#039;%20field.%20%20%20%20%20%20%20%20%20%20%20%20%20fallbackSearch(placeResult.name);%20%20%20%20%20%20%20%20%20%20%20%20%20return;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20searchLocationUpdater(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20placeResult.formatted_address,%20placeResult.geometry.location);%20%20%20%20%20%20%20%20%20);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/**%20Initialize%20Distance%20Matrix%20for%20the%20locator.%20*\/%20%20%20%20%20%20%20function%20initializeDistanceMatrix(locator)%20%20%20%20%20%20%20%20%20%20const%20distanceMatrixService%20=%20new%20google.maps.DistanceMatrixService();%20%20%20%20%20%20%20%20%20%20\/\/%20Annotate%20travel%20times%20to%20the%20selected%20location%20using%20Distance%20Matrix.%20%20%20%20%20%20%20%20%20locator.updateTravelTimes%20=%20function()%20%20%20%20%20%20%20%20%20%20%20%20if%20(!locator.searchLocation)%20return;%20%20%20%20%20%20%20%20%20%20%20%20const%20units%20=%20(locator.userCountry%20===%20&#039;USA&#039;)%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.IMPERIAL%20:%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20google.maps.UnitSystem.METRIC;%20%20%20%20%20%20%20%20%20%20%20const%20request%20=%20%20%20%20%20%20%20%20%20%20%20%20%20%20origins:%20[locator.searchLocation.location],%20%20%20%20%20%20%20%20%20%20%20%20%20destinations:%20locator.locations.map(function(x)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20x.coords;%20%20%20%20%20%20%20%20%20%20%20%20%20),%20%20%20%20%20%20%20%20%20%20%20%20%20travelMode:%20google.maps.TravelMode.DRIVING,%20%20%20%20%20%20%20%20%20%20%20%20%20unitSystem:%20units,%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20const%20callback%20=%20function(response,%20status)%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distances%20=%20response.rows[0].elements;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20(let%20i%20=%200;%20i%20&lt;%20distances.length;%20i++)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20distResult%20=%20distances[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20let%20travelDistanceText,%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(distResult.status%20===%20&#039;OK&#039;)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceText%20=%20distResult.distance.text;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20travelDistanceValue%20=%20distResult.distance.value;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20const%20location%20=%20locator.locations[i];%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceText%20=%20travelDistanceText;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20location.travelDistanceValue%20=%20travelDistanceValue;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20\/\/%20Re-render%20the%20results%20list,%20in%20case%20the%20ordering%20has%20changed.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20locator.renderResultsList();%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20distanceMatrixService.getDistanceMatrix(request,%20callback);%20%20%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script&gt;%20%20%20%20%20%20%20const%20CONFIGURATION%20=%20%20%20%20%20%20%20%20%20%20&quot;locations&quot;:%20[%20%20%20%20%20%20%20%20%20%20%20&quot;title&quot;:&quot;Av.%20J\u00falia%20Kubitschek,%2016&quot;,&quot;address1&quot;:&quot;Av.%20J\u00falia%20Kubitschek&quot;,&quot;address2&quot;:&quot;16%20-%20Centro,%20Cabo%20Frio%20-%20RJ,%2028905-000,%20Brasil&quot;,&quot;coords&quot;:&quot;lat&quot;:-22.881008453731294,&quot;lng&quot;:-42.02655682023774,&quot;placeId&quot;:&quot;ChIJI1MfGM0ElwARoCvZM3AAu6w&quot;%20%20%20%20%20%20%20%20%20],%20%20%20%20%20%20%20%20%20&quot;mapOptions&quot;:%20&quot;center&quot;:&quot;lat&quot;:38.0,&quot;lng&quot;:-100.0,&quot;fullscreenControl&quot;:true,&quot;mapTypeControl&quot;:false,&quot;streetViewControl&quot;:false,&quot;zoom&quot;:4,&quot;zoomControl&quot;:true,&quot;maxZoom&quot;:17,&quot;mapId&quot;:&quot;&quot;,%20%20%20%20%20%20%20%20%20&quot;mapsApiKey&quot;:%20&quot;YOUR_API_KEY_HERE&quot;,%20%20%20%20%20%20%20%20%20&quot;capabilities&quot;:%20&quot;input&quot;:true,&quot;autocomplete&quot;:true,&quot;directions&quot;:false,&quot;distanceMatrix&quot;:true,&quot;details&quot;:false,&quot;actions&quot;:false%20%20%20%20%20%20%20;%20%20%20%20%20%20%20%20function%20initMap()%20%20%20%20%20%20%20%20%20%20new%20LocatorPlus(CONFIGURATION);%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/script&gt;%20%20%20%20%20&lt;script%20id=&quot;locator-result-items-tmpl&quot;%20type=&quot;text\/x-handlebars-template&quot;&gt;%20%20%20%20%20%20%20#each%20locations%20%20%20%20%20%20%20%20%20&lt;li%20class=&quot;location-result&quot;%20data-location-index=&quot;index&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;button%20class=&quot;select-location&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h2%20class=&quot;name&quot;&gt;title&lt;\/h2&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;address&quot;&gt;address1&lt;br&gt;address2&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20#if%20travelDistanceText%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;distance&quot;&gt;travelDistanceText&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20\/if%20%20%20%20%20%20%20%20%20%20%20&lt;a%20class=&quot;directions-button&quot;%20href=&quot;&quot;%20target=&quot;_blank&quot;%20title=&quot;Get%20directions%20to%20this%20location%20on%20Google%20Maps&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;svg%20width=&quot;34&quot;%20height=&quot;34&quot;%20viewBox=&quot;0%200%2034%2034&quot;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fill=&quot;none&quot;%20xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20d=&quot;M17.5867%209.24375L17.9403%208.8902V8.8902L17.5867%209.24375ZM16.4117%209.24375L16.7653%209.59731L16.7675%209.59502L16.4117%209.24375ZM8.91172%2016.7437L8.55817%2016.3902L8.91172%2016.7437ZM8.91172%2017.9229L8.55817%2018.2765L8.55826%2018.2766L8.91172%2017.9229ZM16.4117%2025.4187H16.9117V25.2116L16.7652%2025.0651L16.4117%2025.4187ZM16.4117%2025.4229H15.9117V25.63L16.0582%2025.7765L16.4117%2025.4229ZM25.0909%2017.9229L25.4444%2018.2765L25.4467%2018.2742L25.0909%2017.9229ZM25.4403%2016.3902L17.9403%208.8902L17.2332%209.5973L24.7332%2017.0973L25.4403%2016.3902ZM17.9403%208.8902C17.4213%208.3712%2016.5737%208.3679%2016.0559%208.89248L16.7675%209.59502C16.8914%209.4696%2017.1022%209.4663%2017.2332%209.5973L17.9403%208.8902ZM16.0582%208.8902L8.55817%2016.3902L9.26527%2017.0973L16.7653%209.5973L16.0582%208.8902ZM8.55817%2016.3902C8.0379%2016.9105%208.0379%2017.7562%208.55817%2018.2765L9.26527%2017.5694C9.13553%2017.4396%209.13553%2017.227%209.26527%2017.0973L8.55817%2016.3902ZM8.55826%2018.2766L16.0583%2025.7724L16.7652%2025.0651L9.26517%2017.5693L8.55826%2018.2766ZM15.9117%2025.4187V25.4229H16.9117V25.4187H15.9117ZM16.0582%2025.7765C16.5784%2026.2967%2017.4242%2026.2967%2017.9444%2025.7765L17.2373%2025.0694C17.1076%2025.1991%2016.895%2025.1991%2016.7653%2025.0694L16.0582%2025.7765ZM17.9444%2025.7765L25.4444%2018.2765L24.7373%2017.5694L17.2373%2025.0694L17.9444%2025.7765ZM25.4467%2018.2742C25.9631%2017.7512%2025.9663%2016.9096%2025.438%2016.3879L24.7354%2017.0995C24.8655%2017.2279%2024.8687%2017.4363%2024.7351%2017.5716L25.4467%2018.2742Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;path%20fill-rule=&quot;evenodd&quot;%20clip-rule=&quot;evenodd&quot;%20d=&quot;M19%2019.8333V17.75H15.6667V20.25H14V16.9167C14%2016.4542%2014.3708%2016.0833%2014.8333%2016.0833H19V14L21.9167%2016.9167L19%2019.8333Z&quot;%20fill=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;circle%20class=&quot;directions-button-background&quot;%20cx=&quot;17&quot;%20cy=&quot;17&quot;%20r=&quot;16.5&quot;%20stroke=&quot;#1967d2&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/svg&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/a&gt;%20%20%20%20%20%20%20%20%20&lt;\/li&gt;%20%20%20%20%20%20%20\/each%20%20%20%20%20&lt;\/script&gt;%20%20%20&lt;\/head&gt;%20%20%20&lt;body&gt;%20%20%20%20%20&lt;div%20id=&quot;map-container&quot;&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel&quot;&gt;%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;locations-panel-list&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;header&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;h1%20class=&quot;search-title&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/place\/v15\/24px.svg&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Find%20a%20location%20near%20you%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/h1&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;search-input&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;input%20id=&quot;location-search-input&quot;%20placeholder=&quot;Enter%20your%20address%20or%20zip%20code&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;div%20id=&quot;search-overlay-search&quot;%20class=&quot;search-input-overlay%20search&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;button%20id=&quot;location-search-button&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;img%20class=&quot;icon&quot;%20src=&quot;https:\/\/fonts.gstatic.com\/s\/i\/googlematerialicons\/search\/v11\/24px.svg&quot;%20alt=&quot;Search&quot;\/&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/button&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/header&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;section-name&quot;%20id=&quot;location-results-section-name&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20All%20locations%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;div%20class=&quot;results&quot;&gt;%20%20%20%20%20%20%20%20%20%20%20%20%20&lt;ul%20id=&quot;location-results-list&quot;&gt;&lt;\/ul&gt;%20%20%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20%20%20&lt;div%20id=&quot;gmp-map&quot;&gt;&lt;\/div&gt;%20%20%20%20%20&lt;\/div&gt;%20%20%20%20%20&lt;script%20src=&quot;https:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY_HERE&#038;callback=initMap&#038;libraries=places,geometry&#038;solution_channel=GMP_QB_locatorplus_v6_cABD&quot;%20async%20defer&gt;&lt;\/script&gt;%20%20%20&lt;\/body&gt;%20&lt;\/html&gt;&#038;q=London%20Eye%2C%20Londres%2C%20Reino%20Unido&#038;zoom=10\"\n\t\t\t\t\ttitle=\"London Eye, Londres, Reino Unido\"\n\t\t\t\t\taria-label=\"London Eye, Londres, Reino Unido\"\n\t\t\t><\/iframe>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>CAMPO GRANDEEstrada do Mendanha, 789, sala 308WHATSAPP:\u00a0 (21) 99483-3877Atendimento: segundas-feiras (16h \u00e0s 19h)\u00a0 BARRA DA TIJUCA\u00a0Avenida das Am\u00e9ricas, 3.255, sala 328, Shopping Barra Square, Barra da TijucaTEL: (21) 3284-5187 \/ WHATAPP: (21) 99483-3877Atendimento: ter\u00e7as-feiras (13h \u00e0s 17h) CABO FRIO.\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-24","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P8zks0-o","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/pages\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":20,"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/pages\/24\/revisions"}],"predecessor-version":[{"id":514,"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/pages\/24\/revisions\/514"}],"wp:attachment":[{"href":"https:\/\/drdouglascaetano.med.br\/novo\/wp-json\/wp\/v2\/media?parent=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}