Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.6.5, google map
- This topic has 8 replies, 2 voices, and was last updated 9 years, 2 months ago by
Steven Zahm.
-
AuthorPosts
-
05/19/2017 at 2:54 pm #423543
Mitch Wilson
GuestI was wondering if you could let me know what the php hook or code is to call the Google Map for the Card > card-single.php template page. After setting up the child template (with some customizations), I couldn’t find where the map will be displayed on the page.
Thanks!
Mitch05/22/2017 at 10:38 am #423761Steven Zahm
Keymaster@ Mitch
The Default Card template does not display map. The function name is, but, it also requires a bit of javascript to initiate the HTML output with the Google Maps API. Without it, the function will not appear to display anything. Not sure it’ll help, but here’s the function name:
$entry->getMapBlock();05/22/2017 at 6:22 pm #423809Mitch Wilson
GuestOk thank you. I will see if we can figure it out! :)
05/22/2017 at 7:10 pm #423811Mitch Wilson
GuestSorry, I meant to ask this in my previous reply: Would you be able to provide the necessary JavaScript to initiate the google map for the Default Card template?
Thanks,
Mitch05/23/2017 at 10:04 am #423864Steven Zahm
Keymaster@ Mitch
Here’s the javascript for the Tile Plus template for the map. You’ll need to small mods it to work, but it is pretty much all that’s needed.
jQuery(document).ready(function ($) { $('#cn-tile-plus .cn-category-select.cn-enhanced-select').chosen(); // Render map on single entry page var cnSingleMap = $('#cn-gmap-single').length ? $('#cn-gmap-single') : false; if ( cnSingleMap != false ) { var fLatitude = 0; var fLongitude = 0; var uuid = cnSingleMap.attr('data-gmap-id'); var strAddress = $( '#map-' + uuid ).attr('data-address'); var strMapType = $( '#map-' + uuid ).attr('data-maptype'); var intZoom = parseInt( $( '#map-' + uuid ).attr('data-zoom') ); if ( $('#map-' + uuid ).attr('data-latitude') ) fLatitude = parseFloat( $( '#map-' + uuid ).attr('data-latitude' ) ); if ( $('#map-' + uuid ).attr('data-longitude') ) fLongitude = parseFloat( $( '#map-' + uuid ).attr('data-longitude') ); if ( fLatitude == 0 && fLatitude == 0 ) { $( '#map-' + uuid ).goMap({ markers: [ { address: '\'' + strAddress + '\'' } ] , zoom: intZoom, maptype: strMapType }); } else { $( '#map-' + uuid ).goMap({ markers: [ { latitude: fLatitude , longitude: fLongitude } ] , zoom: intZoom, maptype: strMapType }); } } });05/23/2017 at 12:38 pm #423884Mitch Wilson
GuestOk great! Thanks!
05/25/2017 at 6:09 pm #424157Mitch Wilson
GuestHm, I figured the Javascript would be easier to mod than i thought (figuring i would just have to change the divs being called). However I have not been able to get it to “initialize”. Would you be able to provide an updated version of that JavaScript tailoring it for the Default Card template? Or at least tell me what needs to be updated for it?
Also, we purchased the Template PRO pack as well and are looking forward to testing.
Thanks!
Mitch05/26/2017 at 9:11 am #424191Steven Zahm
Keymaster@ Mitch
I’d have to look, but, I think the only line you would need to change is this one:
var cnSingleMap = $('#cn-gmap-single').length ? $('#cn-gmap-single') : false;You would have to change the id selector
#cn-gmap-single.You should probably remove this line too:
$('#cn-tile-plus .cn-category-select.cn-enhanced-select').chosen();Make sure you keep an eye on the browser’s console so you can see any javascript errors that may be occurring.
05/26/2017 at 9:13 am #424192Steven Zahm
Keymaster@ Mitch
I do offer customization services if your interested. Please use the contact link at the very bottom of the page.
-
AuthorPosts
- You must be logged in to reply to this topic.
