Código
<html> <head> <meta name="viewport" content="initial-scale=1.0, user-scaleble=no"> <meta charset="utf-8"> <style > #map-canvas{ height: 380px; width: 300px; margin: :0px; padding: 0px; background-color: #000; } </style> <script> alert("lslslsl"); var map; var marker; function initialize(){ var mapOptions={ zoom:15; }; map=new google.maps.Map(document.getElementById('map-canvas'),mapOptions); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position){ var pos=new google.maps.LatLng(position.coords.latitude,position.coords.longitude) var goldStar={ path:google.maps.SymbolPath.CIRCLE, strokeColor:'#276ED0', fillColor:'#276ED0', fillOpacity:.9, strokeWeight:1, scale:6, }; var marker=new google.maps.Marker({ position:pos, icon:goldStar, draggable:true, animation:google.maps.Animation.DROP, map:map, }); map.setCenter(pos); },function(){ handleNoGeolocation(true); }); }else{ handleNoGeolocation(false); } } function animar(){ navigator.geolocation.getCurrentPosition(function(position) { var pos =new google.maps.LatLng(position.coords.latitude, position.coords.longitude); map.panTo(pos); var goldStar={ path:google.maps.SymbolPath.CIRCLE, strokeColor:'#FF4E51', fillColor:'#FF4E51', fillOpacity:.9, strokeWeight:1, scale:5, }; var marker=new google.maps.Marker({ position:pos, icon:goldStar, draggable:true, map:map, }); var option={ map:map, position:pos, }; send(position.coords.latitude+","+position.coords.longitude); map.setCenter(options.position); }); } function handleNoGeolocation(errorFlag){ if (errorFlag) { var content='Error:the service'; }else{ var content="tu buscador"; } var options={ map=map, position:new google.maps.LatLng(60,105), content:content, }; var infowindow=new google.maps.infoWindow(options); map.setCenter(options.position); } google.maps.event.addDomListener(window,'load',initialize); setTimeout(function(){animar()},5000); function pocision(pos){ } </script> </head> <body> <div id="map-canvas"> </div> </body> </html>