Wednesday, February 16, 2005

Can Google Maps show the world?

Michal Guerquin attempts to estimate the storage capacity of Google Maps in How big is the world?, and extrapolates for the capacity needed to show the whole world.

He concludes:

Assuming a modest 1 byte/6 pixels compression ratio for LZW-encoded GIF format tiles, the storage required would be 50-70 trillion pixels * (1 byte/6 pixels) = 8 to 11 TB.

Tuesday, February 15, 2005

Hacking Google Maps, continued

Follower commented on my previous post and pointed to the latest in Google Maps hacking, which is injecting external scripts into Google Maps page using the Inject External File Bookmarklet.

This is exactly what Greasemonkey does and, I might add, in a much more automatic fashion.

So, I took Follower's RouteFollow script and, with a few modifications, made a Greasemonkey user script out of it.

Here's the Google Maps Route Follow -- Greasemonkey user script. To run this, first Greasemonkey extension needs to be installed. Then (after restarting Firefox), right click on the user script link and select Install User Script.

Monday, February 14, 2005

GoogleMapsHacking Wiki

Wikified Google Maps Hacking page

Hacking Google Maps

There's been a flurry of hacking as soon as Google Maps (beta!)was released. There was the usual analysis of how the whole thing was being pulled off by Google.

Then the real hacking began.

First, there were bookmarklets by "follower", to pan the map automatically to follow the route, and then moving an image of little man along the path. Several others chipped in with improved versions replacing the man with a spider. But the man and the spider were pretty slow.

Then, there was another version to map the route in a faster and smoother fashion from Ayhan Ergul.

I noticed that after I ran this bookmarklet, the links on the map were non-functional due to javascript varibale name conflict. The bookmarklet was using a variable d. Google Maps' javascript code also uses the same name for an object and the bookmarklet's variable overwrites Google's.

Replacing the variable name in the bookmarklet code by any other unique name fixes this problem. Ergul's site doesn't have any email address to notify him.

Here's the bookmarklet (All I did was replace the variable d with dd). Blogger doesn't seem to accept javascript: links, so here's the code all in its raw glory:

javascript:(function(){if(!_m.map.me){_m.map.me=_m.map.createLocationMarker('http://libgmail.sourceforge.net/man.png',N.get('local'));}_m.map.timeSlice=60;_m.map.totalTime=3000;_m.map.sliceCount=_m.map.totalTime/_m.map.timeSlice;_m.map.totalDistance=0;_m.map.c3=new Object();p=_m.map.directions.polyline;_m.map.cumDistance=new Array(p.numPoints);_m.map.cumDistance[0]=0;c1=p.getPoint(0);for(i=1;i<p.numPoints;i++){c2=p.getPoint(i);_m.map.cumDistance[i]=_m.map.cumDistance[i-1]+Math.sqrt(Math.pow(c2.x-c1.x,2)+Math.pow(c2.y-c1.y,2));c1=c2;}_m.map.speed=_m.map.cumDistance[p.numPoints-1]/_m.map.sliceCount;mv=function(i){p=_m.map.directions.polyline;j=0;while(_m.map.cumDistance[j+1]<(i*_m.map.speed)){j++;}c1=p.getPoint(j);c2=p.getPoint(j+1);dd=_m.map.cumDistance[j+1]-_m.map.cumDistance[j];if(dd){l=(i*_m.map.speed)-_m.map.cumDistance[j];_m.map.c3.x=c2.x-(c2.x-c1.x)*(dd-l)/dd;_m.map.c3.y=c2.y-(c2.y-c1.y)*(dd-l)/dd;}else{_m.map.c3.x=c2.x;_m.map.c3.y=c2.y;}_m.map.recenterOrPanToLatLng(_m.map.c3);_m.map.setMarkerPosition(_m.map.me,N.get('local'),_m.map.c3);if(i<_m.map.sliceCount){window.setTimeout('mv('+(i+1)+')',_m.map.timeSlice);}else{_m.map.me.hide();}};_m.map.me.show();mv(1);})();

And, the fixed up code formatted nicely (copied from Ergul's site and fixed up).

javascript:
(function ()
{
    if (!_m.map.me)
    {
        _m.map.me = _m.map.createLocationMarker('http://libgmail.sourceforge.net/man.png', N.get('local'));
    } 
    _m.map.timeSlice = 60;
    _m.map.totalTime = 3000;
    _m.map.sliceCount = _m.map.totalTime/_m.map.timeSlice;
    _m.map.totalDistance = 0;
    p = _m.map.directions.polyline;
    for (i=0; i<p.numPoints-1; i++)
    {
        c1 = p.getPoint(i);
        c2 = p.getPoint(i+1);
        _m.map.totalDistance += Math.sqrt(Math.pow(c2.x-c1.x, 2)+Math.pow(c2.y-c1.y, 2));
    }
    _m.map.speed = _m.map.totalDistance/_m.map.sliceCount;
    mv = function(i) 
    { 
        p = _m.map.directions.polyline;
        travelled = 0;
        j = 0;
        while(1)
        {
            c1 = p.getPoint(j);
            c2 = p.getPoint(j+1);
            dd=Math.sqrt(Math.pow(c2.x-c1.x, 2)+Math.pow(c2.y-c1.y, 2));
            if((travelled+dd) >= (i*_m.map.speed))
                break;
            travelled += dd;
            j += 1;
        }
        _m.map.setMarkerPosition(_m.map.me, N.get('local'), c1);
        if(i%3==0)
            _m.map.recenterOrPanToLatLng(c1);
        if (i < _m.map.sliceCount) 
        {
            window.setTimeout('mv('+(i+1) + ')',_m.map.timeSlice);
        } 
        else 
        {
            _m.map.me.hide()
        }
    };
    _m.map.me.show();
    mv(0);
}
)();

Friday, February 11, 2005

Google Maps find Weapons of Mass Destruction

Arve Bersvendsen discovered how all-powerful and all-knowing Google is! Google Maps find Weapons of Mass Destruction

Thursday, February 10, 2005

Mapping Google

Nice explanation of how Google Maps were done. as simple as possible, but no simpler: Mapping Google

Wednesday, February 09, 2005

Workaround for IDN Spoofing Issue

Adblock (an excellent Firefox extension) comes to the rescue for fixing the IDN spoofing vulnerability.

  1. Enable Site Blocking in Adblock Preferences.
  2. Add the following filter: /[^\x20-\xFF]/

That's it!

Tech.Life.Blogged | Workaround for IDN Spoofing Issue

Google raises the bar, again!

I love Google Maps (currently in beta).

I have been a long-time user of Yahoo! Maps and like it for their trademark minimal look without all the crap compared to other mapping sites. I also like their SmartView feature, where local businesses on the map are highlighted. But Google Maps won me over. It looks like they get their from NavTeq (same as Yahoo).

Things I like:

  • The maps look much clearer with all the roads and names marked clearly and pleasant looking.
  • CLick and drag in any direction. The usual navigation-by-arrow-buttons is still available.
  • Zooming of source and destination points in place. Love the bubbles and the dropshadow is cool.
  • Click on any step in the directions and that turn is zoomed and highlighted.
  • Bigger maps. Map fills the available space vertically.
  • One search field instead of many fields for different address parts.
  • Find local businesses or places using in or near modifiers.
  • Ingenious use of CSS, DHTML and XMLHttpRequest.
  • I am sure there are other that I missed out.

Things I don't like or things missing? Can't say I found anything yet. But it's too early.

Look out, Yahoo! You have work to do.

(Not quite) Permanent Fix for the Shmoo Group exploit

It appears that the suggested about:config fix for the IDN exploit is not permanent. Tech.Life.Blogged talks about a Permanent Fix for the Shmoo Group exploit, but updates that this "permanent" fix is doesn't stick after installing a new extension.

Let's see how long it takes for the Mozilla folks to come up with a real fix.

Monday, February 07, 2005

Phishing using Unicode

Beware of Unicode characters in URLs. Mozilla/Firefox has a workaround by setting a config parameter.

Ironically, IE doesn't let this attack through due to its inadequate support for Internationalized Domain Names.

Courtesy Jason

Thursday, February 03, 2005

Wired on Firefox

Wired magazine has a cover story The Firefox Explosion with Blake Ross on the cover.