Roman0002 Posted October 25, 2014 Share Posted October 25, 2014 Hi, I would like to add supplier position on google map on product page to description. I've copy this code to product.tpl but it does not work: <script type="text/javascript"> var geocoder = new google.maps.Geocoder(); var delivery_map; $(document).ready(function() { $(".textarea-autosize").autosize(); geocoder.geocode({ address: '{$supplier_address->address1},{$supplier_address->postcode},{$supplier_address->city},{$supplier_address->country}' }, function(results, status) { if (status === google.maps.GeocoderStatus.OK) { delivery_map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP, center: results[0].geometry.location }); var delivery_marker = new google.maps.Marker({ map: delivery_map, position: results[0].geometry.location, url: 'http://maps.google.com?q={$supplier_address->address1|urlencode},{$supplier_address->postcode|urlencode},{$supplier_address->city|urlencode},{$supplier_address->country|urlencode}' }); google.maps.event.addListener(delivery_marker, 'click', function() { window.open(delivery_marker.url); }); } } var date = new Date(); var hours = date.getHours(); if (hours < 10) hours = "0" + hours; var mins = date.getMinutes(); if (mins < 10) mins = "0" + mins; var secs = date.getSeconds(); if (secs < 10) secs = "0" + secs; $('.datepicker').datetimepicker({ prevText: '', nextText: '', dateFormat: 'yy-mm-dd ' + hours + ':' + mins + ':' + secs }); }); // Fix wrong maps center when map is hidden $('#tabAddresses').click(function(){ x = delivery_map.getZoom(); c = delivery_map.getCenter(); google.maps.event.trigger(delivery_map, 'resize'); delivery_map.setZoom(x); delivery_map.setCenter©; x = invoice_map.getZoom(); c = invoice_map.getCenter(); google.maps.event.trigger(invoice_map, 'resize'); invoice_map.setZoom(x); invoice_map.setCenter©; }); </script> Please help me For help and answers thank you in advance Link to comment Share on other sites More sharing options...
Roman0002 Posted October 27, 2014 Author Share Posted October 27, 2014 Hi, Help me with this anyone? Pls... Link to comment Share on other sites More sharing options...
sam4444 Posted June 23, 2015 Share Posted June 23, 2015 Hello, Have you had an issue ? I 'm interrested by it if you have it Sam Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now