Source Code:
<html>
<head>
<title>Mapstraction Examples - Editing Google Features</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://mvn.idelab.uva.es/idelabmapstraction/downloads/1.0/idelabmapstraction.js" type="text/javascript"></script>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAnfs7bKE82qgb3Zc2YyS-oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA"></script>
</head>
<body>
<div id="mapstraction"></div>
<script type="text/javascript">
// initialise the map with your choice of API
var mapstraction = new mxn.MapstractionInteractive('mapstraction','google');
mapstraction.setCenterAndZoom(new mxn.LatLonPoint(40, -3),5);
//adding event listeners to map
mapstraction.markerAdded.addHandler(function(event,map,marker){
alert('Marker added at: '+marker.marker.location.lat+' , '+marker.marker.location.lon)})
mapstraction.polylineAdded.addHandler(function(event,map,polyline){
alert('Polyline added: It has '+polyline.polyline.points.length+' vertices')})
</script>
</body>
</html>