javascript - Google Map not being displayed and browser console shows error "GUnload is not defined at onload" though I've mentioned it -
basically i'm trying show multiple places on google map using lat, lon getting fetched database. here code google map.
<%@ page language="c#" autoeventwireup="true" codebehind="map.aspx.cs" inherits="googlemap.map" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="head1" runat="server"> <style> #map { height: 600px; width: 100%; } </style> <title>your data on google map </title> <link rel="icon" href="data:;base64,ivborwokggo=" /> </head> <body onload="initialize()" onunload="gunload()"> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=aizasybiedoq1nt_j6lqm3qnnzgxpbqpawl_4y4"></script> <div style="height:600px; width:100%;"> <div id="dvmap"></div> </div> <script type="text/javascript"> var markers = [ <asp:repeater id="rptmarkers" runat="server"> <itemtemplate> { "title": '<%# eval("location_no") %>', "lat": '<%# eval("latitude") %>', "lng": '<%# eval("longitude") %>' } </itemtemplate> <separatortemplate> , </separatortemplate> </asp:repeater> ]; </script> <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("dvmap"), mapoptions); (i = 0; < markers.length; i++) { var data = markers[i] var mylatlng = new google.maps.latlng(data.lat, 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) { infowindow.setcontent(data.description); infowindow.open(map, marker); }); })(marker, data); } } </script> </body> </html>
and when run program there blank page no error on console. when refresh page error on console mentioned in question. can here? thank in advance.
Comments
Post a Comment