Being a novice in ASP, I recently started working on a small project and could use some guidance. I am looking to create an ASP page that retrieves latitudes and longitudes from a database and uses them to place markers on a map. Below is a snippet of my current code:
function initialize() {
// Map initialization
var latlng = new google.maps.LatLng(-25.363882, 131.044922);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
// Custom image definition
var image = 'Computer.GIF';
// Retrieve data from database
<%
conn = Server.CreateObject("ADODB.Connection");
conn.Provider = "Microsoft.Jet.OLEDB.4.0";
conn.Open("c:/webdata/dbATMManager999.mdb");
rs = conn.execute("select * from ATM WHERE LATITUDE IS NOT NULL AND LONGITUDE IS NOT NULL");
while (!rs.eof) {
%>
var currLatLng = new google.maps.LatLng(<%rs.Fields("LATITUDE");%>, <%rs.Fields("LONGITUDE");%>);
var customMarker = new google.maps.Marker({
position: currLatLng,
map: map,
icon: image
});
<%
rs.movenext();
...
The line causing an issue is: new google.maps.LatLng(<%rs.Fields("LATITUDE");%>, <%rs.Fields("LONGITUDE");%>); I am consistently encountering a runtime error: "Microsoft JScript runtime error: Wrong number of arguments or invalid property assignment."