Click here to Skip to main content
15,397,224 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
Im working google maps in asp.net application my taks i need to display multiple marks in Google Map with given input. I have Wire the code as given bellow.
My code is executing with out showing any errors by Showing is not loading properly
is showing in Gray color as given link
Dropbox - 6-12-2016 11-38-16 AM.png[^]

What I have tried:

HTML
<div id="dvMap" style="width: 100%; height: 50%; removed:absolute"></div

JavaScript
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
   <script type="text/javascript">
       function DataBind(rowsString) {
           var markers = [];
           for (i = 0; i < rowsString.length; i++) {
               markers[i] = [rowsString[i].Name, rowsString[i].Lat, rowsString[i].Lon, rowsString[i].No];
           }
           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("dvMap"), mapOptions);
           debugger;
           for (i = 0; i < markers.length; i++) {
               var data = markers[i];
               var myLatlng = new google.maps.LatLng(data[1], data[2]);
               var marker = new google.maps.Marker({
                   position: myLatlng,
                   map: map,
                   title: data[0]
               });
               marker.setMap(map);
               (function (marker, data) {
                   google.maps.event.addListener(marker, "click", function (e) {
                       infoWindow.setContent(data[3]);
                       infoWindow.open(map, marker);
                   })
               })(marker, data);
           }
       }
   </script>
Posted
Updated 11-Jun-16 20:15pm
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900