Web Authoring
  Home arrow Web Authoring arrow Page 2 - Introducing the Google Maps API
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB AUTHORING

Introducing the Google Maps API
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2007-06-06

    Table of Contents:
  • Introducing the Google Maps API
  • More Google Maps API Functions
  • Using the Google Maps API, Step By Step
  • The Google Maps API in the Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th -1:00PM EST. Register Today!

    Introducing the Google Maps API - More Google Maps API Functions


    (Page 2 of 4 )

    Map Types

    Google Maps provides three types of map: a simple map that provides an outline-based map, a satellite map that streams the satellite-imaged maps and a hybrid map which combines both of the aforementioned maps. The map types provided by Google Maps are controlled by the following methods:

    • setMapType(type) sets the type of map to be displayed.
    • removeMapType(type) removes a map type that has already been set.

    The type parameter is specified using the constants provided by the GMapType class. It can be G_NORMAL_MAP, G_SATELLITE_MAP, or G_HYBRID_MAP corresponding to maps of the simple, satellite image-based or hybrid types. 

    Map State

    The methods that provide information about the state of the map come under this heading. The information provided by map state methods include whether the map is loaded or not, the current focus point or center of the map, and more. The commonly used methods are:

    • isLoaded() tells whether or not the map is loaded onto the client browser.
    • getCenter() provides the latitude and longitude of the center of the current view port of the map.

    Overlays

    By definition "A map overlay refers to a point or polyline that is added on top of the Google Map." In essence an overlay means a point or line that is placed on the map to distinguish it from the rest of the map. The most used methods in this category are:

    • addOverlay(overlay) adds an overlay presented by the overlay object passed as a parameter.
    • removeOverlay(overlay) removes an overlay already added and represented by the overlay object passed as a parameter.

    The overlay object can be of the GPoint or GPolyline types.

    Information Window

    When an overlay is clicked, a window containing detailed information can be displayed. It is called the information window or info window in short. The following are the main methods used to control an info window:

    • openInfoWindow(latlng,dom,[opts]) opens an information window at the point specified by latlang and with the data specified as dom which is a DOM node.
    • showMapBlowup(latlng,[opts]) opens an info window at the specified latlng containing the close-up view of the latlng specified as a parameter.

    The parameter latlng is of the GLatLng type.

    Map Navigation

    The navigation of the map can be controlled using the methods provided under this category. The commonly used methods are:

    • setCenter(center,[zoom],[type]) loads the map focused on the point specified by center with an optional level of zoom and type of map. 
    • panTo(center) navigates to the point on the map specified by center.
    • setZoom(level) zooms into or magnifies the current center to the level specified with the parameter level.

    Events

    The Google Maps API provides methods to intercept any event taking placing on the map. The common events supported by the Google Maps API are:

    • click is generated when the user clicks on any point within the boundaries of the map.
    • move is fired when the map is moving or panning. During panning it may be fired many times.
    • moveend is fired when the panning is completed.

    That brings us to the end of the first part of our discussion. In the next section I will detail the steps required to work with the Google Maps API.

    More Web Authoring Articles
    More By A.P.Rajshekhar


       · In this discussion I have introduced basics of Google Map APIs.
     

    WEB AUTHORING ARTICLES

    - Yahoo Pipes: Worth a Look
    - Completing an EAR
    - Building and Deploying an EAR
    - New Nuke Security Sentinel: Worth Taking a C...
    - Administering Your CMS-Based Web Site
    - What You Need to Know Before Using a CMS
    - Introducing the Google Maps API
    - An Overview of the Yahoo User Interface Libr...
    - Basic configuration of osCommerce, concluded
    - Basic configuration of osCommerce, continued
    - Basic configuration of osCommerce
    - Deploying your Site with PHPEclipse, continu...
    - Deploying your Site with phpEclipse
    - Macromedia Captivate Review
    - Macromedia and Adobe Planning to Tie the Knot







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway