Homepage › Forum › Product Support › Kidzone › EVENTS: Please fix typo in Activities section and fix Maps
- This topic has 1 reply, 2 voices, and was last updated 9 years, 9 months ago by
trinhnv.
-
AuthorPosts
-
9 years, 9 months ago #2256
Hi Please fix the following:
EVENTS:
Typo 'Schelude', should say 'Schedule' in events Activities section.
Map - Even though you can search on the map you still have to enter the longitude and latitude manually to get the map to work correctly?
Thanksd, Dan.
9 years, 9 months ago #2260Hi Dan,
1. 'Schelude' - 'Schedule': Go to {root}/wp-content/themes/yolo-kidzone/single-event.php
about 116 - 118 lines, change to:<div class="panel-heading"> <h3><?php esc_html_e( 'Schelude', 'yolo-kidzone' ); ?></h3> </div>
2.
Go to: {root}/wp-content/themes/yolo-kidzone/includes/framework/meta-boxes/generate-meta-box.php (about 712 - 716 lines), change to:
$yoloEventMap = array( 'latitude' => get_post_meta( get_the_ID(), '_gmap_latitude', true ) ? get_post_meta( get_the_ID(), '_gmap_latitude', true ) : '40.714398', 'longitude' => get_post_meta( get_the_ID(), '_gmap_longitude', true ) ? get_post_meta( get_the_ID(), '_gmap_longitude', true ) : '-74.005279', 'localtion_disable' => false );
Go to: {root}/wp-content/themes/yolo-kidzone/includes/framework/assets/js/yolo_event.js
Replace all this file by the below code:var map; var infowindow; var marker; jQuery('#yolo_event_google_map_search_input').bind('keypress keydown keyup', function(e){ if(e.keyCode == 13) { e.preventDefault(); } }); function map_picker_initialize() { var markers = []; var myPlace = new google.maps.LatLng(yoloEventMap.latitude,yoloEventMap.longitude); map = new google.maps.Map(document.getElementById('yolo_event_google_map'), { flat:false, noClear:false, zoom: 16, scrollwheel: false, draggable: true, center: myPlace, mapTypeId: google.maps.MapTypeId.ROADMAP }); // Create the search box and link it to the UI element. var input = /** @type {HTMLInputElement} */( document.getElementById('yolo_event_google_map_search_input')); map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); var searchBox = new google.maps.places.SearchBox( /** @type {HTMLInputElement} */(input)); google.maps.event.addListener(searchBox, 'places_changed', function() { var places = searchBox.getPlaces(); if (places.length === 0) { return; } for (var i = 0, marker; marker = markers[i]; i++) { marker.setMap(null); } var bounds = new google.maps.LatLngBounds(); for (var i = 0, place; place = places[i]; i++) { placeMarker(place.geometry.location); bounds.extend(place.geometry.location); } map.fitBounds(bounds); }); // [END region_getplaces] var property_location = myPlace; marker = new google.maps.Marker({ position: property_location, map: map, draggable: true }); // // localtion box content_location = ''; localtion_disable = yoloEventMap.localtion_disable; if(!localtion_disable) { content_location = '
Latitude: '+ property_location.lat() + '
Longitude: ' + property_location.lng() + ''; infowindow = new google.maps.InfoWindow({ content: content_location, maxWidth: 300 }); infowindow.open(map,marker); google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); }); } google.maps.event.addListener(marker, 'drag', function() { infowindow.setContent('Latitude: '+ marker.getPosition().lat() + '
Longitude: ' + marker.getPosition().lng()+''); updateMarkerPosition(marker.getPosition()); }); google.maps.event.addListener(marker, 'dragend', function() { updateMarkerPosition(marker.getPosition()); }); } google.maps.event.addDomListener(window, 'load', map_picker_initialize); function placeMarker(location){ infowindow.close(); marker.setPosition(location); localtion_disable = yoloEventMap.localtion_disable; if(localtion_disable) { infowindow.setContent(''); } else { infowindow.setContent('Latitude: '+ location.lat() + '
Longitude: ' + location.lng()+''); } infowindow.open(map,marker); document.getElementById("_gmap_latitude").value=location.lat(); document.getElementById("_gmap_longitude").value=location.lng(); } function updateMarkerPosition(location) { document.getElementById("_gmap_latitude").value=location.lat(); document.getElementById("_gmap_longitude").value=location.lng(); }Save and check your site.
If you have any question, please contact for us.
Thanks!
-
AuthorPosts
You must be logged in and have valid license to reply to this topic.
