I am setting up a Google map and after finding this excellent php script, I am using the phpGoogleMaps because my website is all php. So far, so good. However, I would like to be able to pull the latitude, longitude and marker text from information stored in MySQL.
Here is what I have so far. The latitude and longitude variable appear to be working ok, but I cannot get the marker text to display from the variable. How do I get round this problem?
<?
$frogmarkertext = "The apartment is situated here.<br /> We hope that you will enjoy your stay.";
$froglat = "-8.6692";
$froglong = "37.1120";
include_once("GMap.php");
$gmap = new GMap('My Google Key is Here',"$froglat","$froglong");
$gmap->addMarker('marker1', new GPoint("$froglat","$froglong"),null,new GEvent('marker1','click','function() { marker1.openInfoWindowHtml(\' how can I use the variable $frogmarkertext here to provide the text \'); }'));
//$gmap->addMarker('marker2', new GPoint('-118.825526','34.150505'),null,new GEvent('marker2','click','function() { marker2.openInfoWindowHtml(\'Some text for p2!! \'); }'));
$gmap->render();
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am setting up a Google map and after finding this excellent php script, I am using the phpGoogleMaps because my website is all php. So far, so good. However, I would like to be able to pull the latitude, longitude and marker text from information stored in MySQL.
Here is what I have so far. The latitude and longitude variable appear to be working ok, but I cannot get the marker text to display from the variable. How do I get round this problem?
<?
$frogmarkertext = "The apartment is situated here.<br /> We hope that you will enjoy your stay.";
$froglat = "-8.6692";
$froglong = "37.1120";
include_once("GMap.php");
$gmap = new GMap('My Google Key is Here',"$froglat","$froglong");
$gmap->addMarker('marker1', new GPoint("$froglat","$froglong"),null,new GEvent('marker1','click','function() { marker1.openInfoWindowHtml(\' how can I use the variable $frogmarkertext here to provide the text \'); }'));
//$gmap->addMarker('marker2', new GPoint('-118.825526','34.150505'),null,new GEvent('marker2','click','function() { marker2.openInfoWindowHtml(\'Some text for p2!! \'); }'));
$gmap->render();
?>