Archive for the ‘Google’ Category

Routes in iPhone Google Map Application

October 28, 2007

With regular Google map, you can specify multiple destinations in the same URL. I was hoping to be able to create a bike route using Google maps and then e-mail it to my iPhone and thus display it in the iPhone’s Google map application. But no such a luck. The iPhone Google map application cannot handle multiple destinations. In the regular browser based Google map you can directly encode a route in a URL, e.g. here is route from San Jose, CA to Los Gatos, CA to Salinas CA:

Unfortunately iPhone’s Google Map Application is unable to process this kind URL. It looks a like a bug that hopefully will get fixed in some future upgrade.

Google Books in your blog

September 7, 2007

The Google Book project started a few years ago, where they started scanning the library collection of a number of universities. Well starting today, you can now embed a reference to the digital version of the book in your own blog. You can select any part of the book to be the image which you embed in your blog. Very cool. Finally you can read the old classics from the comfort of your own blog. The Google Book reader displays each page as an image. You can zoom in and out, but you cannot select or copy the text.


note19 project

July 11, 2007

Note 19Today I created a Google project to place scripts that I create whilst learning about maps, gpx, … under source control. These scripts are of little use to anyone else (unless you too are a newbie to ruby, gpx and maps). I’m also new to subversion. I’ve used it to get the sources of a number of apache project, but have never used it to check in code. It took a number of iterations to get my environment set up for subversion:

  1. Create google project
  2. Create a root folder where you plan to store your sources, e.g., ~/myproject
  3. Create 3 subfolders under ~/myproject: ./branches, ./tags, and ./trunk
  4. cd ~/myproject/trunk
  5. Check out the empty subversion project from google. This will set the subversion environment for the ~/myproject/trunk folder:
    svn checkout .
    --username your-id --password your-password
  6. Start copying your actual sources to ~/myproject/trunk folder and then use the svn add command to add the content of this folder to subversion: svn add .
  7. Now set your editor via the SVN_EDITOR environment variable, e.g.
    export SVN_EDITOR=emacs
  8. Use svn commit to check in your sources.

I created a small Ruby module to read GPX files and convert them to Google maps. Here is the latest data from my GPS device. The data needs to be filtered, some of the GPX tracks have 500 points and they are so close together and one could safely eliminate a large percentage of them and still have an accurate rendition of the route. But some, like track #8, cover a long range.

Google Maps setCenter

July 9, 2007

Center 1st worksI wasted a bit of time trying to figure out why my 5 lines of Google map JavaScript was not working. I created a simple Google map to center the map on a given point and add a marker overlay. It appears that the order of setting the center and the adding the overlay is critical. In the first case, I set the center and added the overlay and the result is as expected.
Center last breaksIn the second case, if I add the overlay before I center the map, I get a blank map — and on Firefox with Firebug installed I see that following error:

this.k has no properties (main.js line 542)
L.prototype.Na=function(a){return this.k.getProjection().fromLatLngToPixel(a,thi...

Here is what the Google Map API documentation has to say about setCenter method: Sets the map view to the given center. Optionally, also sets zoom level and map type. The map type must be known to the map. See the constructor, and the method addMapType(). This method must be called first after construction to set the initial state of the map. It is an error to call other operations on the map after construction.

Here is the correct way of constructing a map:

function load() {
  if (GBrowserIsCompatible()) {
    var ct = new GLatLng(37.4419, -122.1419);
    var map = new GMap2(document.getElementById("map"));
    map.setCenter(ct, 12);
    // now add add the overlays ...
    map.addOverlay(new GMarker(ct));

Google Code – subversion & project hosting

July 4, 2007

Google CodeI was looking for a way to use a subversion repository to version control the code that I write in my spare time for fun and learning. I found a number of options that require a monthly subscription, and then I came across Google Code. I have visited Google Code page before but never noticed the link “Project Hosting” which leads to page that lets you create a new project. The Google Code project hosting is similar to SourceForge (unlike sourceforge, you don’t need to get an approval before creating a project). A project that caught my eye is the open source OCR effort called OCRopus.


Get every new post delivered to your Inbox.