Mobile Mapping In Google Maps and Rise of Geo Mobile Web

26
Mobile Mapping in Google Maps and Rise of Geo Mobile Web March 14, 2010 Shawn Shen, Developer Advocate

description

I'll highlight the fusion of three trends: mobile, social, and geolocation that leads to the rise of geo mobile web, and show that Google Maps is powering the geo social networks with examples like Gowalla and FourSquare,

Transcript of Mobile Mapping In Google Maps and Rise of Geo Mobile Web

Page 1: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Mobile Mapping in Google Maps and Rise of Geo Mobile WebMarch 14, 2010

Shawn Shen, Developer Advocate

Page 2: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Overview of Google Geo/Maps APIs CoveredJavascript API v2/v3

Street View API

Static Maps API

Flash API

Google Maps Data API

Services e.g. Geocoding, Directions, Monetization, Local Search, etc.

Page 3: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Mobile + Social + Geolocation

Rise of Geo Mobile WebRise of Geo Social NetworksGoogle Maps powering Geo Mobile Web

Page 4: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Mobile Mapping Options using Google Maps

Web Apps

Static Maps API (All)

JavaScript Maps API (iPhone & Android)

Native/WebView Hybrid

WebView/UIWebView

JavaScript Maps API V3

Native Apps

MapView for Android

MapKit for Apple

Page 5: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Google Maps in Browsers as Web App

Advantages

JavaScript Maps API v3

Web app in browsers

MVC design optimized for mobile

Share code base between mobile and web

No apps to update

Use JavaScript to geolocate current position

Disadvantages

No distribution in App Store or Android Market

Cannot take advantage of device sensors

Lack native apps touch and feel

Page 6: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Google Maps Embedded in Native Apps

Advantages

Gain distribution in App Store or Android Market

Native app look and feel

Can bridge to use sensors

JavaScript Maps API v3

Cross browsers

Share map code between mobile and web

Page 7: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Google Maps Embedded in Native Apps

Advantages

Mapping does not require client update

Use JavaScript to geolocate current position

Disadvantages

Native apps permissions Code base for native apps per device

Page 8: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Google Maps in Native Apps

Advantages

Better performance

Tight integration with device sensors

Disadvantages

APIs for native apps evolve more slowlyBig difference between MapView and MapKitRequire updates of apps for any new mapping features

Page 9: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Embedded Maps in Native Apps: Best Option

Page 10: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Embed Maps in WebView/UIWebView on Native Apps

Loading a Maps API Site in a Native Androd ApplicationDeveloping Native iPhone Applications using V3

Layoutres/layout/main.xml

Android manifest file for permissionsAndroidManifest.xml

Main Java classWebMapActivity

JavaScript v3 map http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html

Page 11: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Define Native Layout for Map in WebView

<LinearLayout xmlns:android="..." android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent"/></LinearLayout>

Page 12: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Define Native Permissions for Map in WebView

AndroidManifest.xml <uses-permission android:name="{PERMISSION}"/>

android.permission.INTERNETandroid.permission.ACCESS_COARSE_LOCATION android.permission.ACCESS_FINE_LOCATION

Page 13: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Define WebMapActivity Java class

public class WebMapActivity extends Activity { private static final String JS_MAP_URL = "..."; private WebView webView;

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webView = (WebView) findViewById(R.id.webview); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl(JS_MAP_URL); }}JS_MAP_URL: http://code.google.com/apis/maps/articles/android_v3.html

Page 14: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Embedded JavaScript Map

var myLatlng = new google.maps.LatLng(lat,long); var myOptions = { zoom: 8, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP}var map_div = document.getElementById("map"); map = new google.maps.Map(map_div, myOptions); http://code.google.com/apis/maps/articles/android_v3.html

Page 15: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Final WebMapActivity in Eclipse Emulator

Page 16: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Embed Maps in UIWebView on iPhone Apps

- (void)viewDidLoad { NSString *url = @"{JS_MAP_URL}"; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; [webView loadRequest:request]; [super viewDidLoad]; }

Developing Native iPhone Applications using V3 JS_MAP_URL: http://code.google.com/apis/maps/articles/tutorial-iphone.html

Page 17: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Final UIWebView iPhone App in Xcode Emulator

Page 18: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Apps of the Geo Mobile Web

Let's look at a few real world apps that take advantage of the fusion mobile, social and geolocation trends

Page 19: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Example: Google Maps Navigation for Mobile

Turn by turn directionsReplacing standalone GPS device Native app on mobile device

Page 20: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Example: Google Latitude

Native app on Android in Google Maps MobileWeb app on iPhone using JavaScript APISocial graph: friends and discovery

Page 21: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Geo Social Network: Gowalla

Profile/PassportSpots/PlacesTripsFriends

Check in Build circle of friends anew or from existing friends

Page 22: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Geo Social Network: FourSquare

ProfilePlacesTo DoFriendsBadges

Check In Build new circle of friends or from existing friends

Page 23: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Geo Campus Community: iStanford

Page 24: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Geo Mobile Web Spawning New Social Networks

New breed of social networks emerging from sharing location-aware activities and location based info

Page 25: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

Recap

Mobile + Social + Geolocation trendsRise of Geo Mobile Web/Geo SNS Powered by Google Maps

Data source e.g. tiles, placesTools e.g. rendering/interactivityServices e.g. geocoding

Page 26: Mobile  Mapping  In  Google  Maps and Rise of Geo Mobile Web

More hands-on coding session with Google Maps API later at 5pm today Links:

Android map: http://bit.ly/7w8wQsAndroid Missouri map: http://bit.ly/abUD0fiPhone map: http://bit.ly/bRy6l1 Today's codelabs: http://bit.ly/gcodelas

Thank you!

Q&A