Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Google Geopoint map API

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-28-2005, 06:01 AM
 
golfguy golfguy is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Omaha,NE
Posts: 108
 

Default Google Geopoint map API

Has anyone got the Google map generator to work with Smarty?

I'm trying to add a map to every product (really businesses) and planned on storing the longitude and latitude in the Products table.

my problem is I'm not a javascript programmer, and I can't get it to work on a smarty page (so I can use Smarty variables for Long & Lat)

I've tried enclosing it in {literal} tags and it doesn't work.

to see the stand alone version http://www.omaha-restaurants.com/page_001.html

Here is the code minus my API id
Code:
<html> <head> <script src="http://maps.google.com/maps?file=api&v=1&key=Myappid" type="text/javascript"></script> </head> <body> <div id="map" style="width: 400px; height: 400px" align="center"></div> <script type="text/javascript"> //<![CDATA[ function createMarker(point,html) { // FF 1.5 fix html = '<div style="white-space:nowrap;">' + html + '</div>'; var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } var map = new GMap(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.centerAndZoom(new GPoint(-95.930297 , 41.255498 ), 1); var point = new GPoint(-95.930297 , 41.255498); var marker = createMarker(point,'Believers Bible Chapel') map.addOverlay(marker); //]]> </script> </body> </html>

Can anyone help?
__________________
Version 4.2.3
Reply With Quote
  #2  
Old 12-28-2005, 06:20 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Well, you would need to store the <head> portion in home.tpl, and then the rest of it would go on whatever page you wanted it to display on. Yes, you will need to enclose the script with {literal} tags.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 12-28-2005, 06:46 AM
 
golfguy golfguy is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Omaha,NE
Posts: 108
 

Default

I tried that using a static page for a test page http://www.omaha-restaurants.com/pages.php?pageid=7 and get an error that the page can't be opened.

???
__________________
Version 4.2.3
Reply With Quote
  #4  
Old 09-01-2007, 05:12 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Google Geopoint map API

golfguy, I see that you have integrated Google Maps under a tab at the product details (example: http://www.omaha-restaurants.com/Long-John-Silvers-p-447.html -> click tab 'Map') pages; can you shed some light on how this is done and is this Google Map information also saved in the X-Cart backoffice or?
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #5  
Old 09-12-2007, 07:06 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Google Geopoint map API

Anybody who has done something simular?
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:43 PM.

   

 
X-Cart forums © 2001-2020