1/* taken from styles-with-shortcodes */ 2 3function rhc_gmap3_init(obj){ 4 jQuery(document).ready(function($){ 5 var address = obj.address; 6 if(address!='' && obj.glat==0 && obj.glon==0 ){ 7 var geocoder_map = new google.maps.Geocoder(); 8 geocoder_map.geocode( { 'address': address}, function(results, status) { 9 obj.address=''; 10 if (status == google.maps.GeocoderStatus.OK) { 11 latlng = results[0].geometry.location; 12 obj.glat = latlng.lat(); 13 obj.glon = latlng.lng(); 14 } 15 return rhc_gmap3_init(obj); 16 }); 17 } 18 19 var latlng = new google.maps.LatLng( obj.glat, obj.glon); 20 var myOptions = { 21 scrollwheel: (typeof obj.scrollwheel=='undefined' ? true :obj.scrollwheel), 22 zoom: obj.zoom, 23 center: latlng, 24 disableDefaultUI: obj.disableDefaultUI, 25 mapTypeId: obj.map_type 26 }; 27 28 var map = new google.maps.Map(document.getElementById("map_canvas"+obj.uid), myOptions); 29 var infowindow = new google.maps.InfoWindow({ 30 content: document.getElementById(obj.info_windows) 31 }); 32 33 if( 'object' == typeof obj.styles ){ 34 map.setOptions({styles: obj.styles}); 35 } 36 37 if(obj.traffic){ 38 var trafficLayer = new google.maps.TrafficLayer(); 39 trafficLayer.setMap(map); 40 } 41 42 var marker = new google.maps.Marker({position: latlng,map: map,title:obj.name}); 43 google.maps.event.addListener(marker, 'click', function() { 44 infowindow.open(map,marker); 45 }); 46 47 var _markers_sel = obj.markers; 48 var _markers = $(_markers_sel).html(); 49 50 var arr = _markers.split('::'); 51 var mmarker = []; 52 var marker_content = []; 53 if(arr.length>0){ 54 for(var a=0;a<arr.length;a++){ 55 var brr = arr[a].split('|'); 56 if(brr.length==4){ 57 if(brr[0].replace(' ','')==''){ continue;} 58 var mlatlng = new google.maps.LatLng(brr[0], brr[1]); 59 60 marker_content[a] = brr[3]; 61 mmarker[a] = new google.maps.Marker({position: mlatlng,map: map,title:brr[2]}); 62 attachInfo(mmarker[a],a); 63 } 64 } 65 } 66 67 function attachInfo(_marker, number) { 68 var infowindow = new google.maps.InfoWindow({ content: marker_content[number]}); 69 google.maps.event.addListener(_marker, 'click', function() { 70 infowindow.open(map,_marker); 71 }); 72 } 73 }); 74}
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.