Viewing File: /htdocs/atito.com/js/map-plugins.js
// Map Infoboxes ------------------
"use strict";function InfoBox(t){t=t||{},google.maps.OverlayView.apply(this,arguments),this.content_=t.content||"",this.disableAutoPan_=t.disableAutoPan||!1,this.maxWidth_=t.maxWidth||0,this.pixelOffset_=t.pixelOffset||new google.maps.Size(0,0),this.position_=t.position||new google.maps.LatLng(0,0),this.zIndex_=t.zIndex||null,this.boxClass_=t.boxClass||"infoBox",this.boxStyle_=t.boxStyle||{},this.closeBoxMargin_=t.closeBoxMargin||"2px",this.closeBoxURL_=t.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===t.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=t.infoBoxClearance||new google.maps.Size(1,1),void 0===t.visible&&(void 0===t.isHidden?t.visible=!0:t.visible=!t.isHidden),this.isHidden_=!t.visible,this.alignBottom_=t.alignBottom||!1,this.pane_=t.pane||"floatPane",this.enableEventPropagation_=t.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}InfoBox.prototype=new google.maps.OverlayView,InfoBox.prototype.createInfoBoxDiv_=function(){var t,i,e,o=this,s=function(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),void 0===this.content_.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!=this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(e=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-e.left-e.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],i=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],t=0;t<i.length;t++)this.eventListeners_.push(google.maps.event.addDomListener(this.div_,i[t],s));this.eventListeners_.push(google.maps.event.addDomListener(this.div_,"mouseover",function(t){this.style.cursor="default"}))}this.contextListener_=google.maps.event.addDomListener(this.div_,"contextmenu",function(t){t.returnValue=!1,t.preventDefault&&t.preventDefault(),o.enableEventPropagation_||s(t)}),google.maps.event.trigger(this,"domready")}},InfoBox.prototype.getCloseBoxImg_=function(){var t="";return""!=this.closeBoxURL_&&(t="<img",t+=" src='"+this.closeBoxURL_+"'",t+=" align=right",t+=" style='",t+=" position: relative;",t+=" cursor: pointer;",t+=" margin: "+this.closeBoxMargin_+";",t+="'>"),t},InfoBox.prototype.addClickHandler_=function(){var t;""!=this.closeBoxURL_?(t=this.div_.firstChild,this.closeListener_=google.maps.event.addDomListener(t,"click",this.getCloseClickHandler_())):this.closeListener_=null},InfoBox.prototype.getCloseClickHandler_=function(){var t=this;return function(i){i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation(),google.maps.event.trigger(t,"closeclick"),t.close()}},InfoBox.prototype.panBox_=function(t){var i,e=0,o=0;if(!t&&(i=this.getMap())instanceof google.maps.Map){i.getBounds().contains(this.position_)||i.setCenter(this.position_),i.getBounds();var s=i.getDiv(),n=s.offsetWidth,h=s.offsetHeight,l=this.pixelOffset_.width,d=this.pixelOffset_.height,r=this.div_.offsetWidth,a=this.div_.offsetHeight,_=this.infoBoxClearance_.width,p=this.infoBoxClearance_.height,v=this.getProjection().fromLatLngToContainerPixel(this.position_);if(v.x<-l+_?e=v.x+l-_:v.x+r+l+_>n&&(e=v.x+r+l+_-n),this.alignBottom_?v.y<-d+p+a?o=v.y+d-p-a:v.y+d+p>h&&(o=v.y+d+p-h):v.y<-d+p?o=v.y+d-p:v.y+a+d+p>h&&(o=v.y+a+d+p-h),0!==e||0!==o){i.getCenter();i.panBy(e,o)}}},InfoBox.prototype.setBoxStyle_=function(){var t,i;if(this.div_){this.div_.className=this.boxClass_,this.div_.style.cssText="",i=this.boxStyle_;for(t in i)i.hasOwnProperty(t)&&(this.div_.style[t]=i[t]);this.div_.style.WebkitTransform="translateZ(0)",void 0!==this.div_.style.opacity&&""!=this.div_.style.opacity&&(this.div_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*this.div_.style.opacity+')"',this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!=this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},InfoBox.prototype.getBoxWidths_=function(){var t,i={top:0,bottom:0,left:0,right:0},e=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(t=e.ownerDocument.defaultView.getComputedStyle(e,""))&&(i.top=parseInt(t.borderTopWidth,10)||0,i.bottom=parseInt(t.borderBottomWidth,10)||0,i.left=parseInt(t.borderLeftWidth,10)||0,i.right=parseInt(t.borderRightWidth,10)||0):document.documentElement.currentStyle&&e.currentStyle&&(i.top=parseInt(e.currentStyle.borderTopWidth,10)||0,i.bottom=parseInt(e.currentStyle.borderBottomWidth,10)||0,i.left=parseInt(e.currentStyle.borderLeftWidth,10)||0,i.right=parseInt(e.currentStyle.borderRightWidth,10)||0),i},InfoBox.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},InfoBox.prototype.draw=function(){this.createInfoBoxDiv_();var t=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=t.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(t.y+this.pixelOffset_.height)+"px":this.div_.style.top=t.y+this.pixelOffset_.height+"px",this.isHidden_?this.div_.style.visibility="hidden":this.div_.style.visibility="visible"},InfoBox.prototype.setOptions=function(t){void 0!==t.boxClass&&(this.boxClass_=t.boxClass,this.setBoxStyle_()),void 0!==t.boxStyle&&(this.boxStyle_=t.boxStyle,this.setBoxStyle_()),void 0!==t.content&&this.setContent(t.content),void 0!==t.disableAutoPan&&(this.disableAutoPan_=t.disableAutoPan),void 0!==t.maxWidth&&(this.maxWidth_=t.maxWidth),void 0!==t.pixelOffset&&(this.pixelOffset_=t.pixelOffset),void 0!==t.alignBottom&&(this.alignBottom_=t.alignBottom),void 0!==t.position&&this.setPosition(t.position),void 0!==t.zIndex&&this.setZIndex(t.zIndex),void 0!==t.closeBoxMargin&&(this.closeBoxMargin_=t.closeBoxMargin),void 0!==t.closeBoxURL&&(this.closeBoxURL_=t.closeBoxURL),void 0!==t.infoBoxClearance&&(this.infoBoxClearance_=t.infoBoxClearance),void 0!==t.isHidden&&(this.isHidden_=t.isHidden),void 0!==t.visible&&(this.isHidden_=!t.visible),void 0!==t.enableEventPropagation&&(this.enableEventPropagation_=t.enableEventPropagation),this.div_&&this.draw()},InfoBox.prototype.setContent=function(t){this.content_=t,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),void 0===t.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+t:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(t)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px",void 0===t.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+t:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(t))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},InfoBox.prototype.setPosition=function(t){this.position_=t,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},InfoBox.prototype.setZIndex=function(t){this.zIndex_=t,this.div_&&(this.div_.style.zIndex=t),google.maps.event.trigger(this,"zindex_changed")},InfoBox.prototype.setVisible=function(t){this.isHidden_=!t,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},InfoBox.prototype.getContent=function(){return this.content_},InfoBox.prototype.getPosition=function(){return this.position_},InfoBox.prototype.getZIndex=function(){return this.zIndex_},InfoBox.prototype.getVisible=function(){return void 0!==this.getMap()&&null!==this.getMap()&&!this.isHidden_},InfoBox.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},InfoBox.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},InfoBox.prototype.open=function(t,i){var e=this;i&&(this.position_=i.getPosition(),this.moveListener_=google.maps.event.addListener(i,"position_changed",function(){e.setPosition(this.getPosition())})),this.setMap(t),this.div_&&this.panBox_()},InfoBox.prototype.close=function(){var t;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(t=0;t<this.eventListeners_.length;t++)google.maps.event.removeListener(this.eventListeners_[t]);this.eventListeners_=null}this.moveListener_&&(google.maps.event.removeListener(this.moveListener_),this.moveListener_=null),this.contextListener_&&(google.maps.event.removeListener(this.contextListener_),this.contextListener_=null),this.setMap(null)};
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/maps/google_maps_api_v3.js
// ==/ClosureCompiler==
/**
* @name MarkerClusterer for Google Maps v3
* @version version 1.0
* @author Luke Mahe
* @fileoverview
* The library creates and manages per-zoom-level clusters for large amounts of
* markers.
* <br/>
* This is a v3 implementation of the
* <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/"
* >v2 MarkerClusterer</a>.
*/
function MarkerClusterer(e,a,d){this.extend(MarkerClusterer,google.maps.OverlayView);this.map_=e;this.markers_=[];this.clusters_=[];this.sizes=[53,56,66,78,90];this.styles_=[];this.ready_=false;var b=d||{};this.gridSize_=b.gridSize||60;this.minClusterSize_=b.minimumClusterSize||2;this.maxZoom_=b.maxZoom||null;this.styles_=b.styles||[];this.imagePath_=b.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=b.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=true;if(b.zoomOnClick!=undefined){this.zoomOnClick_=b.zoomOnClick}this.averageCenter_=false;if(b.averageCenter!=undefined){this.averageCenter_=b.averageCenter}this.setupStyles_();this.setMap(e);this.prevZoom_=this.map_.getZoom();var c=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var f=c.map_.getZoom();if(c.prevZoom_!=f){c.prevZoom_=f;c.resetViewport()}});google.maps.event.addListener(this.map_,"idle",function(){c.redraw()});if(a&&a.length){this.addMarkers(a,false)}}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="../images/m";MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png";MarkerClusterer.prototype.extend=function(b,a){return(function(c){for(var d in c.prototype){this.prototype[d]=c.prototype[d]}return this}).apply(b,[a])};MarkerClusterer.prototype.onAdd=function(){this.setReady_(true)};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(this.styles_.length){return}for(var b=0,a;a=this.sizes[b];b++){this.styles_.push({url:this.imagePath_+(b+1)+"."+this.imageExtension_,height:a,width:a})}};MarkerClusterer.prototype.fitMapToMarkers=function(){var d=this.getMarkers();var c=new google.maps.LatLngBounds();for(var b=0,a;a=d[b];b++){c.extend(a.getPosition())}this.map_.fitBounds(c)};MarkerClusterer.prototype.setStyles=function(a){this.styles_=a};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(a){this.maxZoom_=a};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_};MarkerClusterer.prototype.calculator_=function(e,d){var a=0;var c=e.length;var b=c;while(b!==0){b=parseInt(b/10,10);a++}a=Math.min(a,d);return{text:c,index:a}};MarkerClusterer.prototype.setCalculator=function(a){this.calculator_=a};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_};MarkerClusterer.prototype.addMarkers=function(d,c){for(var b=0,a;a=d[b];b++){this.pushMarkerTo_(a)}if(!c){this.redraw()}};MarkerClusterer.prototype.pushMarkerTo_=function(a){a.isAdded=false;if(a.draggable){var b=this;google.maps.event.addListener(a,"dragend",function(){a.isAdded=false;b.repaint()})}this.markers_.push(a)};MarkerClusterer.prototype.addMarker=function(a,b){this.pushMarkerTo_(a);if(!b){this.redraw()}};MarkerClusterer.prototype.removeMarker_=function(b){var c=-1;if(this.markers_.indexOf){c=this.markers_.indexOf(b)}else{for(var d=0,a;a=this.markers_[d];d++){if(a==b){c=d;break}}}if(c==-1){return false}b.setMap(null);this.markers_.splice(c,1);return true};MarkerClusterer.prototype.removeMarker=function(a,b){var c=this.removeMarker_(a);if(!b&&c){this.resetViewport();this.redraw();return true}else{return false}};MarkerClusterer.prototype.removeMarkers=function(f,c){var e=false;for(var b=0,a;a=f[b];b++){var d=this.removeMarker_(a);e=e||d}if(!c&&e){this.resetViewport();this.redraw();return true}};MarkerClusterer.prototype.setReady_=function(a){if(!this.ready_){this.ready_=a;this.createClusters_()}};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};MarkerClusterer.prototype.getMap=function(){return this.map_};MarkerClusterer.prototype.setMap=function(a){this.map_=a};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_};MarkerClusterer.prototype.setGridSize=function(a){this.gridSize_=a};MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_};MarkerClusterer.prototype.setMinClusterSize=function(a){this.minClusterSize_=a};MarkerClusterer.prototype.getExtendedBounds=function(e){var c=this.getProjection();var f=new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng());var h=new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng());var d=c.fromLatLngToDivPixel(f);d.x+=this.gridSize_;d.y-=this.gridSize_;var b=c.fromLatLngToDivPixel(h);b.x-=this.gridSize_;b.y+=this.gridSize_;var g=c.fromDivPixelToLatLng(d);var a=c.fromDivPixelToLatLng(b);e.extend(g);e.extend(a);return e};MarkerClusterer.prototype.isMarkerInBounds_=function(a,b){return b.contains(a.getPosition())};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(true);this.markers_=[]};MarkerClusterer.prototype.resetViewport=function(d){for(var c=0,a;a=this.clusters_[c];c++){a.remove()}for(var c=0,b;b=this.markers_[c];c++){b.isAdded=false;if(d){b.setMap(null)}}this.clusters_=[]};MarkerClusterer.prototype.repaint=function(){var a=this.clusters_.slice();this.clusters_.length=0;this.resetViewport();this.redraw();window.setTimeout(function(){for(var c=0,b;b=a[c];c++){b.remove()}},0)};MarkerClusterer.prototype.redraw=function(){this.createClusters_()};MarkerClusterer.prototype.distanceBetweenPoints_=function(j,h){if(!j||!h){return 0}var g=6371;var e=(h.lat()-j.lat())*Math.PI/180;var f=(h.lng()-j.lng())*Math.PI/180;var b=Math.sin(e/2)*Math.sin(e/2)+Math.cos(j.lat()*Math.PI/180)*Math.cos(h.lat()*Math.PI/180)*Math.sin(f/2)*Math.sin(f/2);var k=2*Math.atan2(Math.sqrt(b),Math.sqrt(1-b));var i=g*k;return i};MarkerClusterer.prototype.addToClosestCluster_=function(c){var j=40000;var f=null;var h=c.getPosition();for(var e=0,b;b=this.clusters_[e];e++){var a=b.getCenter();if(a){var g=this.distanceBetweenPoints_(a,c.getPosition());if(g<j){j=g;f=b}}}if(f&&f.isMarkerInClusterBounds(c)){f.addMarker(c)}else{var b=new Cluster(this);b.addMarker(c);this.clusters_.push(b)}};MarkerClusterer.prototype.createClusters_=function(){if(!this.ready_){return}var b=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast());var d=this.getExtendedBounds(b);for(var c=0,a;a=this.markers_[c];c++){if(!a.isAdded&&this.isMarkerInBounds_(a,d)){this.addToClosestCluster_(a)}}};function Cluster(a){this.markerClusterer_=a;this.map_=a.getMap();this.gridSize_=a.getGridSize();this.minClusterSize_=a.getMinClusterSize();this.averageCenter_=a.isAverageCenter();this.center_=null;this.markers_=[];this.bounds_=null;this.clusterIcon_=new ClusterIcon(this,a.getStyles(),a.getGridSize())}Cluster.prototype.isMarkerAlreadyAdded=function(b){if(this.markers_.indexOf){return this.markers_.indexOf(b)!=-1}else{for(var c=0,a;a=this.markers_[c];c++){if(a==b){return true}}}return false};Cluster.prototype.addMarker=function(c){if(this.isMarkerAlreadyAdded(c)){return false}if(!this.center_){this.center_=c.getPosition();this.calculateBounds_()}else{if(this.averageCenter_){var b=this.markers_.length+1;var f=(this.center_.lat()*(b-1)+c.getPosition().lat())/b;var d=(this.center_.lng()*(b-1)+c.getPosition().lng())/b;this.center_=new google.maps.LatLng(f,d);this.calculateBounds_()}}c.isAdded=true;this.markers_.push(c);var a=this.markers_.length;if(a<this.minClusterSize_&&c.getMap()!=this.map_){c.setMap(this.map_)}if(a==this.minClusterSize_){for(var e=0;e<a;e++){this.markers_[e].setMap(null)}}if(a>=this.minClusterSize_){c.setMap(null)}this.updateIcon();return true};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_};Cluster.prototype.getBounds=function(){var c=new google.maps.LatLngBounds(this.center_,this.center_);var d=this.getMarkers();for(var b=0,a;a=d[b];b++){c.extend(a.getPosition())}return c};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 a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)};Cluster.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())};Cluster.prototype.getMap=function(){return this.map_};Cluster.prototype.updateIcon=function(){var e=this.map_.getZoom();var f=this.markerClusterer_.getMaxZoom();if(f&&e>f){for(var c=0,a;a=this.markers_[c];c++){a.setMap(this.map_)}return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var d=this.markerClusterer_.getStyles().length;var b=this.markerClusterer_.getCalculator()(this.markers_,d);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.setSums(b);this.clusterIcon_.show()};function ClusterIcon(a,c,b){a.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.styles_=c;this.padding_=b||0;this.cluster_=a;this.center_=null;this.map_=a.getMap();this.div_=null;this.sums_=null;this.visible_=false;this.setMap(this.map_)}ClusterIcon.prototype.triggerClusterClick=function(b){var a=this.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"clusterclick",this.cluster_,b);if(a.isZoomOnClick()){this.map_.fitBounds(this.cluster_.getBounds())}};ClusterIcon.prototype.onAdd=function(){this.div_=document.createElement("DIV");this.div_.className="cluster";if(this.visible_){var d=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(d);this.div_.innerHTML=this.sums_.text;this.div_.className="cluster-visible"}var b=this.getPanes();b.overlayMouseTarget.appendChild(this.div_);var c=this;var a=false;google.maps.event.addDomListener(this.div_,"click",function(e){if(!a){c.triggerClusterClick(e)}});google.maps.event.addDomListener(this.div_,"mousedown",function(){a=false});google.maps.event.addDomListener(this.div_,"mousemove",function(){a=true})};ClusterIcon.prototype.getPosFromLatLng_=function(b){var a=this.getProjection().fromLatLngToDivPixel(b);if(typeof this.iconAnchor_==="object"&&this.iconAnchor_.length===2){a.x-=this.iconAnchor_[0];a.y-=this.iconAnchor_[1]}else{a.x-=parseInt(this.width_/2,10);a.y-=parseInt(this.height_/2,10)}return a};ClusterIcon.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px";this.div_.style.left=a.x+"px"}};ClusterIcon.prototype.hide=function(){if(this.div_){this.div_.style.display="none"}this.visible_=false};ClusterIcon.prototype.show=function(){if(this.div_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(a);this.div_.style.display=""}this.visible_=true};ClusterIcon.prototype.remove=function(){this.setMap(null)};ClusterIcon.prototype.onRemove=function(){if(this.div_&&this.div_.parentNode){this.hide();this.div_.parentNode.removeChild(this.div_);this.div_=null}};ClusterIcon.prototype.setSums=function(a){this.sums_=a;this.text_=a.text;this.index_=a.index;if(this.div_){this.div_.innerHTML=a.text}this.useStyle()};ClusterIcon.prototype.useStyle=function(){var a=Math.max(0,this.sums_.index-1);a=Math.min(this.styles_.length-1,a);var b=this.styles_[a];this.url_=b.url;this.height_=b.height;this.width_=b.width;this.textColor_=b.textColor;this.anchor_=b.anchor;this.textSize_=b.textSize;this.backgroundPosition_=b.backgroundPosition;this.iconAnchor_=b.iconAnchor};ClusterIcon.prototype.setCenter=function(a){this.center_=a};ClusterIcon.prototype.createCss=function(e){var d=[];d.push("background-image:url("+this.url_+");");var b=this.backgroundPosition_?this.backgroundPosition_:"0 0";d.push("background-position:"+b+";");if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){d.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;")}else{if(typeof this.anchor_[0]==="number"&&this.anchor_[0]<0&&-this.anchor_[0]<this.height_){d.push("height:"+this.height_+"px; line-height:"+(this.height_+this.anchor_[0])+"px;")}else{d.push("height:"+this.height_+"px; line-height:"+this.height_+"px;")}}if(typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){d.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;")}else{d.push("width:"+this.width_+"px; text-align:center;")}}else{d.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;")}var a=this.textColor_?this.textColor_:"black";var c=this.textSize_?this.textSize_:11;d.push("cursor:pointer; top:"+e.y+"px; left:"+e.x+"px; color:"+a+"; position:absolute; font-size:"+c+"px; font-family:Arial,sans-serif; font-weight:bold");return d.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;
Back to Directory
File Manager