1/** 2 * EventON Generate Google Maps Function 3 * @version 0.2 4 */ 5(function($){ 6 $.fn.evoGenmaps = function(opt){ 7 8 var defaults = { 9 delay: 0, 10 fnt: 1, 11 cal: '', 12 mapSpotId: '', 13 _action:'' 14 }; 15 var options = $.extend({}, defaults, opt); 16 17 var geocoder; 18 19 20 // popup lightbox generation 21 if(options._action=='lightbox'){ 22 loadl_gmaps_in(this, options.cal, options.mapSpotId); 23 } 24 25 // functions 26 if(options.fnt==1){ 27 this.each(function(){ 28 var eventcard = $(this).attr('eventcard'); 29 30 if(eventcard=='1'){ 31 $(this).find('a.desc_trig').each(function(elm){ 32 //$(this).siblings('.event_description').slideDown(); 33 var obj = $(this); 34 35 if(options.delay==0){ 36 load_googlemaps_here(obj); 37 }else{ 38 setTimeout(load_googlemaps_here, options.delay, obj); 39 } 40 }); 41 } 42 }); 43 } 44 45 if(options.fnt==2){ 46 if(options.delay==0){ 47 load_googlemaps_here(this); 48 }else{ 49 setTimeout(load_googlemaps_here, options.delay, this); 50 } 51 } 52 if(options.fnt==3){ 53 loadl_gmaps_in(this, options.cal, ''); 54 } 55 56 // gmaps on popup 57 if(options.fnt==4){ 58 // check if gmaps should run 59 if( this.attr('data-gmtrig')=='1' && this.attr('data-gmap_status')!='null'){ 60 var cal = this.closest('div.ajde_evcal_calendar '); 61 loadl_gmaps_in(this, cal, options.mapSpotId); 62 } 63 } 64 65 // function to load google maps for eventcard 66 function load_googlemaps_here(obj){ 67 if( obj.data('gmstat')!= '1'){ 68 obj.attr({'data-gmstat':'1'}); 69 } 70 71 var cal = obj.closest('div.ajde_evcal_calendar '); 72 73 if( obj.attr('data-gmtrig')=='1' && obj.attr('data-gmap_status')!='null'){ 74 loadl_gmaps_in(obj, cal, ''); 75 } 76 } 77 78 // Load the google map on the object 79 function loadl_gmaps_in(obj, cal, mapId){ 80 81 var evodata = cal.find('.evo-data'); 82 83 var mapformat = evodata.data('mapformat'); 84 var ev_location = obj.find('.evcal_desc'); 85 86 var location_type = ev_location.attr('data-location_type'); 87 if(location_type=='address'){ 88 var address = ev_location.attr('data-location_address'); 89 var location_type = 'add'; 90 }else{ 91 var address = ev_location.attr('data-latlng'); 92 var location_type = 'latlng'; 93 } 94 95 var map_canvas_id= (mapId!=='')? 96 mapId: 97 obj.closest('.eventon_list_event').find('.event_description').find('.evcal_gmaps').attr('id'); 98 99 // google maps styles 100 // @since 2.2.22 101 var styles = ''; 102 103 if( typeof gmapstyles !== 'undefined' && gmapstyles != 'default'){ 104 styles = $.parseJSON(gmapstyles); 105 } 106 107 var zoom = evodata.data('mapzoom'); 108 var zoomlevel = (typeof zoom !== 'undefined' && zoom !== false)? parseInt(zoom):12; 109 110 var scroll = evodata.data('mapscroll'); 111 //console.log(map_canvas_id+' '+mapformat+' '+ location_type +' '+scroll +' '+ address); 112 113 //obj.siblings('.event_description').find('.evcal_gmaps').html(address); 114 if($('#'+map_canvas_id).length>0) 115 initialize( 116 map_canvas_id, 117 address, 118 mapformat, 119 zoomlevel, 120 location_type, 121 scroll, 122 styles, 123 evodata.attr('data-mapiconurl') 124 ); 125 } 126 127 //console.log(options); 128 129 }; 130}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.