Mapstraction Examples-Adding Yahoo! Features

Demo Functions

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://api.maps.yahoo.com/ajaxymap?v=3.8&appid=HOIu3JPV34G8Z3BN7_wfmmWbnqUy9R7QaGtkwII.riiT2JMrBXR8aoErhjmyaQ--" type="text/javascript"></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','yahoo');
          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>