/** * Maplace.js 0.1.33 * * Copyright (c) 2013 Daniele Moraschi * Licensed under the MIT license * For all details and documentation: * http://maplacejs.com */ (function(g,t,f,m){var q,n,p;q={activateCurrent:function(e){this.html_element.find("select").val(e)},getHtml:function(){var e=this,a="",b;if(1';this.ShowOnMenu(this.view_all_key)&&(a+='");for(b=0;b'+(this.o.locations[b].title||"#"+(b+1))+"");a=g(a+"").bind("change",function(){e.ViewOnMap(this.value)})}(b= this.o.controls_title)&&(b=g('
').css(this.o.controls_applycss?{fontWeight:"bold",fontSize:this.o.controls_on_map?"12px":"inherit",padding:"3px 10px 5px 0"}:{}).append(this.o.controls_title));return this.html_element=g('
').append(b).append(a)}};n={html_a:function(e,a,b){var c=this;a=a||e+1;b=b||this.o.locations[e].title;e=g(''+(b||"#"+(e+1))+"");e.css(this.o.controls_applycss? {color:"#666",display:"block",padding:"5px",fontSize:this.o.controls_on_map?"12px":"inherit",textDecoration:"none"}:{});e.on("click",function(a){a.preventDefault();a=g(this).attr("data-load");c.ViewOnMap(a)});return e},activateCurrent:function(e){this.html_element.find("li").removeClass("active");this.html_element.find("#ullist_a_"+e).parent().addClass("active")},getHtml:function(){var e=g("").css(this.o.controls_applycss?{margin:0,padding:0, listStyleType:"none"}:{}),a;this.ShowOnMenu(this.view_all_key)&&e.append(g("
  • ").append(n.html_a.call(this,!1,this.view_all_key,this.o.view_all_text)));for(a=0;a").append(n.html_a.call(this,a)));(a=this.o.controls_title)&&(a=g('
    ').css(this.o.controls_applycss?{fontWeight:"bold",padding:"3px 10px 5px 0",fontSize:this.o.controls_on_map?"12px":"inherit"}:{}).append(this.o.controls_title));return this.html_element= g('
    ').append(a).append(e)}};p=function(){function e(a){this.VERSION="0.1.33";this.loaded=!1;this.markers=[];this.circles=[];this.oMap=!1;this.view_all_key="all";this.infowindow=null;this.ln=this.maxZIndex=0;this.oMap=!1;this.directionsDisplay=this.directionsService=this.Fusion=this.Polygon=this.Polyline=this.current_index=this.current_control=this.controls_wrapper=this.canvas_map=this.map_div=this.oBounds=null;this.o={debug:!1,map_div:"#gmap",controls_div:"#controls", generate_controls:!0,controls_type:"dropdown",controls_cssclass:"",controls_title:"",controls_on_map:!0,controls_applycss:!0,controls_position:f.maps.ControlPosition.RIGHT_TOP,type:"marker",view_all:!0,view_all_text:"View All",pan_on_click:!0,start:0,locations:[],shared:{},map_options:{mapTypeId:f.maps.MapTypeId.ROADMAP},stroke_options:{strokeColor:"#0000FF",strokeOpacity:.8,strokeWeight:2,fillColor:"#0000FF",fillOpacity:.4},directions_options:{travelMode:f.maps.TravelMode.DRIVING,unitSystem:f.maps.UnitSystem.METRIC, optimizeWaypoints:!1,provideRouteAlternatives:!1,avoidHighways:!1,avoidTolls:!1},circle_options:{radius:100,visible:!0},styles:{},fusion_options:{},directions_panel:null,draggable:!1,editable:!1,show_infowindows:!0,show_markers:!0,infowindow_type:"bubble",listeners:{},beforeViewAll:function(){},afterViewAll:function(){},beforeShow:function(a,c,d){},afterShow:function(a,c,d){},afterCreateMarker:function(a,c,d){},beforeCloseInfowindow:function(a,c){},afterCloseInfowindow:function(a,c){},beforeOpenInfowindow:function(a, c,d){},afterOpenInfowindow:function(a,c,d){},afterRoute:function(a,c,d){},onPolylineClick:function(a){},onPolygonClick:function(a){},circleRadiusChanged:function(a,c,d){},circleCenterChanged:function(a,c,d){},drag:function(a,c,d){},dragEnd:function(a,c,d){},dragStart:function(a,c,d){}};this.AddControl("dropdown",q);this.AddControl("list",n);a&&"directions"===a.type&&(!a.show_markers&&(a.show_markers=!1),!a.show_infowindows&&(a.show_infowindows=!1));g.extend(!0,this.o,a)}e.prototype.controls={};e.prototype.create_objMap= function(){var a=0,b;for(b in this.o.styles)this.o.styles.hasOwnProperty(b)&&(0===a&&(this.o.map_options.mapTypeControlOptions={mapTypeIds:[f.maps.MapTypeId.ROADMAP]}),a++,this.o.map_options.mapTypeControlOptions.mapTypeIds.push("map_style_"+a));if(this.loaded)this.oMap.setOptions(this.o.map_options);else try{this.map_div.css({position:"relative",overflow:"hidden"}),this.canvas_map=g("
    ").addClass("canvas_map").css({width:"100%",height:"100%"}).appendTo(this.map_div),this.oMap=new f.maps.Map(this.canvas_map.get(0), this.o.map_options)}catch(c){this.debug("create_objMap::"+this.map_div.selector,c.toString())}a=0;for(b in this.o.styles)this.o.styles.hasOwnProperty(b)&&(a++,this.oMap.mapTypes.set("map_style_"+a,new f.maps.StyledMapType(this.o.styles[b],{name:b})),this.oMap.setMapTypeId("map_style_"+a))};e.prototype.add_markers_to_objMap=function(){var a,b;a=this.o.type||"marker";switch(a){case "marker":for(a=0;athis.maxZIndex?a.zIndex:this.maxZIndex;a.image&&(a.icon=new f.maps.MarkerImage(a.image,new f.maps.Size(a.image_w||32,a.image_h||32),new f.maps.Point(0,0),new f.maps.Point((a.image_w||32)/2,(a.image_h||32)/ 2)));return a};e.prototype.create_objCircle=function(a){var b,c,d;d=g.extend({},a);b=g.extend({},this.o.stroke_options);c=g.extend({},this.o.circle_options);g.extend(b,a.stroke_options||{});g.extend(d,b);g.extend(c,a.circle_options||{});g.extend(d,c);d.center=a.position;d.draggable=!1;d.zIndex=0
    ').css(this.o.controls_applycss?{margin:"5px"}:{}),b=g(this.get_html_controls()).css(this.o.controls_applycss? {background:"#fff",padding:"5px",border:"1px solid rgb(113,123,135)",boxShadow:"rgba(0, 0, 0, 0.4) 0px 2px 4px",maxHeight:this.map_div.find(".canvas_map").outerHeight()-80,minWidth:100,overflowY:"auto",overflowX:"hidden"}:{});a.append(b);this.oMap.controls[this.o.controls_position].push(a.get(0))}else this.controls_wrapper.empty(),this.controls_wrapper.append(this.get_html_controls())};e.prototype.init_map=function(){var a=this;this.Polyline&&this.Polyline.setMap(null);this.Polygon&&this.Polygon.setMap(null); this.Fusion&&this.Fusion.setMap(null);this.directionsDisplay&&this.directionsDisplay.setMap(null);for(var b=this.markers.length-1;0<=b;--b)try{this.markers[b]&&this.markers[b].setMap(null)}catch(c){a.debug("init_map::markers::setMap",c.stack)}this.markers.length=0;this.markers=[];for(b=this.circles.length-1;0<=b;--b)try{this.circles[b]&&this.circles[b].setMap(null)}catch(d){a.debug("init_map::circles::setMap",d.stack)}this.circles.length=0;this.circles=[];this.o.controls_on_map&&this.oMap.controls&& this.oMap.controls[this.o.controls_position].forEach(function(b,c){try{a.oMap.controls[this.o.controls_position].removeAt(c)}catch(d){a.debug("init_map::removeAt",d.stack)}});this.oBounds=new f.maps.LatLngBounds};e.prototype.perform_load=function(){1===this.ln?(this.o.map_options.set_center?this.oMap.setCenter(new f.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):(this.oMap.fitBounds(this.oBounds),this.ViewOnMap(1)),this.o.map_options.zoom&&this.oMap.setZoom(this.o.map_options.zoom)): 0===this.ln?(this.o.map_options.set_center?this.oMap.setCenter(new f.maps.LatLng(this.o.map_options.set_center[0],this.o.map_options.set_center[1])):this.oMap.fitBounds(this.oBounds),this.oMap.setZoom(this.o.map_options.zoom||1)):(this.oMap.fitBounds(this.oBounds),"number"===typeof(this.o.start-0)&&0