gmaps.js console

Play with gmaps.js

HTML

<script src="http://maps.google.com/maps/api/js?sensor=true&amp;.js"></script>
<script src="https://rawgit.com/HPNeo/gmaps/master/gmaps.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://apis.google.com/js/platform.js"></script>
<script src="http://maps.google.com/maps/api/js?   libraries=places&amp;sensor=false"></script>
<script src="https://maps.googleapis.com/maps/api/js? key=AIzaSyDXhwWzYNap1UD89oL43dc725FZY_-98jw&amp;callback=initMap"></script>
<div id="map"></div>

CSS

html,
body,
#map {
    display: block;
    width: 100%;
    height: 100%;
}

#map {
    background: #58B;
}

JavaScript

var xhttp = new XMLHttpRequest();
    var map;
    function initMap() {
         var map = new google.maps.Map(document.getElementById('map'), 
            {
                zoom: 4,
                center: {lat: 37.09024, lng: -95.712891},
            });
					var myLatLng = {lat: -25.363, lng: 131.044};

					//Create a Marker for My Position
          var myloc = new google.maps.Marker({
                clickable: false,
                icon: new google.maps.MarkerImage('//maps.gstatic.com/mapfiles/mobile/mobileimgs2.png',
                    new google.maps.Size(22,22),
                    new google.maps.Point(0,18),
                    new google.maps.Point(11,11)),
                shadow: null,
                zIndex: 999,
                map:map // your google.maps.Map object
            });
            
         var kmlFile = 'http://kml-samples.googlecode.com/svn/trunk/kml/ListStyle/item-icon-hotspot.kml';

            var kmlLayer = new google.maps.KmlLayer(kmlFile,
            {
                suppressInfoWindows: true,
                map: map,
                preserveViewport: true
            });
            
            var infoWindow = new google.maps.InfoWindow({map: map});

     google.maps.event.addListener(kmlLayer, 'click', function(kmlEvent) {
     var text = kmlEvent.featureData.name;
     showInContentWindow(kmlEvent.latLng,
     kmlEvent.featureData.name,
     kmlEvent.featureData.description);
    });
    
    
    function showInContentWindow(position, name, description) {
      var infowindow = new google.maps.InfoWindow({
        content: "<p><strong>" + name + "</strong></p>" +
        "<p>" + description + "</p>" +
        "<p>" + position.lat() + "</p>" +
        "<p>" + position.lng() + "</p>",
        position: position,
        pixelOffset: new google.maps.Size(0,-20),
         })
      infowindow.open(map);
	  }

      if (navigator.geolocation) {
                //Get Current Position
                	 ...