
Using PhoneGap API ◾ 207
Displaying Google Maps
Each instance of google.maps.Map class displays a simple Google map on a page. e Map
class accepts the following two parameters:
◾ An HTML element that will contain the map. e preferred HTML element for displaying
a map on a Web page is a <div> element. e code below shows a sample <div> element
that can be used to display a map:
<div id = "map_canvas" style = "width:100%; height:100%"></div>
In the example above, we define a <div> element named map-canvas and set its size to
100%, which will expand it to fit the size on mobile devices.
◾ e second parameter used in the Map class is a google.