abkaplan1
abkaplan1

Reputation: 1

Google Map says undefined google while it is on aspx page

When I test it on simple html file (out of the project - locally) it works but when I use this code in my project on aspx page it can not find "google". How can I fix it? Here is the code I use :

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Map</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">    html { height: 100% }    body { height: 100%; margin: 0px; 

padding: 0px }    #map_canvas { height: 100% }  </style>

<script type="text/javascript" src="http:\\maps.google.com/maps/api/js?sensor=false">  

</script>

<script type="text/javascript">
    function initialize() {
        var latlng = new google.maps.LatLng(-34.397, 150.644);
        var myOptions = {
            zoom: 8, center: latlng, mapTypeId:

google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),

myOptions);
    }
   </script>

</head>
<body onload="initialize()">
<div id="map_canvas" style="width: 100%; height: 100%">
</div>
</body>
</html>

Upvotes: 0

Views: 983

Answers (1)

James Johnson
James Johnson

Reputation: 46067

Change http:\\ to http:// in your script tag.

Upvotes: 1

Related Questions