Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script
- src="http://maps.googleapis.com/maps/api/js">
- </script>
- <script>
- var myCenter=new google.maps.LatLng(Math.random()*89.0000,Math.random()*1119.0000);
- function initialize()
- {
- var mapProp = {
- center: myCenter,
- zoom:5,
- mapTypeId: google.maps.MapTypeId.HYBRID
- };
- var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
- var marker = new google.maps.Marker({
- position: myCenter,
- title:'Click to zoom'
- });
- marker.setMap(map);
- google.maps.event.addListener(marker,'click',function() {
- map.setZoom(15);
- map.setCenter(marker.getPosition());
- });
- google.maps.event.addListener(marker,'dblclick',function() {
- map.setZoom(5);
- map.setCenter(marker.getPosition());
- });
- }
- google.maps.event.addDomListener(window, 'load', initialize);
- </script>
- </head>
- <body>
- <div id="googleMap" style="width:500px;height:380px;"></div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment