0byt3m1n1
Path:
/
var
/
lib
/
vz
/
www
/
clients
/
client6
/
web11
/
web
/
wp-content
/
plugins
/
wp-google-maps
/
js
/
[
Home
]
File: wpgmaps.min.js
function InitMap(){var a=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);"undefined"!=typeof wpgmza_override_zoom?MYMAP.init("#wpgmza_map",a,parseInt(wpgmza_override_zoom)):MYMAP.init("#wpgmza_map",a,parseInt(wpgmaps_localize[0].map_start_zoom)),UniqueCode=Math.round(1e4*Math.random()),MYMAP.placeMarkers(wpgmaps_markerurl+"?u="+UniqueCode,wpgmaps_localize[0].id,null,null,null)}function add_polygon(a){var b=wpgmaps_localize_polygon_settings[a],d=b.polydata,e=new Array;for(tmp_entry2 in d)"undefined"!=typeof d[tmp_entry2][0]&&e.push(new google.maps.LatLng(d[tmp_entry2][0],d[tmp_entry2][1]));null!==b.lineopacity&&""!==b.lineopacity||(b.lineopacity=1);var f=new google.maps.LatLngBounds;for(i=0;i<e.length;i++)f.extend(e[i]);WPGM_Path_Polygon[a]=new google.maps.Polygon({path:e,clickable:!0,strokeColor:"#"+b.linecolor,fillOpacity:b.opacity,strokeOpacity:b.lineopacity,fillColor:"#"+b.fillcolor,strokeWeight:2,map:MYMAP.map}),WPGM_Path_Polygon[a].setMap(MYMAP.map),polygon_center=f.getCenter(),""!==b.title&&(infoWindow_poly[a]=new google.maps.InfoWindow,google.maps.event.addListener(WPGM_Path_Polygon[a],"click",function(c){if(infoWindow_poly[a].setPosition(c.latLng),d="",""!==b.link)var d="<a href='"+b.link+"'>"+b.title+"</a>";else var d=b.title;infoWindow_poly[a].setContent(d),infoWindow_poly[a].open(MYMAP.map,this.position)}))}function add_polyline(a){var b=wpgmaps_localize_polyline_settings[a],d=b.polydata,e=new Array;for(tmp_entry2 in d)if("undefined"!=typeof d[tmp_entry2][0]&&"undefined"!=typeof d[tmp_entry2][1]){var f=d[tmp_entry2][0].replace(")","");f=f.replace("(","");var g=d[tmp_entry2][1].replace(")","");g=g.replace("(",""),e.push(new google.maps.LatLng(f,g))}null!==b.lineopacity&&""!==b.lineopacity||(b.lineopacity=1),WPGM_Path[a]=new google.maps.Polyline({path:e,strokeColor:"#"+b.linecolor,strokeOpacity:b.opacity,strokeWeight:b.linethickness,map:MYMAP.map}),WPGM_Path[a].setMap(MYMAP.map)}function fillInAddress(){autocomplete.getPlace()}function searchLocations(a){var b=document.getElementById("addressInput").value,c=new google.maps.Geocoder;"undefined"==typeof wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict||""===wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict?c.geocode({address:b},function(c,d){d===google.maps.GeocoderStatus.OK?searchLocationsNear(a,c[0].geometry.location):alert(b+" not found")}):c.geocode({address:b,componentRestrictions:{country:wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict}},function(c,d){d===google.maps.GeocoderStatus.OK?searchLocationsNear(a,c[0].geometry.location):alert(b+" not found")})}function clearLocations(){infoWindow.close()}function searchLocationsNear(a,b){clearLocations();var c=document.getElementById("wpgmza_distance_type").value,d=document.getElementById("radiusSelect").value;"1"===c?"1"===d?zoomie=14:"5"===d?zoomie=12:"10"===d?zoomie=11:"25"===d?zoomie=9:"50"===d?zoomie=8:"75"===d?zoomie=8:"100"===d?zoomie=7:"150"===d?zoomie=7:"200"===d?zoomie=6:"300"===d?zoomie=6:zoomie=14:"1"===d?zoomie=14:"5"===d?zoomie=12:"10"===d?zoomie=11:"25"===d?zoomie=10:"50"===d?zoomie=9:"75"===d?zoomie=8:"100"===d?zoomie=8:"150"===d?zoomie=7:"200"===d?zoomie=7:"300"===d?zoomie=6:zoomie=14,MYMAP.init("#wpgmza_map",b,zoomie,3),MYMAP.placeMarkers(wpgmaps_markerurl+"?u="+UniqueCode,wpgmaps_localize[0].id,d,b,c)}function toRad(a){return a*Math.PI/180}var WPGM_Path_Polygon=new Array,WPGM_Path=new Array,infoWindow_poly=Array();for(var entry in wpgmaps_localize)"undefined"==typeof window.jQuery&&setTimeout(function(){document.getElementById("wpgmza_map").innerHTML='Error: In order for WP Google Maps to work, jQuery must be installed. A check was done and jQuery was not present. Please see the <a href="http://www.wpgmaps.com/documentation/troubleshooting/jquery-troubleshooting/" title="WP Google Maps - jQuery Troubleshooting">jQuery troubleshooting section of our site</a> for more information.'},5e3);jQuery(function(){jQuery(document).ready(function(){/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)?setTimeout(function(){document.getElementById("wpgmza_map").innerHTML="Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem."},6e3):(jQuery("#wpgmza_map").css({height:wpgmaps_localize[0].map_height+""+wpgmaps_localize[0].map_height_type,width:wpgmaps_localize[0].map_width+""+wpgmaps_localize[0].map_width_type}),InitMap(),jQuery("body").on("tabsactivate",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("tabsshow",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("accordionactivate",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".wpb_tabs_nav li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".ui-tabs-nav li",function(a,b){InitMap()}),jQuery("body").on("click",".tp-tabs li a",function(a,b){InitMap()}),jQuery("body").on("click",".nav-tabs li a",function(a,b){InitMap()}),jQuery("body").on("click",".vc_tta-panel-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".ult_exp_section",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".x-accordion-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".x-nav-tabs li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tab-title",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tab-link",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".et_pb_tabs_controls li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".fusion-tab-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".et_pb_tab",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tri-tabs-nav span",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".gdl-tabs li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click","#tabnav li",function(){setTimeout(function(){InitMap()},500)}))})});var MYMAP={map:null,bounds:null};""===wpgmaps_localize_global_settings.wpgmza_settings_map_draggable||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_draggable?wpgmza_settings_map_draggable=!0:wpgmza_settings_map_draggable=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_clickzoom||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_clickzoom?wpgmza_settings_map_clickzoom=!1:wpgmza_settings_map_clickzoom=!0,""===wpgmaps_localize_global_settings.wpgmza_settings_map_scroll||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_scroll?wpgmza_settings_map_scroll=!0:wpgmza_settings_map_scroll=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_zoom||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_zoom?wpgmza_settings_map_zoom=!0:wpgmza_settings_map_zoom=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_pan||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_pan?wpgmza_settings_map_pan=!0:wpgmza_settings_map_pan=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_type||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_type?wpgmza_settings_map_type=!0:wpgmza_settings_map_type=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_streetview||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_streetview?wpgmza_settings_map_streetview=!0:wpgmza_settings_map_streetview=!1,"undefined"==typeof wpgmaps_localize[0].other_settings.map_max_zoom||""===wpgmaps_localize[0].other_settings.map_max_zoom?wpgmza_max_zoom=0:wpgmza_max_zoom=parseInt(wpgmaps_localize[0].other_settings.map_max_zoom),"undefined"==typeof wpgmaps_localize[0].other_settings.map_min_zoom||""===wpgmaps_localize[0].other_settings.map_min_zoom?wpgmza_min_zoom=21:wpgmza_min_zoom=parseInt(wpgmaps_localize[0].other_settings.map_min_zoom),MYMAP.init=function(a,b,c){"undefined"!=typeof wpgmaps_localize[0].type?"1"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.ROADMAP:"2"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.SATELLITE:"3"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.HYBRID:"4"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.TERRAIN:maptype=google.maps.MapTypeId.ROADMAP:maptype=google.maps.MapTypeId.ROADMAP;var d={zoom:c,minZoom:wpgmza_max_zoom,maxZoom:wpgmza_min_zoom,center:b,zoomControl:wpgmza_settings_map_zoom,panControl:wpgmza_settings_map_pan,mapTypeControl:wpgmza_settings_map_type,streetViewControl:wpgmza_settings_map_streetview,draggable:wpgmza_settings_map_draggable,disableDoubleClickZoom:wpgmza_settings_map_clickzoom,scrollwheel:wpgmza_settings_map_scroll,mapTypeId:maptype};if(this.map=new google.maps.Map(jQuery(a)[0],d),this.bounds=new google.maps.LatLngBounds,"undefined"!=typeof wpgmaps_localize[0].other_settings.wpgmza_theme_data&&wpgmaps_localize[0].other_settings.wpgmza_theme_data!==!1&&""!==wpgmaps_localize[0].other_settings.wpgmza_theme_data&&(wpgmza_theme_data=JSON.parse(wpgmaps_localize[0].other_settings.wpgmza_theme_data),this.map.setOptions({styles:JSON.parse(wpgmaps_localize[0].other_settings.wpgmza_theme_data)})),null!==wpgmaps_localize_polygon_settings&&"undefined"!=typeof wpgmaps_localize_polygon_settings)for(var e in wpgmaps_localize_polygon_settings)add_polygon(e);if(null!==wpgmaps_localize_polyline_settings&&"undefined"!=typeof wpgmaps_localize_polyline_settings)for(var e in wpgmaps_localize_polyline_settings)add_polyline(e);if("1"===wpgmaps_localize[0].bicycle){var f=new google.maps.BicyclingLayer;f.setMap(MYMAP.map)}if("1"===wpgmaps_localize[0].traffic){var g=new google.maps.TrafficLayer;g.setMap(MYMAP.map)}if("undefined"!=typeof wpgmaps_localize[0].other_settings.transport_layer&&1===wpgmaps_localize[0].other_settings.transport_layer){var h=new google.maps.TransitLayer;h.setMap(MYMAP.map)}google.maps.event.addListener(MYMAP.map,"click",function(){infoWindow.close()})};var infoWindow=new google.maps.InfoWindow;"undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width&&""!==wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width&&infoWindow.setOptions({maxWidth:wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width}),google.maps.event.addDomListener(window,"resize",function(){var a=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);MYMAP.map.setCenter(a)}),MYMAP.placeMarkers=function(a,b,c,d,e){var f=0,g=jQuery(".js-not-found-msg");if("1"===wpgmaps_localize_global_settings.wpgmza_settings_marker_pull)jQuery.get(a,function(a){jQuery(a).find("marker").each(function(){var a=jQuery(this).find("map_id").text();if(a==b){var g=jQuery(this).find("address").text(),h=jQuery(this).find("lat").text(),i=jQuery(this).find("lng").text(),j=jQuery(this).find("anim").text(),k=jQuery(this).find("infoopen").text(),l=jQuery(this).find("lat").text(),m=jQuery(this).find("lng").text(),n=!0;if(null!==c){if(f>0);else{var o=new google.maps.LatLng(parseFloat(d.lat()),parseFloat(d.lng()));if(MYMAP.bounds.extend(o),"undefined"==typeof wpgmaps_localize[0].other_settings.store_locator_bounce||1===wpgmaps_localize[0].other_settings.store_locator_bounce)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});if("1"===e)var q={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/621371e-9)};else var q={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/.001)};cityCircle=new google.maps.Circle(q),f+=1}var r=0;r="1"===e?3958.7558657440545:6378.16;var s=toRad(d.lat()-l),t=toRad(d.lng()-m),u=Math.sin(s/2)*Math.sin(s/2)+Math.cos(toRad(l))*Math.cos(toRad(d.lat()))*Math.sin(t/2)*Math.sin(t/2),v=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),w=r*v;n=w<c}var o=new google.maps.LatLng(parseFloat(h),parseFloat(i));if(MYMAP.bounds.extend(o),n===!0){if("1"===j)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});else if("2"===j)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.DROP});else var p=new google.maps.Marker({position:o,map:MYMAP.map});var x="";x=null!==c?"1"===e?"<p style='min-width:100px; display:block;'>"+Math.round(w,2)+" "+wpgmaps_lang_m_away+"</p>":"<p style='min-width:100px; display:block;'>"+Math.round(w,2)+" "+wpgmaps_lang_km_away+"</p>":"";var y="<span style='min-width:100px; display:block;'>"+g+"</span>"+x;"1"===k&&(infoWindow.setContent(y),infoWindow.open(MYMAP.map,p)),temp_actiontype="click","undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&"2"==wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&(temp_actiontype="mouseover"),google.maps.event.addListener(p,temp_actiontype,function(){infoWindow.close(),infoWindow.setContent(y),infoWindow.open(MYMAP.map,p)})}}})});else if(wpgmaps_localize_marker_data.length>0){var h=0;jQuery.each(wpgmaps_localize_marker_data,function(a,g){var i=g.map_id;if(i==b){var j=g.address,k=g.anim,l=g.infoopen,m=g.lat,n=g.lng,o=new google.maps.LatLng(parseFloat(m),parseFloat(n)),p=g.lat,q=g.lng,r=!0;if(null!==c){if(f>0);else{var o=new google.maps.LatLng(parseFloat(d.lat()),parseFloat(d.lng()));if(MYMAP.bounds.extend(o),"undefined"==typeof wpgmaps_localize[0].other_settings.store_locator_bounce||1===wpgmaps_localize[0].other_settings.store_locator_bounce)var s=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});if("1"===e)var t={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/621371e-9)};else var t={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/.001)};cityCircle=new google.maps.Circle(t),f+=1}var u=0;u="1"===e?3958.7558657440545:6378.16;var v=toRad(d.lat()-p),w=toRad(d.lng()-q),x=Math.sin(v/2)*Math.sin(v/2)+Math.cos(toRad(p))*Math.cos(toRad(d.lat()))*Math.sin(w/2)*Math.sin(w/2),y=2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x)),z=u*y;z<c?(r=!0,h++):r=!1}var o=new google.maps.LatLng(parseFloat(m),parseFloat(n));if(MYMAP.bounds.extend(o),r===!0){if("1"===k)var s=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});else if("2"===k)var s=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.DROP});else var s=new google.maps.Marker({position:o,map:MYMAP.map});var A="";A=null!==c?"1"===e?"<p style='min-width:100px; display:block;'>"+Math.round(z,2)+" "+wpgmaps_lang_m_away+"</p>":"<p style='min-width:100px; display:block;'>"+Math.round(z,2)+" "+wpgmaps_lang_km_away+"</p>":"";var B="<span style='min-width:100px; display:block;'>"+j+"</span>"+A;"1"===l&&(infoWindow.setContent(B),infoWindow.open(MYMAP.map,s)),temp_actiontype="click","undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&"2"==wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&(temp_actiontype="mouseover"),google.maps.event.addListener(s,temp_actiontype,function(){infoWindow.close(),infoWindow.setContent(B),infoWindow.open(MYMAP.map,s)})}}}),""!==jQuery("#addressInput").val()&&h<1&&(g.addClass("is-active"),setTimeout(function(){g.removeClass("is-active")},5e3))}},jQuery("body").on("keypress","#addressInput",function(a){13==a.which&&jQuery(".wpgmza_sl_search_button").trigger("click")});var autocomplete,elementExists=document.getElementById("addressInput");"object"==typeof google&&"object"==typeof google.maps&&"object"==typeof google.maps.places&&"function"==typeof google.maps.places.Autocomplete&&null!==elementExists&&("undefined"==typeof wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict||""===wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict?(autocomplete=new google.maps.places.Autocomplete(document.getElementById("addressInput"),{types:["geocode"]}),google.maps.event.addListener(autocomplete,"place_changed",function(){fillInAddress()})):(autocomplete=new google.maps.places.Autocomplete(document.getElementById("addressInput"),{types:["geocode"],componentRestrictions:{country:wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict}}),google.maps.event.addListener(autocomplete,"place_changed",function(){fillInAddress()})));