');
carousel_output.push('');
if(i == markers.length-1){
$('ul#codespacing_progress_map_carousel_'+map_id).append(carousel_output.join(''));
cspm_init_carousel(null, map_id);
}
}
}
},
events:{
mouseover: function(marker, event, elements){
/**
* Display the single infobox */
if(show_infobox == 'true' && infobox_display_event == 'onhover')
infobox_xhr = cspm_draw_single_infobox(plugin_map, map_id, infobox_div, infobox_type, marker, infobox_xhr, 'yes');
/**
* Apply the style for the active item in the carousel */
if(!light_map){
var post_id = marker.post_id;
var is_child = marker.is_child;
var i = $('li[id='+map_id+'_list_items_'+post_id+'][data-is-child="'+is_child+'"]').attr('value');
cspm_call_carousel_item($('ul#codespacing_progress_map_carousel_'+map_id).data('jcarousel'), i);
cspm_carousel_item_hover_style('li.carousel_item_'+i+'_'+map_id, map_id);
}
},
mouseout: function(marker, event, elements){
/**
* Hide the infobox */
if(show_infobox == 'true' && (infobox_display_event == 'onhover' || infobox_display_event == 'onclick') && remove_infobox_on_mouseout == 'true'){
infobox_div.addClass('cspm_animated fadeOutUp');
infobox_div.hide().removeClass('cspm_animated fadeOutUp');
}
},
click: function(marker, event, elements){
var latLng = marker.position;
/**
* Center the map on that marker */
map.panTo(latLng);
cspm_pan_map_to_fit_infobox(plugin_map, map_id, infobox_div);
/**
* Display the single infobox */
if(json_markers_data.length > 0 && show_infobox == 'true' && infobox_display_event == 'onclick'){
setTimeout(function(){
infobox_xhr = cspm_draw_single_infobox(plugin_map, map_id, infobox_div, infobox_type, marker, infobox_xhr, 'yes');
}, 400);
}
/**
* Apply the style for the active item in the carousel */
if(!light_map){
var post_id = marker.post_id;
var is_child = marker.is_child;
var i = $('li[id='+map_id+'_list_items_'+post_id+'][data-is-child="'+is_child+'"]').attr('value');
cspm_call_carousel_item($('ul#codespacing_progress_map_carousel_'+map_id).data('jcarousel'), i);
cspm_carousel_item_hover_style('li.carousel_item_'+i+'_'+map_id, map_id);
}
}
}
}
});
$('div.codespacing_map_zoom_in_'+map_id+', div.codespacing_map_zoom_out_'+map_id).show();
/**
* Draw infoboxes (onload event) */
if(json_markers_data.length > 0 && clustering_method == true && show_infobox == 'true' && infobox_display_event == 'onload'){
google.maps.event.addListenerOnce(clusterer, 'clusteringend', function(cluster) {
setTimeout(function(){
cspm_draw_multiple_infoboxes(plugin_map, map_id, '
', infobox_type, 'yes');
infobox_loaded = true;
}, 1000);
});
}else if(json_markers_data.length > 0 && clustering_method == false && show_infobox == 'true' && infobox_display_event == 'onload'){
setTimeout(function(){
cspm_draw_multiple_infoboxes(plugin_map, map_id, '
', infobox_type, 'yes');
infobox_loaded = true;
}, 1000);
}else if(json_markers_data.length > 0 && show_infobox == 'true' && infobox_display_event != 'onload'){
infobox_loaded = true;
}
/**
* End the Progress Bar Loader */
if(typeof NProgress !== 'undefined')
NProgress.done();
}
},
events:{
click: function(){
/**
* Remove single infobox on map click (onclick, onhover events) */
if(json_markers_data.length > 0 && show_infobox == 'true' && infobox_display_event != 'onload'){
infobox_div.hide();
infobox_div.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
infobox_div.hide().removeClass('cspm_animated fadeOutUp');
});
}
},
idle: function(){
if(infobox_loaded && !cspm_is_panorama_active(plugin_map)){
setTimeout(function(){
if(json_markers_data.length > 0 && show_infobox == 'true' && infobox_display_event == 'onload'){
cspm_draw_multiple_infoboxes(plugin_map, map_id, '
', infobox_type, 'yes');
}
}, 200);
}
},
bounds_changed: function(){
if(json_markers_data.length > 0){
if(json_markers_data.length > 0 && show_infobox == 'true' && infobox_display_event != 'onload'){
cspm_set_single_infobox_position(plugin_map, infobox_div);
}else $('div.cspm_infobox_container').hide();
}
},
drag: function(){
if(json_markers_data.length > 0){
if(show_infobox == 'true' && infobox_display_event != 'onload'){
cspm_set_single_infobox_position(plugin_map, infobox_div);
}else $('div.cspm_infobox_container').hide();
}
},
center_changed: function(){
setTimeout(function() {
$('div[class^=cluster_posts_widget]').removeClass('flipInX');
$('div[class^=cluster_posts_widget]').addClass('cspm_animated flipOutX');
setTimeout(function() {
if(typeof $('div.cluster_posts_widget_'+map_id).mCustomScrollbar === 'function'){
$('div.cluster_posts_widget_'+map_id).mCustomScrollbar("destroy");
}
}, 500);
}, 500);
}
}
},
styledmaptype:{
id: "custom_style",
options:{
name: "Old Dry Mud",
alt: "Show Old Dry Mud"
},
styles: [{"featureType":"landscape","stylers":[{"hue":"#FFAD00"},{"saturation":50.2},{"lightness":-34.8},{"gamma":1}]},{"featureType":"road.highway","stylers":[{"hue":"#FFAD00"},{"saturation":-19.8},{"lightness":-1.8},{"gamma":1}]},{"featureType":"road.arterial","stylers":[{"hue":"#FFAD00"},{"saturation":72.4},{"lightness":-32.6},{"gamma":1}]},{"featureType":"road.local","stylers":[{"hue":"#FFAD00"},{"saturation":74.4},{"lightness":-18},{"gamma":1}]},{"featureType":"water","stylers":[{"hue":"#00FFA6"},{"saturation":-63.2},{"lightness":38},{"gamma":1}]},{"featureType":"poi","stylers":[{"hue":"#FFC300"},{"saturation":54.2},{"lightness":-14.4},{"gamma":1}]}] },
});
/**
* Hide/Show UI Controls depending on the streetview visibility */
var mapObject = plugin_map.gmap3('get');
if(typeof mapObject.getStreetView === 'function'){
var streetView = mapObject.getStreetView();
google.maps.event.addListener(streetView, "visible_changed", function(){
if(this.getVisible()){
$('div.codespacing_map_zoom_in_'+map_id+', div.codespacing_map_zoom_out_'+map_id).hide();
$('div.cspm_infobox_container').hide();
}else{
$('div.codespacing_map_zoom_in_'+map_id+', div.codespacing_map_zoom_out_'+map_id).show();
if(json_markers_data.length > 0 && infobox_loaded){
setTimeout(function(){
if(show_infobox == 'true' && infobox_display_event == 'onload'){
cspm_draw_multiple_infoboxes(plugin_map, map_id, '
', infobox_type, 'yes');
}
}, 200);
}
}
});
}
/**
* Call zoom-in function */
cspm_zoom_in($('div.codespacing_map_zoom_in_'+map_id), plugin_map);
/**
* Call zoom-out function */
cspm_zoom_out($('div.codespacing_map_zoom_out_'+map_id), plugin_map);
/**
* Store the window width */
var windowWidth = $(window).width();
$(window).resize(function(){
/**
* Check window width has actually changed and it's not just iOS triggering a resize event on scroll */
if ($(window).width() != windowWidth) {
/**
* Update the window width for next time */
windowWidth = $(window).width();
setTimeout(function(){
var latLng = new google.maps.LatLng (38.927862, 28.8380343);
var map = plugin_map.gmap3("get");
if(typeof map.panTo === 'function')
map.panTo(latLng);
if(typeof map.setCenter === 'function')
map.setCenter(latLng);
}, 500);
}
});
_CSPM_DONE[map_id] = true;
});