18
Hands on with the Google Maps Data API and the Google Maps API v3 Shawn Shen May 18, 2010

Hands on with the Google Maps Data API

  • Upload
    ss318

  • View
    3.042

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Hands on with the Google Maps Data API

Hands on with the Google Maps Data API and the Google Maps API v3

Shawn ShenMay 18, 2010

Page 2: Hands on with the Google Maps Data API

Maps Data API - Agenda

Introduction (10 min)Maps Javascript API V3Maps Data API

Lab and Demo (40 min)

Ossama, Mano, Luke, Josh, Daniel

Page 3: Hands on with the Google Maps Data API

What is Google Maps API V3?

The Google Maps V3 API lets you create interactive maps using just JavaScript, HTML and CSS.

Page 4: Hands on with the Google Maps Data API

What is Maps Data API

Google data infrastructure to store and retrieve geospatial data for your applications

Geospatial data: Latitude/LongitudeCustom data

Page 5: Hands on with the Google Maps Data API

Maps Data API = Google Data + Geo Signature

Use Google Data ProtocolREST-like technology GET/POSTFeeds

http://maps.google.com/maps/feeds/maps/default/full

Create/Read/Update/Delete

Geospatial and attribute queries

Radius searchBounding box search

Page 6: Hands on with the Google Maps Data API

Maps Data API: Geospatial Data Structure

Map: a layer or container of features

Features: data with location signaturePoint: Lat/LongPolylinePolygon

Page 7: Hands on with the Google Maps Data API

Maps Data Front End: My Maps Example

Page 8: Hands on with the Google Maps Data API

Use Cases of Maps Data API: My Locator

Page 9: Hands on with the Google Maps Data API

Maps Data API: Client Libraries

JavascriptJavaPython

Page 10: Hands on with the Google Maps Data API

Maps Data API Javascript Client Library

Google Account: https://www.google.com/accounts

Javascript client using common loader

// Load the latest version of the Google Data JavaScript Client google.load('gdata', '2.x', {packages: ['maps']});

Page 11: Hands on with the Google Maps Data API

Map Data API: Authentication in Javascript

Authentication of Web Client using AuthSub var scope = 'http://maps.google.com/maps/feeds'; Login: var token = google.accounts.user.login(scope); Check login: google.accounts.user.checkLogin(scope);

Logout: google.accounts.user.logout();

Page 12: Hands on with the Google Maps Data API

Map Data API: Add Map Layer

var service = new google.gdata.maps.MapsService('app'); var mapFeed = 'http://maps.google.com/maps/feeds/maps/default/owned'; service.getMapFeed(mapFeed, function(feedRoot){ var newMap = new google.gdata.maps.MapEntry(); newMap.setTitle(new google.gdata.atom.Text.create(...)); newMap.setSummary(...); feedRoot.feed.insertEntry(newMap, success, error);}, callback);

Page 13: Hands on with the Google Maps Data API

Map Data API: Add Feature to Map Layer

var service = new google.gdata.maps.MapsService('app'); service.getFeatureFeed(featureFeed, function(feedRoot) { var feature = new google.gdata.maps.FeatureEntry(); ...... kmlContent.setText(kmlString); kmlContent.setType(...); newFeature.setContent(kmlContent); feedRoot.feed.insertEntry(newFeature, success, error);}, callback);

Page 14: Hands on with the Google Maps Data API

Maps Data API Lab

Page 15: Hands on with the Google Maps Data API

Maps Data API Lab - Agenda

1. Javascript V3 map2. Authentication using AuthSub3. Add a map layer4. Add features to map layer and retrieve maps 5. Geospatial and attribute query

Codelab: http://bit.ly/d9Vr50

Page 16: Hands on with the Google Maps Data API

Maps Data API Lab - Hosting on App Engine

http://onebox.appspot.com

If you don't have your own server...

App Engine Hosting Demo

Page 17: Hands on with the Google Maps Data API

Resources and Links

Maps Data API:http://code.google.com/apis/maps/documentation/mapsdata/

Maps Data API: Javascript

http://bit.ly/fTV1K Google Data API Home:

http://code.google.com/apis/gdata/docs/developers-guide.html Maps Javascript API V3

http://code.google.com/apis/maps/documentation/v3/

#mapsdata @sshen @googlemapsapi

Page 18: Hands on with the Google Maps Data API

Wrap-up

Maps Data APIMy Locator: Your Favorite Location AppEarth/KML 101 coming up

#mapsdata @sshen @googlemapsapi

Thank You!