Monday, August 11, 2014

Photo Spheres on Google Maps


I am often surprised how few people know about photo spheres. 360º panoramas, they are ridiculously easy to create using the Android camera app, or with your own camera. There's even dedicate 360º cameras that will export to a photo sphere.

Even fewer people know that you can submit those photo spheres to Google Maps for use in Street View. Using Android, it's as easy as viewing the photo and sharing it with Google Maps. The sphere then loads into Google Maps Views and awaits moderation. While you're waiting, you can still share it with people. There's a convenient share button with a link and embed code. Here's one I took in Iceland just a few days ago. It's waiting for moderation, but can still be viewed.



In 1973 a US Navy DC3 went down on a beach in Iceland, and it's still there. I took two photo spheres of it, in addition to a number of other pictures. This is shared off Views. Once submitted, it's always available to you. Even if Google decides not to use it in Street View, you can still see it in Views, and even use it in the Google Maps API. Look at the iframe embed code, and find the panoid parameter. Use that as your "pano" property in your StreetViewPanoramaOptions object. Here's an example:




Friday, July 18, 2014

Imagery Resources

Over the last ten years or so, there's been an explosion of imagery available to every day users. Free to use imagery has come from from Google Earth and Maps to the APIs to APIs available through other providers like Bing, Yahoo! and Apple. But perhaps one of the most interesting things, to me at least, is the availability of tools to manipulate and control your own imagery, and combine imagery from different sources. I thought I'd highlight a few here, not at all in an exhaustive way or in any particular order.

Map Knitter by Public Lab comes out of the mapping tools they developed, DIY balloon and kite mapping. But the tool would also be useful for those doing mapping with private drones, such as the Parrot Drones, any one of a number of other drones, or DIY drones. Public Lab also produces the Spectral Workbench for people to "Use a homemade spectrometer to scan different materials, and contribute to an open source database."

Of course I'd be remiss if I didn't mention Google's efforts to make imagery available through its new Google Maps for Business Imagery program. And Google Earth Engine which allows you to do "A planetary-scale platform for environmental data & analysis."

I've been playing around with PostGIS, an extension for PostGreSQL. PostGIS is probably the best relational database for vector data. A couple of years ago, they started a raster project. I've not seen any progress recently, but it's worth keeping an eye on.

And of course books have been written about GDAL, the Geospatial Data Abstraction Library. Powerful, with lots of scripts written for it. Definitely not for the faint of heart though. There's a great set of python scripts to do raster data manipulations.



Thursday, July 3, 2014

A Couple of Common Maps API Errors

I think it's worth occasionally calling out common errors using the Google Maps API. I run into these periodically, and I am calling them out not because people are doing something done but because they are easy to make and I wanted to record them. I'll probably make this a semi-regular thing I post about. If you run into questions about using our API, the Google Maps API support page has the right links and resources to use. In this post, I've got two that I see a lot. Both are for the JavaScript Maps API.

Using undocumented methods and properties

It's not uncommon that I run into people complaining on Twitter where they say something like "Google has changed the properties of this object so that Latitude is no longer in the .a property, it's now in .b. Thanks Google for breaking my site! :-)"

FYI, the Google Maps API has no object with a .a property. When Google compiles objects, the object may be represented with a .a property to the API. People find this out using tools like Firebug and Chrome Dev Tools and then come to rely on them, not realizing that the actual object is a say a google.maps.LatLng object that has methods .lat() and .lng() and that's the right way to get those values. And Google won't change those with a version change. There's no such guarantee about undocumented methods and properties.

Making the map invisible

Creating a google.maps.Map object you give it a node in the DOM to place the map. Usually people put this in a div object. However, developers often forget to give the node a size, say a height and width. And they're confused then when nothing shows up on their map. You can see it in the Simple Map sample if you click on the Javascript + HTML tab.

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
      height: 100%;
      margin: 0px;
      padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
    <script>
var map;
function initialize() {
  var mapOptions = {
  zoom: 8,
  center: new google.maps.LatLng(-34.397, 150.644)
  };
  map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>


Tuesday, June 10, 2014

Thoughts on the new Street Art Project

Today the Google Cultural Institute announced the Google Street Art Project. Honestly, I didn't even know it was going to happen. And yet I'm so thrilled! I actually happen to love street srt, and these 5000 beautiful images are incredible.

Giant murals by Martin Ron and Blu (Italy)

This is in Buenos Aires, and if you want you can see it's location on a map.

Map of Image location

But the map doesn't itself give you this sense of the location. Place is about the feel, the view, the people. That's why Street View is such an exciting tool, it helps people understand so much about the world.

More interesting to me right now is thinking about Street Art. Street Art is often an ephemeral practice, and that's part of the appeal. While Banksy pieces may be preserved to help the property values go up, much Street Art is covered up, cleaned up, or itself tagged over by other artists. It's an artistic representation in the public sphere that both invades but also reflects a sense of the community. The artists have to go someplace and become, at least temporarily, part of the space. And they must accept that their piece won't last, won't be preserved in a gallery (for the most part).

And they have to be found. People walk by their art. Whether grand or small

Zurich Street Art, picture by Mano Marks

it evokes a response and both conveys a sense of the space and shapes it. Check out the Street Art Project.

Friday, May 9, 2014

I'm back


So, I took a bit of a hiatus from blogging. OK, more than two years. I've been focusing on blogging on the Google Geo Developers blog, and maintaining the Google Maps API Plus Page and Twitter account. However, there’s been some projects I've been working on, and I've been getting the long-form content itch back. So watch this space, I’ll be publishing more soon. My focus will probably be more on the tech end of things, code I’m working on etc. But as before I’ll be sprinkling some other thoughts along the way.