XA.connector.mapsConnector=function(n,t){"use strict";var r={},e=[],i=[],u,o,s,f=[],h,c=[],a,l=!1;return o=function(n){switch(n.mode){case"Roadmap":return google.maps.MapTypeId.ROADMAP;case"Satellite":return google.maps.MapTypeId.SATELLITE;case"Hybrid":return google.maps.MapTypeId.HYBRID;default:return google.maps.MapTypeId.ROADMAP}},s=function(n,t){var i;return i=t.icon===null?new google.maps.Marker({position:new google.maps.LatLng(t.latitude,t.longitude),map:e[n],title:t.title}):new google.maps.Marker({position:new google.maps.LatLng(t.latitude,t.longitude),map:e[n],title:t.title,icon:t.icon}),t.latitude===""&&t.longitude===""&&i.setVisible(!1),i},h=function(n,t,r){t.id=r.id;i[n]?i[n].push({marker:t,type:r.type}):(i[n]=[],i[n].push({marker:t,type:r.type}))},r.loadScript=function(n,i){if(c.push(i),!l){l=!0;var r=t.createElement("script"),u="https://maps.googleapis.com/maps/api/js?v=3.exp";r.type="text/javascript";u+=typeof n!="undefined"&&n!==""?"&key="+n+"&v=3.exp&signed_in=false":"&signed_in=false";u+="&libraries=places&callback=XA.connector.mapsConnector.scriptsLoaded";r.src=u;r.onload=function(){console.log("Google loader has been loaded, waiting for maps api")};t.body.appendChild(r)}},r.scriptsLoaded=function(){for(var t=c.length,n=0;n0&&i[n].length<2&&(u.setZoom(r.zoom),google.maps.event.removeListener(h))})));a=google.maps.event.addListener(u,"zoom_changed",function(){var n=u.getZoom();n<1&&u.setZoom(1)});e[n]=u},r.renderPoi=function(n,t){var r=s(n,t),i=n+"#"+t.id;h(n,r,t);t.html!==""&&t.html!==null&&(f[i]=new google.maps.InfoWindow({content:t.html}));typeof f[i]!="undefined"&&function(t,i){google.maps.event.addListener(i,"click",function(){for(var r in f)f.hasOwnProperty(r)&&f[r].close();f[t].open(e[n],i)})}(i,r)},r.renderDynamicPoi=function(n,t,i){var r=s(n,t);h(n,r,t);google.maps.event.addListener(r,"click",function(){if(typeof i=="function"){var o=t.id,s=t.poiTypeId,u=t.poiVariantId;if(u==null)return;i(o,s,u,function(t){f[n]&&f[n].close();f[n]=new google.maps.InfoWindow({content:t.Html});f[n].open(e[n],r)})}})},r.clearMarkers=function(n){var t,r;if(i.hasOwnProperty(n)){for(t=i[n],r=0;r=r?r:n.length,u=0;u0&&(u[0].marker.setPosition(new google.maps.LatLng(t[0],t[1])),u[0].marker.setVisible(!0),this.updateMapPosition(n),typeof r!="undefined"&&o.setZoom(r)))},r}(jQuery,document)