17.01.2013 Views

An Introduction of Google Map and Google Earth

An Introduction of Google Map and Google Earth

An Introduction of Google Map and Google Earth

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>An</strong> <strong>Introduction</strong><br />

<strong>of</strong> <strong>Google</strong> <strong>Map</strong> <strong>and</strong> <strong>Google</strong> <strong>Earth</strong><br />

Henry H.M. Huang, Ph.D.


Summary<br />

� The basics <strong>of</strong> the <strong>Google</strong> <strong>Map</strong>s interface, the fundamentals <strong>of</strong><br />

the <strong>Google</strong> <strong>Map</strong>s API, <strong>and</strong> how to organize <strong>and</strong> translate<br />

existing information into a format that can successfully be<br />

used within <strong>Google</strong> <strong>Map</strong>s <strong>and</strong> <strong>Google</strong> <strong>Earth</strong> applications.


Summary - <strong>Google</strong> <strong>Earth</strong><br />

• <strong>Google</strong> <strong>Earth</strong> is a st<strong>and</strong>alone application, rather than a web<br />

site solution like <strong>Google</strong> <strong>Map</strong>s, <strong>and</strong> <strong>of</strong>fers a completely new<br />

set <strong>of</strong> methods for describing information. <strong>Google</strong> <strong>Earth</strong> is a<br />

desk-top application available for Windows <strong>and</strong> Mac OS X<br />

that enables you to browse <strong>Google</strong> <strong>Earth</strong> images in a more<br />

dynamic environment. Using <strong>Google</strong> <strong>Earth</strong> you move about<br />

the earth in 3D, moving <strong>and</strong> manipulating the <strong>Google</strong> <strong>Earth</strong><br />

data in real time. This provides additional information that<br />

would be difficult to represent within the <strong>Google</strong> <strong>Map</strong>s<br />

interface, such as “tilting” the earth so that you can see the<br />

relative height <strong>of</strong> different areas <strong>of</strong> l<strong>and</strong>.


Summary<br />

� Also, it will be introduced that the initial <strong>and</strong> potential<br />

applications <strong>of</strong> <strong>Google</strong> <strong>Earth</strong> in the researches <strong>of</strong> seismic<br />

signals processing <strong>and</strong> earthquake events classification for<br />

event <strong>and</strong> hazard visualization.<br />

� <strong>Google</strong> <strong>Map</strong>s <strong>and</strong> <strong>Google</strong> <strong>Earth</strong> exist 7 years since 2005<br />

advent.<br />

� Completely based on AJAX(an acronym for Asynchronous<br />

JavaScript <strong>and</strong> XML)


3 main maps web service providers<br />

� 1. <strong>Google</strong> <strong>Map</strong>s <strong>and</strong> <strong>Google</strong> <strong>Earth</strong><br />

� (The first public access GIS, since 2005)<br />

� 2. Yahoo! <strong>Map</strong>s (following <strong>Google</strong>)<br />

� Based on Adobe Flash. Traffic Informations.<br />

� 3. Micros<strong>of</strong>t Virtual <strong>Earth</strong> (following <strong>Google</strong> <strong>and</strong> Yahoo!)


Configure <strong>Google</strong> <strong>Map</strong>s API developing<br />

Environment<br />

� 1. AJAX-based <strong>Google</strong> <strong>Map</strong>s API normally needs only a web<br />

explorer. However, for many extension applications, serverside<br />

service needed.<br />

� 2. One possible solution: WAMP –<br />

Windows+Apache+MySQL+PHP.<br />

� http://sourceforge.net/projects/wampserver/


Configure <strong>Google</strong> <strong>Map</strong>s API developing<br />

Environment — Cont.<br />

� 2.1 Download WAMP from:<br />

� http://sourceforge.net/projects/wampserver/<br />

Then install “wampserver2.2e-php5.4.3-httpd2.2.22mysql5.5.24-32b.exe”<br />

� 2.2 Add GD2 graphical library.<br />

“D:\wamp\bin\php\php5.4.3\ext\php_gd2.dll” existed?<br />

Otherwise download from: http://php.net/<br />

2.3 Apply <strong>Google</strong> <strong>Map</strong>s API Key (Optional)


<strong>Google</strong> <strong>Map</strong>s Interface<br />

• Needing a <strong>Google</strong> account<br />

• Turn on <strong>Google</strong> <strong>Map</strong>s API v3 Service<br />

• May incur fee. Such as:<br />

• Service Usage limit 1,000 excess map<br />

loads<br />

(per day) (in U.S. dollars)<br />

• JS <strong>Map</strong>s API v2 25,000 $1.00<br />

• JS <strong>Map</strong>s API v3 25,000 $0.50<br />

• Static <strong>Map</strong>s API 25,000 $0.50<br />

• Street View Image API 25,000 $0.50


<strong>Google</strong> <strong>Map</strong>s Interface<br />

• <strong>Google</strong> <strong>Map</strong>s has a wide array <strong>of</strong> APIs that let you embed the<br />

robust functionality <strong>and</strong> everyday usefulness <strong>of</strong> <strong>Google</strong> <strong>Map</strong>s<br />

into your own website <strong>and</strong> applications, <strong>and</strong> overlay your<br />

own data on top <strong>of</strong> them.<br />

– <strong>Map</strong>s JavaScript API<br />

– <strong>Map</strong>s Image APIs<br />

– <strong>Google</strong> <strong>Earth</strong> API<br />

– Places API<br />

– <strong>Map</strong>s for Business<br />

– Web Services


<strong>Map</strong>s JavaScript API<br />

• The <strong>Google</strong> <strong>Map</strong>s Javascript API lets you embed <strong>Google</strong><br />

<strong>Map</strong>s in your own web pages. Version 3 <strong>of</strong> this API is<br />

especially designed to be faster <strong>and</strong> more applicable to<br />

mobile devices, as well as traditional desktop browser<br />

applications.<br />

• The API provides a number <strong>of</strong> utilities for manipulating maps<br />

(just like on the http://maps.google.com web page) <strong>and</strong><br />

adding content to the map through a variety <strong>of</strong> services,<br />

allowing you to create robust maps applications on your<br />

website.


Two simple samples – the 1st map center at Beijing<br />

• <br />

• <br />

• <br />

• <br />

• <br />

• html { height: 100% }<br />

• body { height: 100%; margin: 0; padding: 0}<br />

• #map_canvas { height: 100% }<br />

• <br />

• <br />

• <br />

• <br />

• function initialize()<br />

• {var mapOptions = {<br />

• center: new google.maps.LatLng(39.9075, 116.397222),<br />

• zoom: 8,<br />

• mapTypeId: google.maps.<strong>Map</strong>TypeId.ROADMAP<br />

• };<br />

• var map = new google.maps.<strong>Map</strong>(document.getElementById("map_canvas"),<br />

• mapOptions); }<br />

• <br />

• <br />

• <br />

• <br />

• <br />


The 1st map center at Beijing


Two simple samples – the 2nd map center at Calgary<br />

<br />

<br />

<br />

<br />

<br />

html { height: 100% }<br />

body { height: 100%; margin: 0; padding: 0}<br />

#map_canvas { height: 100% }<br />

<br />

<br />

<br />

<br />

function initialize()<br />

{var mapOptions = {<br />

};<br />

center: new google.maps.LatLng(51.05, -114.085278),<br />

zoom: 8,<br />

mapTypeId: google.maps.<strong>Map</strong>TypeId.ROADMAP<br />

var map = new google.maps.<strong>Map</strong>(document.getElementById("map_canvas"),<br />

mapOptions); }<br />

<br />

<br />

<br />

<br />

<br />


The 2nd map center at Calgary


Basic Steps to use <strong>Google</strong> <strong>Map</strong>s JavaScript API v3<br />

1. Familiar with JavaScript<br />

2. Declare the application as HTML5<br />

3. Obtaining an API Key<br />

4. Loading the <strong>Google</strong> <strong>Map</strong>s API<br />

5. <strong>Map</strong> DOM Elements<br />

6. <strong>Map</strong> Options<br />

7. The <strong>Map</strong> Object<br />

8. Loading the <strong>Map</strong>


Usage Limits <strong>and</strong> Billing<br />

� Almost Free for use by any person or any<br />

organization.<br />

� Incurring fee only when a large volume <strong>of</strong><br />

access: 25 000 map loads per day for more than<br />

90 consecutive days.<br />

� Non-pr<strong>of</strong>it organizations are exempted from<br />

the <strong>Map</strong>s API usage limits


<strong>Google</strong> <strong>Map</strong>s API Usages<br />

1. Basics search <strong>and</strong> Locale Business<br />

Search for string “Calgary”:<br />

http://maps.google.cz/maps?q=Calgary<br />

Locale Business center Add :<br />

http://www.google.com/local/add<br />

2. <strong>Google</strong> <strong>Map</strong>s on Mobile or iPhone<br />

Download <strong>Google</strong> <strong>Map</strong>s for mobile to one’s phone from<br />

http://www.google.com/mobile/maps/


<strong>Google</strong> <strong>Map</strong>s API Usages – Cont.<br />

3. <strong>Google</strong> <strong>Map</strong>s Static<br />

The <strong>Google</strong> Static <strong>Map</strong>s API lets you embed a <strong>Google</strong> <strong>Map</strong>s<br />

image on your webpage without requiring JavaScript or any<br />

dynamic page loading<br />

https://developers.google.com/maps/documentation/staticma<br />

ps/<br />

- API documentation<br />

4. Basic Static <strong>Map</strong> Insert<br />

http://maps.google.com/staticmap?center=51.05,-<br />

114.085278&zoom=12&size=350x200


<strong>Google</strong> <strong>Map</strong>s API Usages – Cont.<br />

5. Documentation & APIs<br />

Main Documentation Page: https://developers.google.com/maps/<br />

<strong>Google</strong> <strong>Map</strong>s API Blog: http://googlemapsapi.blogspot.com/<br />

Discussions:https://groups.google.com/forum/?fromgroups#!forum/<strong>Google</strong>-<br />

<strong>Map</strong>s-API<br />

KML format: https://developers.google.com/kml/<br />

<strong>Google</strong> <strong>Map</strong>s API for Flash(Deprecated):<br />

https://developers.google.com/maps/documentation/flash/


<strong>Google</strong> <strong>Map</strong>s API Usages – Cont.<br />

6. <strong>Map</strong>plets<br />

<strong>Map</strong>plets are mini-applications that run within <strong>Google</strong> aps(Deprecated):<br />

https://developers.google.com/maps/documentation/mapplets/<br />

7. Related Pages<br />

<strong>Google</strong> <strong>Map</strong>s Mania: http://googlemapsmania.blogspot.ca/<br />

OpenLayers makes it easy to put a dynamic map in any web<br />

page: http://openlayers.org<br />

<strong>Google</strong> <strong>Earth</strong> view satellite imagery etc:<br />

http://earth.google.com or<br />

http://www.google.com/earth/index.html


Basic Components <strong>of</strong> a <strong>Google</strong> <strong>Map</strong>s Application<br />

XHTML (Extensible HTML)<br />

VML (Vector Markup Language)<br />

Styles <strong>and</strong> Elements<br />

XML (Extensible Markup Language)<br />

JavaScript


<strong>Google</strong> <strong>Map</strong>s API Constituents<br />

1. Overlays(refs)<br />

2. Events(refs)<br />

3. Controls(refs)<br />

4. Styles(refs)<br />

5. Layers(refs)<br />

6. <strong>Map</strong> Types(refs)


<strong>Google</strong> <strong>Map</strong>s API Constituents – Events<br />

2 types <strong>of</strong> events<br />

(1)User events – 'click’, 'dblclick', 'mouseup’, 'mousedown’,<br />

'mouseover' , 'mouseout‘…<br />

(2) MVC state change<br />

Information Windows<br />

Controls


Events – Example 1: Fixed the Center <strong>of</strong> <strong>Map</strong>


Events – Example 2: Click <strong>and</strong> Re-Centerize


Events – Example 3: Message Boxes


Events – Example 4: Display Zoom Level


Events – Example 5: DOM Listener


<strong>Google</strong> <strong>Map</strong>s API Constituents – 3. Controls


<strong>Google</strong> <strong>Map</strong>s API Constituents– <strong>Map</strong> Types<br />

(1) Basic <strong>Map</strong> Types:<br />

•<strong>Map</strong>TypeId.ROADMAP: the default road map view<br />

•<strong>Map</strong>TypeId.SATELLITE: <strong>Google</strong> <strong>Earth</strong> satellite images<br />

•<strong>Map</strong>TypeId.HYBRID: a mixture <strong>of</strong> normal <strong>and</strong> satellite views<br />

•<strong>Map</strong>TypeId.TERRAIN: a physical map based on terrain information.<br />

The map type in use can be modified by setting its mapTypeId property,<br />

either within the constructor via setting its <strong>Map</strong> options object, or by calling<br />

the map's set<strong>Map</strong>TypeId() method.<br />

(2) 45° Imagery: Enabling <strong>and</strong> Disabling 45° Imagery; Rotating 45° Imagery.<br />

(3) User-defined <strong>Map</strong> Types……


Rotating 45° Imagery Example


The <strong>Google</strong> <strong>Map</strong>s Classes<br />

G<strong>Map</strong>(Refs) GMarker (Refs)<br />

GPolyline (Refs) GIcon<br />

GEvent GXmlHttp<br />

GXml GXslt<br />

GPoint GSize<br />

GBounds


<strong>Google</strong> <strong>Earth</strong>(refs)<br />

� Explore the world from anywhere<br />

Whether on your computer or on the go, see the world the same way<br />

you’re used to seeing it, in 3D.<br />

Explore <strong>Google</strong> <strong>Earth</strong> in three ways: Desktop, Web, Mobile<br />

Highlights in <strong>Google</strong> <strong>Earth</strong>: Moon, 3D Buildings, Mars, Sky, Ocean,<br />

Historical Imagery<br />

http://www.google.com/earth/explore/products/<br />

� Virtual adventure<br />

Take a trip to a faraway place, stroll through a 3D forest <strong>and</strong> travel<br />

back in time.<br />

http://www.google.com/earth/explore/showcase/


<strong>Google</strong> <strong>Earth</strong> Interface


<strong>Google</strong> <strong>Earth</strong> API(Refs)<br />

� <strong>Google</strong> <strong>Earth</strong> API Reference (Refs)<br />

� <strong>Google</strong> <strong>Earth</strong> API Developer's Guide(Refs)<br />

� Code Samples(Refs)<br />

� More Resources(Refs)


<strong>Google</strong> <strong>Earth</strong> in Seismology<br />

Real-time <strong>Earth</strong>quakes(Refs)<br />

Using <strong>Google</strong> <strong>Earth</strong> to visualize volcanic <strong>and</strong> seismic activity<br />

Visualize <strong>Earth</strong>quake Data In <strong>Google</strong> <strong>Earth</strong>


Real-time <strong>Earth</strong>quakes


That’s all!<br />

Thank you!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!