Finally I've managed to solve my problem. I edited the code a little and everything is now working fine.
The final code I'm using is listed below. Hopefully it'll help someone else out.
Code:
<?php
// Zen Cart Google Mapinator
// (k) Graham Bevins (Snorkpants)
// (c) 2006 Phoenix Web Development
// Email: [email protected]
// Version 0.1a
/*
This is my first solo contrib. I hope you like it and find use for it
*/
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
?>
<?php
function nl2brStrict($text, $replacement = '<br />')
{
return preg_replace("((\r\n)+)", trim($replacement), $text);
}
?>
<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo nl2brStrict(GOOGLEMAP_KEY);?>"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function GoogleMapLoad()
{
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(<?php echo nl2brStrict(GOOGLEMAP_LAT);?>, <?php echo nl2brStrict(GOOGLEMAP_LNG);?>), <?php echo nl2brStrict(GOOGLEMAP_ZOOM);?>);
map.addControl(new GMapTypeControl());
map.addControl(new GSmallMapControl());
var point = new GLatLng(<?php echo nl2brStrict(GOOGLEMAP_LAT);?>, <?php echo nl2brStrict(GOOGLEMAP_LNG);?>);
var infoTabs = [
new GInfoWindowTab("Address", "<?php echo nl2brStrict(STORE_NAME_ADDRESS);?>"),
new GInfoWindowTab("Telephone", "<?php echo nl2brStrict(STORE_TELEPHONE);?>")
];
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() { marker.openInfoWindowTabsHtml(infoTabs);});
map.addOverlay(marker);
marker.openInfoWindowTabsHtml(infoTabs);
}
}
//]]>
</script>
Bookmarks