I am trying to check some geolocation codes on my computer, but I canβt even run the examples. Although they work fine with the documentation site, when I try to open an html file from my computer, I get a blank page, all I do is try to detect my position ...
Here is the code:
<!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="UTF-8"> <link href="/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script> <script type="text/javascript"> var map; function initialize() { var myOptions = { zoom: 6, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); </script> </head> <body> <div id="map_canvas"></div> </body> </html>
Please help, can you find out what I'm doing wrong?
source share