Hello, this is my first post here, i hope it won't be ennoying.
I apology for my poor English, i'll try to explain as good as I can my
problem.

Context: I need to create an interactive map for a fairtrade
association, which allow them to add points on the maps thanks to php/
mysql database system, and then to display custom points on the map
about their activities. (e.g : someone who sell vegetables won't have
the same icon than someone who sell meat...)

I didn't get a lot of problems until I tried to use custom icons; I
mean, I've been able to generate the map with MySQL requests etc , but
when I tried to add custom markers, no points were on the map.

If you want to have a look , it's here :
http://www.fiedos-julien.fr/PTUT_ADEL_googlemaps/administration.php

Here are a few lines of my source code :

------------

function marqueurdetype (domaine) {

                        if(domaine==1)
                        {
                        var Icon = new GIcon(G_DEFAULT_ICON);
                        Icon.image = 
"http://www.fiedos-julien.fr/PTUT_ADEL_googlemaps/
icons/bluenewicon.png";
                        Icon.iconSize = new GSize(32,32);
                        markerOptions = { icon:Icon };
                        return markerOptions;
                        }
                        if(domaine==2)
                        {
                        .........}
}

<?php
$link = mysql_connect(*********) or die("Could not connect: " .
mysql_error());
mysql_selectdb(********,$link) or die ("Can\'t use dbmapserver : " .
mysql_error());
$m_o_compteur=0;
$result = mysql_query("SELECT * FROM info_prod WHERE active=\"true\"",
$link);
while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
$domaines=mysql_query("SELECT DISTINCT * FROM domaine_prod  NATURAL
JOIN liaison_domaine_prod WHERE id_prod='".$row['id_prod']."'",$link);
while($row2 = mysql_fetch_array($domaines,MYSQL_ASSOC)){
                if($row2['id_domaine']==1)
        {
                echo "function markeroption1 (point,number){\n";
                echo "var marker = new GMarker(point, marqueurdetype(".$row2
['id_domaine']."));\n";
                echo "var html = number;\n";
                echo "GEvent.addListener(marker, \"click\", function()
{marker.openInfoWindowHtml(html);});\n";
                echo "return marker;\n}\n";
        }
              if($row2['id_domaine']==2)
        {
.............I spare you the lines.......}

?>

<?php
 while($row = mysql_fetch_array($result))
  {
                $domaines=mysql_query("SELECT DISTINCT * FROM domaine_prod  
NATURAL
JOIN liaison_domaine_prod WHERE id_prod='".$row['id_prod']."'",$link);
                while($row2 = mysql_fetch_array($domaines)){
                echo "point = new GLatLng(" . $row['latitude_prod'] . "," . $row
['longitude_prod'] . ");\n";
                echo "marker =";

                if($row2['id_domaine']==1){
                echo " markeroption1";
                }
                ..............................................
                if($row2['id_domaine']==6){
                echo " markeroption6";
                }
                echo "(point, '<span id=\"nomaffaire\">".addslashes($row
['Nom_affaire'])."</span> <br /><span id=\"donnees
\"><table><tr><td>Nom : </td><td>".addslashes($row['nom_prod'])."</
td></tr><tr><td>Prénom : </td><td>".addslashes($row['prenom_prod'])."</
td></tr><tr><td>Adresse : </td><td>".addslashes($row
['adresse_prod'])."</td></tr><tr><td>Description : </
td><td>".addslashes($row['description_prod'])."</td></tr><tr><td>Site-
Web : </td><td>".addslashes($row['siteweb_prod'])."</td></
tr><tr><td>Domaines :</td><td><ul>";

                echo "<li>".$row2['domaine']."</li>";
                echo "</ul></td></span></table>');\n";
                echo "map.addOverlay(marker);\n";
        }
 echo "\n";
}

?>

-------------------

Note that i'm quite sure that my programming style is clumsy and that
I could have optimised it...
But for the moment the only thing that matters (for me) is to find an
issue.

The problem happens both on Firefox and IE7.0, and firebug "say" no
errors.

Thanks a lot to those who read all that i posted, and thanks (I hope)
for your future answers.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to