Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get the description inside the popup when i click on marker in a map
    primarykey
    data
    text
    <p>I have 2 tables and i have mentioned the fields of it, 1. events:event_id,title,location,latitude,longitude,address,description,link 2. event_time:event_id,start_time,end_time,start_date,end_date,date</p> <p>i have given the my map code below in that i am trying to get the popup when the particular marker is clicked on the map.when i click on the marker it displays the popup and in popup we retrieve the table datas. The problem what i have is, i am able to get all the data from database other than description. but when i try to retrieve description the map wont be shown. the way data is retrieved from the database is also given below in the code. </p> <pre><code>&lt;script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt;&lt;script language="javascript"&gt; 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 markersArray = []; 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: 500, }); 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() { currentPopup.close(); currentPopup = null; }); } function initMap() { map = new google.maps.Map(document.getElementById("map1"), { center: new google.maps.LatLng(12.972352762582736,77.59734949737549), zoom:60, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR }, navigationControl: true, navigationControlOptions: { style: google.maps.NavigationControlStyle.SMALL } }); &lt;? $query=mysql_query("select * from events join event_time on (events.event_id=event_time.event_id) where events.isapproved='Y'"); while ($row = mysql_fetch_array($query)) { $title=$row['title']; $location=$row['location']; $sdate=$row['start_date']; $edate=$row['end_date']; $stime=$row['start_time']; $end_time=$row['end_time']; $lat=$row['latitude']; $lon=$row['longitude']; $address=$row['address']; $date=$row['date']; $de=$row['description']; $link=$row['link']; echo ("addMarker($lat,$lon,'$stime ".to."$end_time&lt;br/&gt;&lt;br/&gt;&lt;b&gt;$title&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;$address&lt;br/&gt;&lt;br/&gt;$de&lt;br/&gt;&lt;a&gt;$link&lt;/a&gt;');\n"); } ?&gt; center = bounds.getCenter(); map.fitBounds(bounds); } &lt;/script&gt; </code></pre> <p>the map code and retriveing data and displaying it are together. if anyone knows it,please help me solve this problem.thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload