adding multiples markers to google map from a mysql database

adding multiples markers to google map from a mysql database

hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes are strored in table called appreciation in a mysql database. i followed sevrel tutoriels including this one : http://tips4php.net/2010/10/use-php-...g-data-on-map/

the problem is that i only get the map without the markers. please help

and here is the code adapted to my database :

           <?
              $dbname            ='survey'; //Name of the database
              $dbuser            ='root'; //Username for the db
              $dbpass            =''; //Password for the db
              $dbserver          ='localhost'; //Name of the mysql server

              $dbcnx = mysql_connect ("$dbserver", "$dbuser", "$dbpass");
                 mysql_select_db("$dbname") or die(mysql_error());
            ?>
            <?
               $query = mysql_query("SELECT * FROM appreciation");
       while ($row = mysql_fetch_array($query)){
       $name=$row['idAppreciation'];
       $lat=$row['latitude'];
       $lon=$row['longitude'];
       $desc=$row['zone'];
       echo "addMarker($lat, $lon,'<b>$name</b><br/>$desc');";
      }
      ?>

              <html>
              <head>
                 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
              <title>Google Map API V3 with markers</title>
                <style type="text/css">
                body { font: normal 10pt Helvetica, Arial; }
             #map { width: 350px; height: 300px; border: 0px; padding: 0px; }
                </style>
              <script src="http://maps.google.com/maps/api/js?v=3&sensor=false"                type="text/javascript"></script>
               <script type="text/javascript">
              //Sample code written by August Li
                var icon = new      google.maps.MarkerImage("http://maps.google.com/mapfiles/ms/micons/blue.png",
             new google.maps.Size(32, 32), new google.maps.Point(0, 0),
             new google.maps.Point(16, 32));
             var center = null;
             var map = null;
             var currentPopup;
             var bounds = new google.maps.LatLngBounds();
             function addMarker(lat, lng, info) {
             var pt = new google.maps.LatLng(lat, lng);
             bounds.extend(pt);
             var marker = new google.maps.Marker({
             position: pt,
             icon: icon,
             map: map
               });
              var popup = new google.maps.InfoWindow({
             content: info,
             maxWidth: 300
             });
            google.maps.event.addListener(marker, "click", function() {
           if (currentPopup != null) {
           currentPopup.close();
           currentPopup = null;
           }
        popup.open(map, marker);
        currentPopup = popup;
             });
          google.maps.event.addListener(popup, "closeclick", function() {
               map.panTo(center);
             currentPopup = null;
             });
            }
             function initMap() {
             map = new google.maps.Map(document.getElementById("map"), {
             center: new google.maps.LatLng(0, 0),
             zoom: 14,
             mapTypeId: google.maps.MapTypeId.ROADMAP,
             mapTypeControl: false,
             mapTypeControlOptions: {
             style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
             },
             navigationControl: true,
             navigationControlOptions: {
             style: google.maps.NavigationControlStyle.SMALL
             }
             });


              center = bounds.getCenter();
               map.fitBounds(bounds);

               }

              </script>
              </head>
           <body onload="initMap()" style="margin:0px; border:0px; padding:0px;">
              <div id="map"></div>
            </html>
View Answers









Related Tutorials/Questions & Answers:
adding multiples markers to google map from a mysql database
adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes are strored in table called appreciation in a mysql database. i followed sevrel
adding multiples markers to google map from a mysql database
adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes are strored in table called appreciation in a mysql database. i followed sevrel
Advertisements
adding multiples markers to google map from a mysql database
adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes are strored in table called appreciation in a mysql database. i followed sevrel
adding multiples markers to google map from a mysql database
adding multiples markers to google map from a mysql database   hello, i am trying to add markers to my googlemaps map. the latitudes and longitudes are strored in table called appreciation in a mysql database. i followed sevrel
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  how to send data from mysql database to google chart api using java
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  Äîáîâëÿéòåñü â ãðóïïó "ÌÀÉÍÊÐÀÔÒÀ" Áóäüòå ó÷àñòíèêàìè Ãðóïïû Ïîìîãàèòå íàì è ñåáå Íàøà ãðóïïà https://vk.com/club60851464 Åñòü ñâîé ñåðâåð! Õîðîøàÿ àòìîñôåðà
how to refresh google map using ajax by fetching lat long from database
how to refresh google map using ajax by fetching lat long from database ... the route travelled by it will be displayed on the google map by fetching the lat long from db. Now, i need to refresh the map using ajax.Pls help me how to do
retrieve data from mysql database
retrieve data from mysql database  hi am not familiar in php.....even... selected value on combobox which is to be retrieve the relevant data from mysql database using php.... below my code is that.. <html> <head>
Repairing mysql database from command line
Repairing mysql database from command line  Hi, Can anyone tell me the process for repairing mysql database from command line? Thanks
Data retrieve from mysql database
Data retrieve from mysql database  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list... from the dropdown, related data will get displayed on the textboxes. Here we have
How to retrieve image from mysql database in JSP?
How to retrieve image from mysql database in JSP?  Hi, I need JSP same codes for learning to get image which is stored in MySQL Database. How to retrieve image from mysql database in JSP? Thanks   Hi, You can write
How to access (MySQL)database from J2ME?
How to access (MySQL)database from J2ME?  I am new to J2ME. I am using NetBeans. Can anyone help me? How to access (MySQL)database from J2ME? ( I search a lot I found that there is need to access database through servlet
retrieve data from mysql database and store it in a variable ?
retrieve data from mysql database and store it in a variable ?  sir... that retrieve the integer values from the database and stored in the integer... which is stored in mysql. so to apply some arithmetic operation on it we have
google map with jsf - Java Server Faces Questions
google map with jsf  hi, i am using jsf with googlemap.i load... values(latlong) to googlemap from jsf bean values.i want to show mutiple markers from database values.could u help me. thanks, Regards, krishnaraj
MySql Databse query to fetch results from database
MySql Databse query to fetch results from database  Hi. I have a field in database named stages. its datatype is varchar(60). It contains values chennai,trichy,kanchipuram for a single record. I have to retrieve these data from
Google Map Integration - Ajax
Google Map Integration  Hi All, I am working on a vehicle tracking system project. I have to read data from sql server database and map the vehicle position in google map. I need to use ajax as the data is updated in every
problem in selecting second arraylist from mysql database
problem in selecting second arraylist from mysql database  Hi... in mysql database. In the below program , i have hard-coded that second list, but i want second list to be dynamic from database. Please, help me out. Thank
image is display from path of mysql database
image is display from path of mysql database  <%@ page import="java.io.,java.sql.,java.util.zip.*" %> <% String saveFile=""; String...;% Connection connection = null; String connectionURL = "jdbc:mysql://localhost
Map java Object to database.
Map java Object to database.  How do you map Java Objects with Database tables
how to create a php script to download file from database mysql
how to create a php script to download file from database mysql  how to create a php script to download file from databse mysql
how to create a php script to download file from database mysql
how to create a php script to download file from database mysql  how to create a php script to download file from databse mysql
how to store JTree data hierarchically in mysql database from netbeans
how to store JTree data hierarchically in mysql database from netbeans  how to store JTree data hierarchically in mysql database from netbeans. I am new to this topics so I need a program and tables you are using in database
about google map
about google map  how to add google map in website
about google map
about google map  how to add google map in website
How to retrive a particular record from database in php with mysql?
How to retrive a particular record from database in php with mysql?  Am using phpMyAdmin Database.In mysql database having 10 records. The field... record based on username and password. I dont know how to retrive in php with mysql
how to display image and text in single jsp page from the mysql database
how to display image and text in single jsp page from the mysql database  hello please help me to display the image and text in single jsp page from mysql database if have any reference code please send me Thanks in advance
simple code to login user & authenticate it from database mysql
simple code to login user & authenticate it from database mysql  Sir, I am creating a login page which contain userid & password. Iwant to authenticate user from mysql database. please tell me the code for it. Thanks
retrieve related data from database using jsp and mysql
retrieve related data from database using jsp and mysql  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list. if we change a value in a dropdown its related value must
retrive the employee details with image from mysql database using jsp servlet
retrive the employee details with image from mysql database using jsp servlet  im doing the web project to retrive the employee profile which i stored in the database using jsp servlet then want to show the result in the next jsp
Data needs to be gathered in XML file from the database (MySql) using JSP
Data needs to be gathered in XML file from the database (MySql) using JSP ... data regarding particular id from the database table. Data needs to be gathered in XML file from the database (MySql) using appropriate JSP/Java Bean functions
dynamic retrivel of data from mysql database in table format at jsp
dynamic retrivel of data from mysql database in table format at jsp  ... the data from database and display it as table format in jsp... For example, i have... of A1 should be retrived from database and display it in the respective textbox
MySql Databse query to fetch results from database and display it in HTML File
MySql Databse query to fetch results from database and display it in HTML File  Hi. I have a field in database named stages. its datatype is varchar... to retrieve these data from the field table. Actually they are separated by comma
add google map javascript
add google map javascript  How can i add google map using javascript in my web page?   Search for the " Google Maps Javascript API" it will allow you to embed the Google Map into your web Page
how to retrive the particular data from database in php with mysql?
how to retrive the particular data from database in php with mysql?  ..._db("samp", $con); $Name=$_POST['unames']; $data=mysql_query("SELECT * FROM tbl... like this.. <?php $con = mysql_connect("localhost","root
Retrieve image from mysql database through jsp
Retrieve image from mysql database through jsp... to retrieve image from mysql database through jsp code. First create a database... Note : In the jsp code given below, image will be retrieved from database
Video Tutorial: How to access MySQL database from JSP?
How to access MySQL database from JSP? In this tutorial,I will teach you how to access data from JSP page. We are using MySQL database and we have a table... to access MySQL database from JSP?": So, we have pasted it here
JDBC Video tutorial - How to read Data from MySQL Database?
JDBC Beginners tutorial for reading the data from MySQL database - RoseIndia.Net In this tutorial you will learn the code to read the data from the MySQL..._TO_REPLACE_1 Steps for reading the data from MySQL database in a Java program
ApplicationDevelopment Using Google Map
ApplicationDevelopment Using Google Map  I want application using google map please guide me how can i develop
dynamic retrival of data from mysql database to dropdownlist in jsp
dynamic retrival of data from mysql database to dropdownlist in jsp  Hello, Am having problem in my project... i want to retrive the data from mysql... name from the mysql database to the dropdownlist.if the user select the particular
Retrieve date from MYSQL database
Retrieve date from MYSQL database In this tutorial, you will learn how to retrieve date from database. Storing and Retrieving dates from the database is a common task. MYSQL provides different ways of inserting and fetching dates from
MYSQL Database
MYSQL Database  Can any one brief me about how to use MYSQL Database to store the create new database, create tables. Thanks.   Hi, the MySQL database server is most popular database server and if you want to know
how to upload an image from a jsp page to a mysql database table using jsp
how to upload an image from a jsp page to a mysql database table using jsp  how to upload an image from a jsp page to a mysql database table using jspstrong text
how to retrieve image from mysql database using java and show it in HTML img tag ?
how to retrieve image from mysql database using java and show it in HTML img tag ?  how to retrieve image from mysql database using java and show it in HTML img tag
how to fetch data from mysql database table and draw a bar chart on that data using in jsp
how to fetch data from mysql database table and draw a bar chart on that data using in jsp  how to create bar chart fetch data from mysql database using in jsp.please give me a right code. yhanks in advance
Map Java Objects with Database tables
Map Java Objects with Database tables  How to map Java Objects with Database tables?   First write Java domain objects ie. beans with setter and getter methods. Then map java class to table and database columns to Java
update mysql database
update mysql database  update mysql database
JavaScript google map API example.
JavaScript google map API example.  How to Use Google Maps API in JavaScript?   Google Maps- A map is a way of representation of your route... routes, a road map shows you road, street information. In the same way google map
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript
that is retrieved from MySQL DB using jsp,jstl,javascript  when click on the next button/link then it must display next 10 record from database and same for previous to display previous 10records. Database Query like this: Select * from table
to make a google map point to user defined location
to make a google map point to user defined location  Hi, i wish to develop an google map,that takes the input from a form(city,area &Country... button, the form should be submitted and then the google map should display
adding data to the database with the use of jtable - Java Beginners
adding data to the database with the use of jtable  how can i add data to the database with the use of jtable. and also can able to view the records in the database in the table.. tnx :G

Ads