/* gmap: (http://www.nawozydlaogrodu.pl/wp-content/themes/avada-child/assets/js/gmap-min.js) */ /** * jQuery goMap * * @url http://www.pittss.lv/jquery/gomap/ * @author Jevgenijs Shtrauss * @version 1.3.2 2011.07.01 * This software is released under the MIT License */(function(e){function n(e){this.setMap(e)}var t=new google.maps.Geocoder;n.prototype=new google.maps.OverlayView;n.prototype.onAdd=function(){};n.prototype.onRemove=function(){};n.prototype.draw=function(){};e.goMap={};e.fn.goMap=function(t){return this.each(function(){var n=e(this).data("goMap");if(!n){var r=e.extend(!0,{},e.goMapBase);e(this).data("goMap",r.init(this,t));e.goMap=r}else e.goMap=n})};e.goMapBase={defaults:{address:"",latitude:56.9,longitude:24.1,zoom:4,delay:200,hideByClick:!0,oneInfoWindow:!0,prefixId:"gomarker",polyId:"gopoly",groupId:"gogroup",navigationControl:!0,navigationControlOptions:{position:"TOP_LEFT",style:"DEFAULT"},mapTypeControl:!0,mapTypeControlOptions:{position:"TOP_RIGHT",style:"DEFAULT"},scaleControl:!1,scrollwheel:!0,directions:!1,directionsResult:null,disableDoubleClickZoom:!1,streetViewControl:!1,markers:[],overlays:[],polyline:{color:"#FF0000",opacity:1,weight:2},polygon:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},circle:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},rectangle:{color:"#FF0000",opacity:1,weight:2,fillColor:"#FF0000",fillOpacity:.2},maptype:"HYBRID",html_prepend:"
",html_append:"
",addMarker:!1},map:null,count:0,markers:[],polylines:[],polygons:[],circles:[],rectangles:[],tmpMarkers:[],geoMarkers:[],lockGeocode:!1,bounds:null,overlays:null,overlay:null,mapId:null,plId:null,pgId:null,cId:null,rId:null,opts:null,centerLatLng:null,init:function(t,r){var i=e.extend(!0,{},e.goMapBase.defaults,r);this.mapId=e(t);this.opts=i;i.address?this.geocode({address:i.address,center:!0}):e.isArray(i.markers)&&i.markers.length>0?i.markers[0].address?this.geocode({address:i.markers[0].address,center:!0}):this.centerLatLng=new google.maps.LatLng(i.markers[0].latitude,i.markers[0].longitude):this.centerLatLng=new google.maps.LatLng(i.latitude,i.longitude);var s={center:this.centerLatLng,disableDoubleClickZoom:i.disableDoubleClickZoom,mapTypeControl:i.mapTypeControl,streetViewControl:i.streetViewControl,mapTypeControlOptions:{position:google.maps.ControlPosition[i.mapTypeControlOptions.position.toUpperCase()],style:google.maps.MapTypeControlStyle[i.mapTypeControlOptions.style.toUpperCase()]},mapTypeId:google.maps.MapTypeId[i.maptype.toUpperCase()],navigationControl:i.navigationControl,navigationControlOptions:{position:google.maps.ControlPosition[i.navigationControlOptions.position.toUpperCase()],style:google.maps.NavigationControlStyle[i.navigationControlOptions.style.toUpperCase()]},scaleControl:i.scaleControl,scrollwheel:i.scrollwheel,zoom:i.zoom,zoomControl:i.navigationControl,panControl:i.navigationControl};this.map=new google.maps.Map(t,s);this.overlay=new n(this.map);this.overlays={polyline:{id:"plId",array:"polylines",create:"createPolyline"},polygon:{id:"pgId",array:"polygons",create:"createPolygon"},circle:{id:"cId",array:"circles",create:"createCircle"},rectangle:{id:"rId",array:"rectangles",create:"createRectangle"}};this.plId=e('
').appendTo(this.mapId);this.pgId=e('
').appendTo(this.mapId);this.cId=e('
').appendTo(this.mapId);this.rId=e('
').appendTo(this.mapId);for(var o=0,u=i.markers.length;o0&&!this.lockGeocode){this.lockGeocode=!0;var e=this.geoMarkers.splice(0,1);this.geocode({address:e[0].address},e[0])}else if(this.lockGeocode){var t=this;setTimeout(function(){t.geoMarker()},this.opts.delay)}},setMap:function(e){delete e.mapTypeId;if(e.address){this.geocode({address:e.address,center:!0});delete e.address}else if(e.latitude&&e.longitude){e.center=new google.maps.LatLng(e.latitude,e.longitude);delete e.longitude;delete e.latitude}e.mapTypeControlOptions&&e.mapTypeControlOptions.position&&(e.mapTypeControlOptions.position=google.maps.ControlPosition[e.mapTypeControlOptions.position.toUpperCase()]);e.mapTypeControlOptions&&e.mapTypeControlOptions.style&&(e.mapTypeControlOptions.style=google.maps.MapTypeControlStyle[e.mapTypeControlOptions.style.toUpperCase()]);e.navigationControlOptions&&e.navigationControlOptions.position&&(e.navigationControlOptions.position=google.maps.ControlPosition[e.navigationControlOptions.position.toUpperCase()]);e.navigationControlOptions&&e.navigationControlOptions.style&&(e.navigationControlOptions.style=google.maps.NavigationControlStyle[e.navigationControlOptions.style.toUpperCase()]);this.map.setOptions(e)},getMap:function(){return this.map},createListener:function(t,n,r){var i;typeof t!="object"&&(t={type:t});t.type=="map"?i=this.map:t.type=="marker"&&t.marker?i=e(this.mapId).data(t.marker):t.type=="info"&&t.marker&&(i=e(this.mapId).data(t.marker+"info"));if(i)return google.maps.event.addListener(i,n,r);if((t.type=="marker"||t.type=="info")&&this.getMarkerCount()!=this.getTmpMarkerCount())var s=this;setTimeout(function(){s.createListener(t,n,r)},this.opts.delay)},removeListener:function(e){google.maps.event.removeListener(e)},setInfoWindow:function(t,n){var r=this;n.content=r.opts.html_prepend+n.content+r.opts.html_append;var i=new google.maps.InfoWindow(n);i.show=!1;e(r.mapId).data(t.id+"info",i);if(n.popup){r.openWindow(i,t,n);i.show=!0}google.maps.event.addListener(t,"click",function(){if(i.show&&r.opts.hideByClick){i.close();i.show=!1}else{r.openWindow(i,t,n);i.show=!0}})},openWindow:function(t,n,r){this.opts.oneInfoWindow&&this.clearInfo();if(r.ajax){t.open(this.map,n);e.ajax({url:r.ajax,success:function(e){t.setContent(e)}})}else if(r.id){t.setContent(e(r.id).html());t.open(this.map,n)}else t.open(this.map,n)},setInfo:function(t,n){var r=e(this.mapId).data(t+"info");typeof n=="object"?r.setOptions(n):r.setContent(n)},getInfo:function(t,n){var r=e(this.mapId).data(t+"info").getContent();return n?e(r).html():r},clearInfo:function(){for(var t=0,n=this.markers.length;t0))return!1;for(var n=0,r=e.coords.length;n0))return!1;for(var n=0,r=e.coords.length;n0){var i=[];for(var s=0,o=r.coords.length;s-1){i=this[this.overlays[t].array].splice(r,1);var s=i[0];e(this[this.overlays[t].id]).data(s).setMap(null);e(this[this.overlays[t].id]).removeData(s);return!0}return!1},clearOverlays:function(t){for(var n=0,r=this[this.overlays[t].array].length;n-1){this.tmpMarkers.splice(n,1);r=this.markers.splice(n,1);var i=r[0],t=e(this.mapId).data(i),s=e(this.mapId).data(i+"info");t.setVisible(!1);t.setMap(null);e(this.mapId).removeData(i);if(s){s.close();s.show=!1;e(this.mapId).removeData(i+"info")}return!0}return!1},clearMarkers:function(){for(var t=0,n=this.markers.length;t