tickets
12 years ago
app-shop.php
12 years ago
datepicker.php
12 years ago
event-map.php
12 years ago
event-sidebar-options.php
12 years ago
events-audit-trail.php
12 years ago
events-meta-box.php
12 years ago
no-comments.php
12 years ago
organizer-meta-box.php
12 years ago
recurrence-dialog.php
12 years ago
tribe-options-display.php
12 years ago
tribe-options-general.php
12 years ago
tribe-options-help.php
12 years ago
tribe-options-network.php
12 years ago
venue-meta-box.php
12 years ago
widget-admin-list.php
12 years ago
event-map.php
49 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Inline Google map |
| 4 | */ |
| 5 | |
| 6 | // Don't load directly |
| 7 | if ( !defined('ABSPATH') ) { die('-1'); } |
| 8 | |
| 9 | ?> |
| 10 | <div id="tribe-events-gmap" style="height: <?php echo is_numeric($height) ? "{$height}px" : $height ?>; width: <?php echo is_numeric($width) ? "{$width}px" : $width ?>; margin-bottom: 15px;"></div><!-- #tribe-events-gmap --> |
| 11 | <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> |
| 12 | <script type="text/javascript"> |
| 13 | var event_address; |
| 14 | |
| 15 | function initialize() { |
| 16 | var myOptions = { |
| 17 | zoom: <?php echo tribe_get_option( 'embedGoogleMapsZoom', '10' ); ?>, |
| 18 | center: event_address, |
| 19 | mapTypeId: google.maps.MapTypeId.ROADMAP |
| 20 | }; |
| 21 | |
| 22 | var map = new google.maps.Map(document.getElementById("tribe-events-gmap"), myOptions); |
| 23 | |
| 24 | var marker = new google.maps.Marker( |
| 25 | { |
| 26 | map: map, |
| 27 | title: <?php echo json_encode(tribe_get_venue($postId)) ?>, |
| 28 | position: event_address |
| 29 | } |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | function codeAddress(address) { |
| 34 | var geocoder= new google.maps.Geocoder(); |
| 35 | var address = address || <?php echo json_encode($address) ?>; |
| 36 | geocoder.geocode( |
| 37 | { 'address': address }, |
| 38 | function(results, status) { |
| 39 | if (status == google.maps.GeocoderStatus.OK) { |
| 40 | event_address = results[0].geometry.location |
| 41 | initialize(); |
| 42 | } |
| 43 | } |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | codeAddress(); |
| 48 | </script> |
| 49 |