WebKit: Google StreetView
January 17, 2009 Matteo Bertozzi | Filed Under Cocoa | 2 CommentsLast iPhoto ‘09 presented at MacWorld contains a couple of interesting Features: Faces and Places. Today, I’ve a little bit of free time to play with my Mac, and the topic is How to embed Google StreetView into a Cocoa Application.

The Solution is using WebKit and Google Maps API. We’ve a simple HTML file that contains StreetView “Canvas” and a couple of javascript methods that interact with GStreetviewPanorama Object.

The Source Code is Available Here: Cocoa StreetView Source.
Looks great ! I was frustrated by the small window and modified it to handle resize :
* add html, body { height: 100% } to the CSS
* change street view DIV to
* add body onresize handler calling streetView.checkResize()
* finally, add the resize springs in Interface Builder
Voilà ! Type “Lyon, France” to visit my hometown
Comment by Patrick Geiller — January 17, 2009 #
The street view DIV got mangled — change its style to “width: 100%; height: 100%”.
Comment by Patrick Geiller — January 17, 2009 #