Full Screen Google Map

How can I use Google Maps API to show me a full screen map with no sidebars or search bar? I just need it to show a specific location in a mobile app, users don't need to search. Is this possible?

Also if I provide a street address how can it put a push-pin at the location?

Answers


Assuming you are planning to use the v3 API, you may want to check the following section of the documentation:

As for your second question, you can use Geocoding. Consider the following simple example:

<!DOCTYPE html>
<html> 
<head> 
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
   <title>Google Maps Geocoding Demo</title> 
   <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
   <script src="http://maps.google.com/maps/api/js?sensor=false" 
           type="text/javascript"></script> 
   <style type="text/css">
     html { height: 100% }
     body { height: 100%; margin: 0px; padding: 0px }
     #map { height: 100% }
   </style>
</head> 
<body> 
   <div id="map"></div> 

   <script type="text/javascript"> 

   var address = 'Oxford Street, London, UK';

   var map = new google.maps.Map(document.getElementById('map'), { 
       mapTypeId: google.maps.MapTypeId.TERRAIN,
       zoom: 12
   });

   var geocoder = new google.maps.Geocoder();

   geocoder.geocode({
      'address': address
   }, 
   function(results, status) {
      if(status == google.maps.GeocoderStatus.OK) {
         new google.maps.Marker({
            position: results[0].geometry.location,
            map: map
         });
         map.setCenter(results[0].geometry.location);
      }
      else {
         // Google couldn't geocode this request. Handle appropriately.
      }
   });

   </script> 
</body> 
</html>

Screenshot:


Need Your Help

How to validate a date?

javascript validation

I'm trying to test to make sure a date is valid in the sense that if someone enters 2/30/2011 then it should be wrong.

How to use Eclipse's Display View for Debug?

java eclipse view

At the link below it explains that the "display view allows you to manipulate live code in a scrapbook type fashion (see Figure 8). To manipulate a variable, simply type the name of the variable i...