X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Google Geopoint map API (https://forum.x-cart.com/showthread.php?t=18902)

golfguy 12-28-2005 06:01 AM

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?

balinor 12-28-2005 06:20 AM

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.

golfguy 12-28-2005 06:46 AM

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.

???

Warwick 09-01-2007 05:12 AM

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?

Warwick 09-12-2007 07:06 AM

Re: Google Geopoint map API
 
Anybody who has done something simular?


All times are GMT -8. The time now is 07:31 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.