jQuery + google maps + Elevation
playing with google maps v3 events, jQuery, icons from http://google-maps-icons.googlecode.com
HTML
<script src="http://maps.google.com/maps/api/js?sensor=false&.js"></script>
<input type="button" id="btn" value="Add Kittens" />
<div id="map"></div>
CSS
#map{
width: 600px;
height: 600px;
}
JavaScript
var options = {
zoom: 3,
center: new google.maps.LatLng(37.59, -99.13),
mapTypeId: "terrain"
};
var map = new google.maps.Map($("#map")[0], options);
google.maps.event.addListener(map, "idle", function(){
console.log("idled");
});
$("#btn").click(function() {
var index = 0;
var urls = [ "http://placekitten.com/256/256",
"http://placekitten.com/g/256/256",
"http://placekitten.com/255/255",
"http://placekitten.com/g/255/255",
"http://placekitten.com/257/257",
"http://placekitten.com/g/257/257" ];
var overlay = new google.maps.ImageMapType({
getTileUrl: function() {
var url = urls[index%urls.length];
index++;
return url;
},
tileSize: new google.maps.Size(256, 256),
isPng: true,
opacity: 0.60
});
map.overlayMapTypes.push(overlay);
});