.... ..... <div id="job_map_back" style="height: 200px;width:100%;"> map to be appended in this block </div> <script type="text/javascript"> function { global $post; $title = str_replace('"', '"', wptexturize($post->post_title)); $topback-long = get_post_meta($post->ID, '_jr_geo_longitude', true); $topback-lat = get_post_meta($post->ID, '_jr_geo_latitude', true); if (!$tlong || !$tlat) return; /* <![CDATA[ */ jQuery.noConflict(); (function($) { $(function() { // Map global vars var child_map; var child_marker; var child_center; // initialize Google Maps API function child_initMap() { // Define Map center child_center = new google.maps.LatLng('<?php echo $topback-lat; ?>','<?php echo $topback-long; ?>'); // Define Map options var child_myOptions = { 'zoom': 14, 'center': child_center, 'mapTypeId': google.maps.MapTypeId.ROADMAP, 'scrollwheel': false }; // Load Map child_map = new google.maps.Map(document.getElementById('job_map_back'), child_myOptions); // Marker child_marker = new google.maps.Marker({ position: center, map: map, title: "<?php echo $title; ?>" }); } // Slide Toggle child_initMap(); jQuery('#job_map_back').ready(function(){ google.maps.event.trigger(child_map, 'resize'); child_map.setCenter(child_center); }); }); })(jQuery); /* ]]> */ </script>
There are currently 1 users browsing this thread. (0 members and 1 guests)