PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
themes
/
wilcity
/
assets
/
vendors
/
googlemap
function MarkerClusterer(b,e,f){this.extend(MarkerClusterer,google.maps.OverlayView),this.map_=b,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var g=f||{};this.gridSize_=g.gridSize||60,this.minClusterSize_=g.minimumClusterSize||2,this.maxZoom_=g.maxZoom||null,this.styles_=g.styles||[],this.imagePath_=g.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=g.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,g.zoomOnClick!=void 0&&(this.zoomOnClick_=g.zoomOnClick),this.averageCenter_=!1,g.averageCenter!=void 0&&(this.averageCenter_=g.averageCenter),this.setupStyles_(),this.setMap(b),this.prevZoom_=this.map_.getZoom();var h=this;google.maps.event.addListener(this.map_,'zoom_changed',function(){var j=h.map_.getZoom();h.prevZoom_!=j&&(h.prevZoom_=j,h.resetViewport())}),google.maps.event.addListener(this.map_,'idle',function(){h.redraw()}),e&&e.length&&this.addMarkers(e,!1)}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_='../images/m',MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_='png',MarkerClusterer.prototype.extend=function(b,e){return function(f){for(var g in f.prototype)this.prototype[g]=f.prototype[g];return this}.apply(b,[e])},MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var e,b=0;e=this.sizes[b];b++)this.styles_.push({url:this.imagePath_+(b+1)+'.'+this.imageExtension_,height:e,width:e})},MarkerClusterer.prototype.fitMapToMarkers=function(){for(var g,b=this.getMarkers(),e=new google.maps.LatLngBounds,f=0;g=b[f];f++)e.extend(g.getPosition());this.map_.fitBounds(e)},MarkerClusterer.prototype.setStyles=function(b){this.styles_=b},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.setMaxZoom=function(b){this.maxZoom_=b},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.calculator_=function(b,e){for(var f=0,g=b.length,h=g;0!==h;)h=parseInt(h/10,10),f++;return f=Math.min(f,e),{text:g,index:f}},MarkerClusterer.prototype.setCalculator=function(b){this.calculator_=b},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.addMarkers=function(b,e){for(var g,f=0;g=b[f];f++)this.pushMarkerTo_(g);e||this.redraw()},MarkerClusterer.prototype.pushMarkerTo_=function(b){if(b.isAdded=!1,b.draggable){var e=this;google.maps.event.addListener(b,'dragend',function(){b.isAdded=!1,e.repaint()})}this.markers_.push(b)},MarkerClusterer.prototype.addMarker=function(b,e){this.pushMarkerTo_(b),e||this.redraw()},MarkerClusterer.prototype.removeMarker_=function(b){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(b);else for(var g,f=0;g=this.markers_[f];f++)if(g==b){e=f;break}return-1!=e&&(b.setMap(null),this.markers_.splice(e,1),!0)},MarkerClusterer.prototype.removeMarker=function(b,e){var f=this.removeMarker_(b);return!e&&f&&(this.resetViewport(),this.redraw(),!0)},MarkerClusterer.prototype.removeMarkers=function(b,e){for(var h,j,f=!1,g=0;h=b[g];g++)j=this.removeMarker_(h),f=f||j;if(!e&&f)return this.resetViewport(),this.redraw(),!0},MarkerClusterer.prototype.setReady_=function(b){this.ready_||(this.ready_=b,this.createClusters_())},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.getMap=function(){return this.map_},MarkerClusterer.prototype.setMap=function(b){this.map_=b},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(b){this.gridSize_=b},MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinClusterSize=function(b){this.minClusterSize_=b},MarkerClusterer.prototype.getExtendedBounds=function(b){var e=this.getProjection(),f=new google.maps.LatLng(b.getNorthEast().lat(),b.getNorthEast().lng()),g=new google.maps.LatLng(b.getSouthWest().lat(),b.getSouthWest().lng()),h=e.fromLatLngToDivPixel(f);h.x+=this.gridSize_,h.y-=this.gridSize_;var j=e.fromLatLngToDivPixel(g);j.x-=this.gridSize_,j.y+=this.gridSize_;var k=e.fromDivPixelToLatLng(h),n=e.fromDivPixelToLatLng(j);return b.extend(k),b.extend(n),b},MarkerClusterer.prototype.isMarkerInBounds_=function(b,e){return e.contains(b.getPosition())},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},MarkerClusterer.prototype.resetViewport=function(b){for(var f,e=0;f=this.clusters_[e];e++)f.remove();for(var g,e=0;g=this.markers_[e];e++)g.isAdded=!1,b&&g.setMap(null);this.clusters_=[]},MarkerClusterer.prototype.repaint=function(){var b=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var f,e=0;f=b[e];e++)f.remove()},0)},MarkerClusterer.prototype.redraw=function(){this.createClusters_()},MarkerClusterer.prototype.distanceBetweenPoints_=function(b,e){if(!b||!e)return 0;var g=(e.lat()-b.lat())*Math.PI/180,h=(e.lng()-b.lng())*Math.PI/180,j=Math.sin(g/2)*Math.sin(g/2)+Math.cos(b.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(h/2)*Math.sin(h/2),k=2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j));return 6371*k},MarkerClusterer.prototype.addToClosestCluster_=function(b){for(var j,k,e=4e4,f=null,g=b.getPosition(),h=0;j=this.clusters_[h];h++)if(k=j.getCenter(),k){var n=this.distanceBetweenPoints_(k,b.getPosition());n<e&&(e=n,f=j)}if(f&&f.isMarkerInClusterBounds(b))f.addMarker(b);else{var j=new Cluster(this);j.addMarker(b),this.clusters_.push(j)}},MarkerClusterer.prototype.createClusters_=function(){if(this.ready_)for(var g,b=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(b),f=0;g=this.markers_[f];f++)!g.isAdded&&this.isMarkerInBounds_(g,e)&&this.addToClosestCluster_(g)};function Cluster(b){this.markerClusterer_=b,this.map_=b.getMap(),this.gridSize_=b.getGridSize(),this.minClusterSize_=b.getMinClusterSize(),this.averageCenter_=b.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,b.getStyles(),b.getGridSize())}Cluster.prototype.isMarkerAlreadyAdded=function(b){if(this.markers_.indexOf)return-1!=this.markers_.indexOf(b);for(var f,e=0;f=this.markers_[e];e++)if(f==b)return!0;return!1},Cluster.prototype.addMarker=function(b){if(this.isMarkerAlreadyAdded(b))return!1;if(!this.center_)this.center_=b.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,f=(this.center_.lat()*(e-1)+b.getPosition().lat())/e,g=(this.center_.lng()*(e-1)+b.getPosition().lng())/e;this.center_=new google.maps.LatLng(f,g),this.calculateBounds_()}b.isAdded=!0,this.markers_.push(b);var h=this.markers_.length;if(h<this.minClusterSize_&&b.getMap()!=this.map_&&b.setMap(this.map_),h==this.minClusterSize_)for(var j=0;j<h;j++)this.markers_[j].setMap(null);return h>=this.minClusterSize_&&b.setMap(null),this.updateIcon(),!0},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){for(var g,b=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),f=0;g=e[f];f++)b.extend(g.getPosition());return b},Cluster.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.calculateBounds_=function(){var b=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(b)},Cluster.prototype.isMarkerInClusterBounds=function(b){return this.bounds_.contains(b.getPosition())},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.updateIcon=function(){var b=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&b>e){for(var g,f=0;g=this.markers_[f];f++)g.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_)return void this.clusterIcon_.hide();var h=this.markerClusterer_.getStyles().length,j=this.markerClusterer_.getCalculator()(this.markers_,h);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(j),this.clusterIcon_.show()};function ClusterIcon(b,e,f){b.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.styles_=e,this.padding_=f||0,this.cluster_=b,this.center_=null,this.map_=b.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}ClusterIcon.prototype.triggerClusterClick=function(b){var e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e,'clusterclick',this.cluster_,b),e.isZoomOnClick()&&this.map_.fitBounds(this.cluster_.getBounds())},ClusterIcon.prototype.onAdd=function(){if(this.div_=document.createElement('DIV'),this.visible_){var b=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(b),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var f=this,g=!1;google.maps.event.addDomListener(this.div_,'click',function(h){g||f.triggerClusterClick(h)}),google.maps.event.addDomListener(this.div_,'mousedown',function(){g=!1}),google.maps.event.addDomListener(this.div_,'mousemove',function(){g=!0})},ClusterIcon.prototype.getPosFromLatLng_=function(b){var e=this.getProjection().fromLatLngToDivPixel(b);return'object'==typeof this.iconAnchor_&&2===this.iconAnchor_.length?(e.x-=this.iconAnchor_[0],e.y-=this.iconAnchor_[1]):(e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10)),e},ClusterIcon.prototype.draw=function(){if(this.visible_){var b=this.getPosFromLatLng_(this.center_);this.div_.style.top=b.y+'px',this.div_.style.left=b.x+'px'}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display='none'),this.visible_=!1},ClusterIcon.prototype.show=function(){if(this.div_){var b=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(b),this.div_.style.display=''}this.visible_=!0},ClusterIcon.prototype.remove=function(){this.setMap(null)},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.setSums=function(b){this.sums_=b,this.text_=b.text,this.index_=b.index,this.div_&&(this.div_.innerHTML=b.text),this.useStyle()},ClusterIcon.prototype.useStyle=function(){var b=Math.max(0,this.sums_.index-1);b=Math.min(this.styles_.length-1,b);var e=this.styles_[b];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition,this.iconAnchor_=e.iconAnchor},ClusterIcon.prototype.setCenter=function(b){this.center_=b},ClusterIcon.prototype.createCss=function(b){var e=['background-image:url('+this.url_+');'],f=this.backgroundPosition_?this.backgroundPosition_:'0 0';e.push('background-position:'+f+';'),'object'==typeof this.anchor_?('number'==typeof this.anchor_[0]&&0<this.anchor_[0]&&this.anchor_[0]<this.height_?e.push('height:'+(this.height_-this.anchor_[0])+'px; padding-top:'+this.anchor_[0]+'px;'):'number'==typeof this.anchor_[0]&&0>this.anchor_[0]&&-this.anchor_[0]<this.height_?e.push('height:'+this.height_+'px; line-height:'+(this.height_+this.anchor_[0])+'px;'):e.push('height:'+this.height_+'px; line-height:'+this.height_+'px;'),'number'==typeof this.anchor_[1]&&0<this.anchor_[1]&&this.anchor_[1]<this.width_?e.push('width:'+(this.width_-this.anchor_[1])+'px; padding-left:'+this.anchor_[1]+'px;'):e.push('width:'+this.width_+'px; text-align:center;')):e.push('height:'+this.height_+'px; line-height:'+this.height_+'px; width:'+this.width_+'px; text-align:center;');var g=this.textColor_?this.textColor_:'black',h=this.textSize_?this.textSize_:11;return e.push('cursor:pointer; top:'+b.y+'px; left:'+b.x+'px; color:'+g+'; position:absolute; font-size:'+h+'px; font-family:Arial,sans-serif; font-weight:bold'),e.join('')},window.MarkerClusterer=MarkerClusterer,MarkerClusterer.prototype.addMarker=MarkerClusterer.prototype.addMarker,MarkerClusterer.prototype.addMarkers=MarkerClusterer.prototype.addMarkers,MarkerClusterer.prototype.clearMarkers=MarkerClusterer.prototype.clearMarkers,MarkerClusterer.prototype.fitMapToMarkers=MarkerClusterer.prototype.fitMapToMarkers,MarkerClusterer.prototype.getCalculator=MarkerClusterer.prototype.getCalculator,MarkerClusterer.prototype.getGridSize=MarkerClusterer.prototype.getGridSize,MarkerClusterer.prototype.getExtendedBounds=MarkerClusterer.prototype.getExtendedBounds,MarkerClusterer.prototype.getMap=MarkerClusterer.prototype.getMap,MarkerClusterer.prototype.getMarkers=MarkerClusterer.prototype.getMarkers,MarkerClusterer.prototype.getMaxZoom=MarkerClusterer.prototype.getMaxZoom,MarkerClusterer.prototype.getStyles=MarkerClusterer.prototype.getStyles,MarkerClusterer.prototype.getTotalClusters=MarkerClusterer.prototype.getTotalClusters,MarkerClusterer.prototype.getTotalMarkers=MarkerClusterer.prototype.getTotalMarkers,MarkerClusterer.prototype.redraw=MarkerClusterer.prototype.redraw,MarkerClusterer.prototype.removeMarker=MarkerClusterer.prototype.removeMarker,MarkerClusterer.prototype.removeMarkers=MarkerClusterer.prototype.removeMarkers,MarkerClusterer.prototype.resetViewport=MarkerClusterer.prototype.resetViewport,MarkerClusterer.prototype.repaint=MarkerClusterer.prototype.repaint,MarkerClusterer.prototype.setCalculator=MarkerClusterer.prototype.setCalculator,MarkerClusterer.prototype.setGridSize=MarkerClusterer.prototype.setGridSize,MarkerClusterer.prototype.setMaxZoom=MarkerClusterer.prototype.setMaxZoom,MarkerClusterer.prototype.onAdd=MarkerClusterer.prototype.onAdd,MarkerClusterer.prototype.draw=MarkerClusterer.prototype.draw,Cluster.prototype.getCenter=Cluster.prototype.getCenter,Cluster.prototype.getSize=Cluster.prototype.getSize,Cluster.prototype.getMarkers=Cluster.prototype.getMarkers,ClusterIcon.prototype.onAdd=ClusterIcon.prototype.onAdd,ClusterIcon.prototype.draw=ClusterIcon.prototype.draw,ClusterIcon.prototype.onRemove=ClusterIcon.prototype.onRemove;
[+]
..
[-] markerclusterer.js
[edit]
[-] snazzy-info-window.min.js
[edit]
[-] snazzy-info-window.min.css
[edit]