title: Map does not work with Cordova 2.0.0 for Android
body: <p>I have downloaded the Google Map sample for the <a href="http://en.wikipedia.org/wiki/PhoneGap" rel="nofollow noreferrer">PhoneGap</a> 1.5.0 file. It is working fine in Android with the <code>Cordova-1.5.0.js</code> file. But when I keep the Cordova-2.0.0.js file, Map is not shown.</p>
  
  <p>No error is coming in the try-catch block. What could be the issue? What would be a sample for a simple Map in Cordova 2.0.0?</p>
  
  <p>My code is as below:</p>
  
  <h3>Index.html</h3>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /&gt;
          &lt;meta charset="utf-8"&gt;
  
          &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
          &lt;link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css"rel="stylesheet"type="text/css" /&gt;
          &lt;script type="text/javascript" src="googlemap.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="reachability.js"&gt;&lt;/script&gt;
          &lt;script charset="utf-8" src="cordova-2.2.0.js"&gt;&lt;/script&gt;
  
          &lt;!-- iPad/iPhone specific CSS below, add after your main CSS &gt;
          &lt;link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="ipad.css" type="text/css" /&gt;
          &lt;link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" /&gt;
          --&gt;
          &lt;!-- If your application is targeting iOS BEFORE 4.0 you MUST put json2.js from http://www.JSON.org/json2.js into your www directory and include it here --&gt;
          &lt;!-- &lt;script&gt;
              if (navigator.userAgent.toLowerCase().match(/android/)) {
                  document.write('&lt;script charset="utf-8" src="cordova-1.5.0.js"&gt;&lt;\/script&gt;');
              }
              else if (navigator.userAgent.toLowerCase().match(/iphone/) || navigator.userAgent.toLowerCase().match(/ipad/)) {
                  document.write('&lt;script charset="utf-8" src="cordova-1.5.0.js"&gt;&lt;\/script&gt;');
              }
          &lt;/script&gt; --&gt;
          &lt;script type="text/javascript"&gt;
              // If you want to prevent dragging, uncomment this section
              /*
                  function preventBehavior(e)
                  {
                      e.preventDefault();
                  };
                  document.addEventListener("touchmove", preventBehavior, false);
              */
  
              /* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch.
                 see http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
                 for more details -jm */
              /*
                  function handleOpenURL(url)
                  {
                      // TODO: do something with the url passed in.
                  }
              */
  
              function onBodyLoad(){
                  document.addEventListener("deviceready", onDeviceReady, false);
              }
  
              /* When this function is called, Cordova has been initialized and is ready to roll */
              /* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch.
                 see http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
                 for more details -jm */
              function onDeviceReady()
              {
                  var reachability = new Reachability();
                  if(reachability.IsNotConnected()){
                      navigator.notification.alert('No internet connection available',null, '', 'OK');
                  }
                  else{
                      try{
                      var map = new GoogleMap();
                      map.initialize();
                      }catch(e){
                          alert(e.message);
                      }
                  }
              }
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body onload="onBodyLoad()"&gt;
          &lt;div id="map_canvas"&gt;
              Couldn't load map because there was no internet connection available
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h3>googleMap.js</h3>
  
  <pre><code>function GoogleMap(){
  
      this.initialize = function(){
          try{
              var map = showMap();
          }
          catch(e) {
              alert(e.message);
          }
      }
  
      var showMap = function(){
          var mapOptions = {
              zoom: 4,
              center: new google.maps.LatLng(-33, 151),
              mapTypeId: google.maps.MapTypeId.ROADMAP
          }
          try {
              var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
          }
          catch(e) {
              alert(e.message);
          }
          return map;
      }
  }
  </code></pre>
  
  <h3>reachability.js</h3>
  
  <pre><code>function Reachability(){
      this.IsNotConnected = function(){
          if(navigator.network.connection.type == Connection.NONE || navigator.network.connection.type == Connection.UNKNOWN)
          {
              return true;
          }
          else
          {
              return false;
          }
      }
  }
  </code></pre>