asp.net - Google MAPS API: Marker icons are shown in development but is missing when published -
i trying show location of different teams on map. teams positions obtained databases. app runs 100% in development (visual studio). publish app, markers not displayed on map. think missing in javascript. icon images links full web addresses. if use default icon link outside website, markers displayed during development application published on webserver images disappear.
after run in development, following error message displayed: "exception thrown @ line 119, column 78 in http://maps.googleapis.com/maps/api/js?key=aizasyccojqmidlvnqj5znoxwr0jgtduvvum988" tells me there must wrong javascript.
the code:
<%@ page title="field team data display" language="c#" autoeventwireup="true" codefile="fieldteamdatadisplay.aspx.cs" inherits="fieldteamdatadisplay" %> <!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 runat="server"> <title>field team data display</title> </head> <body> <form id="form1" runat="server"> <%-- <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>--%> <%-- <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>--%> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=aizasyccojqmidlvnqj5znoxwr0jgtduvvum988&sensor=false"></script> <script type="text/javascript"> var markers = [ <asp:repeater id="rptmarkers" runat="server"> <itemtemplate> { "title": '<%# eval("name") %>', "lat": '<%# eval("latitude") %>', "lng": '<%# eval("longitude") %>', "description": '<%# eval("description") %>', "image" : '<%# eval("icon") %>' } </itemtemplate> <separatortemplate> , </separatortemplate> </asp:repeater > ]; </script> <script type="text/javascript"> window.onload = function () { var mapoptions = { center: new google.maps.latlng(-25.799065, 27.931349), zoom: 15, 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 myimage = data.image; var marker = new google.maps.marker({ position: mylatlng, map: map, title: data.title, draggable: true, icon: data.image }); (function (marker, data) { google.maps.event.adddomlistener(marker, "click", function (e) { infowindow.setcontent(data.description); infowindow.open(map, marker); }); })(marker, data); } } </script> <table><tr><td colspan="2" style="font-family: arial; font-size: 9pt; text-align: center; background-color: #c0c0c0;"> emergency exercise: <asp:checkbox id="chkexcercise" runat="server" autopostback="true" checked="true" /> (if click - exercise) emergency classification: <asp:label id="lblemergencyclassification" runat="server" font-bold="true" forecolor="#0066ff"></asp:label> ; type of emergency: <asp:label id="lbltypeofemergency" runat="server" font-bold="true" forecolor="#0066ff"></asp:label> ;facility: <asp:label id="lblfacility" runat="server" font-bold="true" forecolor="#0066ff"></asp:label> emergency start date&time: <asp:label id="lblstartdatetime" runat="server" text="label" font-bold="true" forecolor="#0066ff"></asp:label> </td></tr></table> <%-- <div id="dvmap" style="width: 1200px; height: 600px">--%> <div id="dvmap"> </div> <div> <asp:gridview id="gridviewdetails" runat="server"> </asp:gridview> </div> </form> </body> </html>
wiki
Comments
Post a Comment