var mapPlaces; var mapPlacesMarkers = new Array(); var infoWindow = new google.maps.InfoWindow(); var url = '/ajax/vuz.map/'; jQuery(function($) { // var latlng = new google.maps.LatLng(54.62466, 39.738571); mapPlaces = new google.maps.Map(document.getElementById("vuz-map"), { //zoom: 12, //center: latlng, scrollwheel: true, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU} }); $.getJSON(url, { 'nocache': Math.random() }, function(e){ mapPlaces.setZoom(13); mapPlaces.setCenter(new google.maps.LatLng(54.62466, 39.738571)); $(e).each(function(){ placesMapMarkerAdd(this.lat, this.lng, this.html,'vuz' ); }); }); $( ".portlets-column" ).sortable({ connectWith: ".portlets-column" }); $( ".portlets-column" ).sortable( "disable" ); $( ".portlets-card-head" ).sortable('option', 'cursor', 'move'); $( ".portlets-card-head" ).click(function() { $( this ).toggleClass( "portlets-card-head-icon" ); $( this ).parents( ".portlets-card:first" ).find( ".portlets-card-body" ).toggle(); return false; }); $( ".portlets-card-head" ).mouseover(function(){ $(this).attr("style","cursor:move;"); }); $( ".portlets-card-head" ).mouseout(function(){ $(this).attr("style","cursor:default;"); }); $( ".portlets-column" ).sortable({ start: function(){ $(".portlets-card-head").unbind("click"); } }); $('.portlets-column').sortable({ stop: function() { setTimeout(clBind, 500); } }); $(".portlets-card-head").mousedown(function(){ $( ".portlets-column" ).sortable( "enable" ); }).mouseup(function(){ $( ".portlets-column" ).sortable( "disable" ); flag=true; }); function clBind() { $( ".portlets-card-head" ).click(function() { $( this ).toggleClass( "portlets-card-head-icon" ); $( this ).parents( ".portlets-card:first" ).find( ".portlets-card-body" ).toggle(); }); } }) function showVuzTab(el){ var id=$(el).attr("rel"); $("#"+id.substring(0,id.length-1)+"1").hide(); $("#"+id.substring(0,id.length-1)+"2").hide(); $("#"+id.substring(0,id.length-1)+"3").hide(); $("#"+id).show(); $(el).parent(".portlets-card-tabs-tab").parent(".portlets-card-tabs").children("div").removeClass("active"); $(el).parent("div").addClass("active"); return false; } function placesMapMarkerAdd(lat, lng, html, what) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, lng), map: mapPlaces, icon: pins[what], shadow: pinShadow, shape: pinShape }); google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent('
'+html+'
'); infoWindow.open(mapPlaces, marker); }); mapPlacesMarkers.push(marker); } function sidebarMapRemovePins() { infoWindow.close(); $(mapPlacesMarkers).each(function(){ this.setMap(null); }); mapPlacesMarkers = []; }