{"version":3,"sources":["projects-map.js"],"names":["$","new_map","$el","$markers","find","args","zoom","center","google","maps","LatLng","mapTypeId","MapTypeId","ROADMAP","disableDefaultUI","map","Map","infowindow","InfoWindow","maxWidth","markers","each","add_marker","this","center_map","$marker","latlng","attr","icon","path","fillColor","fillOpacity","anchor","Point","strokeWeight","scale","icon2","marker","Marker","position","animation","Animation","DROP","addListener","getAnimation","setAnimation","BOUNCE","setIcon","push","html","event","setContent","open","close","bounds","LatLngBounds","i","lat","lng","extend","length","setCenter","getCenter","setZoom","jQuery","document","ready","fadeOut"],"mappings":"CAOA,SAAAA,GAaA,QAAAC,GAAAC,GAGA,GAAAC,GAAAD,EAAAE,KAAA,WAIAC,GACAC,KAAA,GACAC,OAAA,GAAAC,QAAAC,KAAAC,OAAA,EAAA,GACAC,UAAAH,OAAAC,KAAAG,UAAAC,QACAC,kBAAA,GAKAC,EAAA,GAAAP,QAAAC,KAAAO,IAAAd,EAAA,GAAAG,GAGAY,EAAA,GAAAT,QAAAC,KAAAS,YACAC,SAAA,KAqBA,OAhBAJ,GAAAK,WAIAjB,EAAAkB,KAAA,WAEAC,EAAAtB,EAAAuB,MAAAR,EAAAE,KAMAO,EAAAT,GAIAA,EAgBA,QAAAO,GAAAG,EAAAV,EAAAE,GAGA,GAAAS,GAAA,GAAAlB,QAAAC,KAAAC,OAAAe,EAAAE,KAAA,YAAAF,EAAAE,KAAA,aAGAC,GACAC,KAAA,uPACAC,UAAA,UACAC,YAAA,EACAC,OAAA,GAAAxB,QAAAC,KAAAwB,MAAA,IAAA,KACAC,aAAA,EACAC,MAAA,KAIAC,GACAP,KAAA,uPACAC,UAAA,UACAC,YAAA,EACAC,OAAA,GAAAxB,QAAAC,KAAAwB,MAAA,IAAA,KACAC,aAAA,EACAC,MAAA,KAIAE,EAAA,GAAA7B,QAAAC,KAAA6B,QACAC,SAAAb,EACAX,IAAAA,EACAyB,UAAAhC,OAAAC,KAAAgC,UAAAC,KACAd,KAAAA,GAGAS,GAAAM,YAAA,YAAA,WACA,MAAAN,EAAAO,gBACAP,EAAAQ,aAAArC,OAAAC,KAAAgC,UAAAK,QACAT,EAAAU,QAAAX,KAEAC,EAAAQ,aAAA,MACAR,EAAAU,QAAAnB,MAGAS,EAAAM,YAAA,WAAA,WACA,OAAAN,EAAAO,gBACAP,EAAAQ,aAAA,MACAR,EAAAU,QAAAnB,IAEAS,EAAAU,QAAAX,KAKArB,EAAAK,QAAA4B,KAAAX,GAGAZ,EAAAwB,SAIAzC,OAAAC,KAAAyC,MAAAP,YAAAN,EAAA,QAAA,WAEApB,EAAAkC,WAAA1B,EAAAwB,QACAhC,EAAAmC,KAAArC,EAAAsB,KAKA7B,OAAAC,KAAAyC,MAAAP,YAAA5B,EAAA,QAAA,SAAAmC,GAEAjC,EAAAoC,WAmBA,QAAA7B,GAAAT,GAGA,GAAAuC,GAAA,GAAA9C,QAAAC,KAAA8C,YAGAvD,GAAAqB,KAAAN,EAAAK,QAAA,SAAAoC,EAAAnB,GAEA,GAAAX,GAAA,GAAAlB,QAAAC,KAAAC,OAAA2B,EAAAE,SAAAkB,MAAApB,EAAAE,SAAAmB,MAEAJ,GAAAK,OAAAjC,KAKA,GAAAX,EAAAK,QAAAwC,QAEA7C,EAAA8C,UAAAP,EAAAQ,aACA/C,EAAAgD,QAAA,MAGAhD,EAAA8C,WAAAJ,IAAA,GAAAC,KAAA,MAEA3C,EAAAgD,QAAA,MAkBA,GAAAhD,GAAA,IAEAiD,QAAAC,UAAAC,MAAA,SAAAlE,GAEAA,EAAA,iBAAAqB,KAAA,WAGAN,EAAAd,EAAAD,EAAAuB,OAGAR,EAAA4B,YAAA,cAAA,WACA3C,EAAA,oCAAAmE,iBAQAH","file":"foot.min.js","sourcesContent":["/**\n * Filtering form helper\n *\n * @since 1.0.0\n * @package uma\n */\n\n(function($) {\n\n\t/*\n\t * new_map\n\t *\n\t * This function will render a Google Map onto the selected jQuery element\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param $el (jQuery element)\n\t * @return n/a\n\t */\n\n\tfunction new_map($el) {\n\n\t\t// var\n\t\tvar $markers = $el.find('.marker');\n\n\n\t\t// vars\n\t\tvar args = {\n\t\t\tzoom: 16,\n\t\t\tcenter: new google.maps.LatLng(0, 0),\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t\tdisableDefaultUI: true\n\t\t};\n\n\n\t\t// create map\n\t\tvar map = new google.maps.Map($el[0], args);\n\n\t\t// create info window\n\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\tmaxWidth: 300\n\t\t});\n\n\n\t\t// add a markers reference\n\t\tmap.markers = [];\n\n\n\t\t// add markers\n\t\t$markers.each(function() {\n\n\t\t\tadd_marker($(this), map, infowindow);\n\n\t\t});\n\n\n\t\t// center map\n\t\tcenter_map(map);\n\n\n\t\t// return\n\t\treturn map;\n\n\t}\n\n\t/*\n\t * add_marker\n\t *\n\t * This function will add a marker to the selected Google Map\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param $marker (jQuery element)\n\t * @param map (Google Map object)\n\t * @return n/a\n\t */\n\n\tfunction add_marker($marker, map, infowindow) {\n\n\t\t// var\n\t\tvar latlng = new google.maps.LatLng($marker.attr('data-lat'), $marker.attr('data-lng'));\n\n\t\t// Marker svg\n\t\tvar icon = {\n\t\t\tpath: \"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z\",\n\t\t\tfillColor: '#156de5',\n\t\t\tfillOpacity: 1,\n\t\t\tanchor: new google.maps.Point(250,540),\n\t\t strokeWeight: 0,\n\t\t scale: 0.05\n\t\t};\n\n\t\t// Marker svg\n\t\tvar icon2 = {\n\t\t\tpath: \"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z\",\n\t\t\tfillColor: '#15CB87',\n\t\t\tfillOpacity: 1,\n\t\t\tanchor: new google.maps.Point(250,540),\n\t\t strokeWeight: 0,\n\t\t scale: 0.06\n\t\t};\n\n\t\t// create marker\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: latlng,\n\t\t\tmap: map,\n\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\ticon: icon\n\t\t});\n\n\t\tmarker.addListener('mouseover', function() {\n\t\t\tif (marker.getAnimation() == null) {\n\t\t\t\tmarker.setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\tmarker.setIcon(icon2);\n\t\t\t} else {\n\t\t\t\tmarker.setAnimation(null);\n\t\t\t\tmarker.setIcon(icon);\n\t\t\t}\n\t\t});\n\t\tmarker.addListener('mouseout', function() {\n\t\t\tif (marker.getAnimation() !== null) {\n\t\t\t\tmarker.setAnimation(null);\n\t\t\t\tmarker.setIcon(icon);\n\t\t\t} else {\n\t\t\t\tmarker.setIcon(icon2);\n\t\t\t}\n\t\t});\n\n\t\t// add to array\n\t\tmap.markers.push(marker);\n\n\t\t// if marker contains HTML, add it to an infoWindow\n\t\tif ($marker.html()) {\n\t\t\t\n\n\t\t\t// show info window when marker is clicked\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function() {\n\n\t\t\t\tinfowindow.setContent($marker.html());\n\t\t\t\tinfowindow.open(map, marker);\n\n\t\t\t});\n\n\t\t\t// close any open info window when map is clicked\n\t\t\tgoogle.maps.event.addListener(map, 'click', function(event) {\n\n\t\t\t infowindow.close();\n\n\t\t\t});\n\n\t\t}\n\n\t}\n\n\t/*\n\t * center_map\n\t *\n\t * This function will center the map, showing all markers attached to this map\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param map (Google Map object)\n\t * @return n/a\n\t */\n\n\tfunction center_map(map) {\n\n\t\t// vars\n\t\tvar bounds = new google.maps.LatLngBounds();\n\n\t\t// loop through all markers and create bounds\n\t\t$.each(map.markers, function(i, marker) {\n\n\t\t\tvar latlng = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n\n\t\t\tbounds.extend(latlng);\n\n\t\t});\n\n\t\t// only 1 marker?\n\t\tif (map.markers.length == 1) {\n\t\t\t// set center of map\n\t\t\tmap.setCenter(bounds.getCenter());\n\t\t\tmap.setZoom(16);\n\t\t} else {\n\t\t\t// fit to bounds\n\t\t\tmap.setCenter({lat:42, lng:-100});\n\t\t\t// map.setCenter(bounds.getCenter());\n\t\t\tmap.setZoom(4.5); // Change the zoom value as required\n\t\t\t// map.fitBounds( bounds ); // This is the default setting which I have uncommented to stop the World Map being repeated\n\n\t\t}\n\n\t}\n\n\t/*\n\t * document ready\n\t *\n\t * This function will render each map when the document is ready (page has loaded)\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param n/a\n\t * @return n/a\n\t */\n\t// global var\n\tvar map = null;\n\n\tjQuery(document).ready(function($) {\n\n\t\t$('.projects-map').each(function() {\n\n\t\t\t// create map\n\t\t\tmap = new_map($(this));\n\n\t\t\t// fade out map loader overlay\n\t\t\tmap.addListener('tilesloaded', function () { \n\t\t\t\t$('.projects-map-container .overlay').fadeOut();\n\t\t\t});\n\n\t\t});\n\n\n\t});\n\n})(jQuery);"]}