{"id":179,"date":"2011-05-16T16:03:41","date_gmt":"2011-05-16T23:03:41","guid":{"rendered":"http:\/\/www.patrickmatte.com\/?p=179"},"modified":"2015-12-14T18:36:07","modified_gmt":"2015-12-15T01:36:07","slug":"simulating-google-earth-with-google-maps-api-for-flash","status":"publish","type":"post","link":"https:\/\/www.patrickmatte.com\/?p=179","title":{"rendered":"Creating a globe with Google Maps"},"content":{"rendered":"<div class=\"text\">\n<div class=\"columnLeft\">I made some research on how to simulate Google Earth in Flash for a recent project at TBWA\\Chiat\\Day. Unfortunately the schedule was too tight and a freelancer was called in to build the module which in the end only used the regular google maps top view. But I wanted to share my research anyway.<\/p>\n<p>The tricky thing is that the grid in Google Maps is square and as you can see in the background, the latitude is not distributed evenly. So you can&#8217;t simply take the square map and put it on a sphere or it will appear very distorted. What you need to do is find the latitude\/longitude of the 4 vertices of every face on the sphere and then use the method fromLatLngToViewPort which returns the Point on the map that corresponds to that latitude and longitude. <\/p><\/div>\n<div class=\"columnRight\">Once you have all four points, you can draw that particular section of the map and use it as a material for the face. One thing worth mentioning is also that for some reason, the satellite view only has map available from 85 degrees to -85 degrees of latitude, so you have to patch the top and bottom of the sphere manually.<\/p>\n<p>Maybe I&#8217;ll revisit this at a later time and make it possible zoom in on the map.<\/p>\n<p><a href=\"http:\/\/www.patrickmatte.com\/stuff\/earth\/Archive.zip\">Download the source files.<\/a><\/div>\n<\/div>\n<p><iframe id=\"entry-header\" scrolling=\"no\" style=\"position:relative; width:100%; height:720px; margin:0 auto\" src=\"http:\/\/patrickmatte.com\/stuff\/earth\/\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I made some research on how to simulate Google Earth in Flash for a recent project at TBWA\\Chiat\\Day. Unfortunately the schedule was too tight and a freelancer was called in to build the module which in the end only used the regular google maps top view. But I wanted to share my research anyway. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":310,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[31,20,57],"class_list":["post-179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-experiments","tag-3d","tag-flash","tag-google-maps"],"_links":{"self":[{"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=\/wp\/v2\/posts\/179"}],"collection":[{"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=179"}],"version-history":[{"count":15,"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=\/wp\/v2\/posts\/179\/revisions"}],"predecessor-version":[{"id":814,"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=\/wp\/v2\/posts\/179\/revisions\/814"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=\/wp\/v2\/media\/310"}],"wp:attachment":[{"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.patrickmatte.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}