Google Map Marker Possision not showing in marker Info Window

Last Reply on Sep 06, 2016 04:29 AM By dharmendr

Posted on Sep 06, 2016 04:07 AM

Hai I got a google map map marker code in your site,but in my code cant get information in marker possision at run time.i attached my code from here.Please check this

Thank You

 Dim dt As DataTable = Me.GetData("SELECT dbo.tblContainers.ContainerName as ContainerName , dbo.tblContainers.Logitude as Logitude, dbo.tblContainers.Latitude as Latitude,dbo.tblRentContractsDetails.CreatedOn as CreatedOn, dbo.tblRentContractsDetails.CreatedBy as CreatedBy, dbo.tblRentContractsDetails.LocationId as LocationId, dbo.tblRentContractsDetails.StartDate as StartDate, dbo.tblRentContractsDetails.EndDate as EndDate,dbo.tblEmployees.EmpName as EmpName FROM dbo.tblContainers INNER JOIN dbo.tblRentContractsDetails ON dbo.tblContainers.ContainerId = dbo.tblRentContractsDetails.ContainerId INNER JOIN dbo.tblEmployees ON dbo.tblRentContractsDetails.EmpId = dbo.tblEmployees.EmpId INNER JOIN dbo.tblContainerTypes ON dbo.tblContainers.TypeId = dbo.tblContainerTypes.TypeId WHERE dbo.tblContainers.TypeId =" & ddlTypes.SelectedValue)
            rptMarkers.DataSource = dt




<script type="text/javascript">
        var markers = [
        <asp:Repeater ID="rptMarkers" runat="server">
                     "ContainerName": '<%# Eval("ContainerName")%>',
                     "CreatedOn":'<%# Eval("CreatedOn")%>',
                     "CreatedBy":'<%# Eval("CreatedBy")%>',
                     "Location":'<%# Eval("LocationId")%>',
                     "StartDate":'<%# Eval("StartDate")%>',
                     "EndDate":'<%# Eval("EndDate")%>',
                     "EmpName":'<%# Eval("EmpName")%>',
                     "lat": '<%# Eval("Latitude")%>',
                     "lng": '<%# Eval("Logitude")%>',


<script type="text/javascript">
    window.onload = function () {
        var mapOptions = {
            center: new google.maps.LatLng(markers[0].lat, markers[0].lng),
            zoom: 8,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        var infoWindow = new google.maps.InfoWindow();
        var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
        for (i = 0; i < markers.length; i++) {
            var data = markers[i]
            var myLatlng = new google.maps.LatLng(, data.lng);
            var marker = new google.maps.Marker({
                position: myLatlng,
                map: map,
                title: data.title
            (function (marker, data) {
                google.maps.event.addListener(marker, "click", function (e) {
          , marker);
            })(marker, data);


Posted on Sep 06, 2016 04:29 AM
AmArcade says:

Your marker doesn't contain the name description. So What ever you want to show in the info window set those content for infoWindow like below.

(function (marker, data) {
   google.maps.event.addListener(marker, "click", function (e) {
       infoWindow.setContent(data.ContainerName + '<br />' + data.EmpName);, marker);
})(marker, data);