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?