abidinamdar / gmapcatcher

Automatically exported from code.google.com/p/gmapcatcher
1 stars 0 forks source link

GMaps Hybrid Tile URL learning sometimes broken #260

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
 1. Start program, view anything in hybrid tiles. 
 2. If lucky, you won't see hybrid tiles, but one sat image overlaid over another sat image.
 3. If unlucky, try restarting. It didn't work 90% of the time, but 10% of the time

What version of the product are you using? On what operating system?
0.7.5.0 ubuntu

Please provide any additional information below.

I gave some time debugging this. In googleMaps.py there are two regular 
expression alternatives (second alternative is a list of 3 URL patterns).

It seems that if google returns the home page for the first alternative, hybrid 
maps work (the regular expression has "Hybrid" in it so it gets the right URL).

If google returns a home page with the second alternative, the code selects the 
satellite URL. I fixed this by overriding the URL pattern list (so satellite 
urls disappear) if requested type is Hybrid:

    # List of patterns add more as needed
    paList = ['http://([a-z]{2,3})[0-9].google.com/([a-z]+)[?/]v=([a-z0-9.]+)&',
              'http://([a-z]{2,3})[0-9].google.com/([a-z]+)[?/]lyrs=([a-z@0-9.]+)&',
              'http://([a-z]{2,3})[0-9].google.com/([a-z]+)[?/]v\\\\x3d([a-z0-9.]+)\\\\x26']

    if layer == LAYER_HYBRID:
        paList = ['http://([a-z]{2,3})[0-9].google.com/([a-z]+)[?/]lyrs=([a-z@0-9.]+)&']

    for srtPattern in paList:

I have no idea why google returns different home pages, but second type of 
homepage is more common in my case. I'm not sure if the "lyrs=" URL is the only 
hybrid one, but it works for now

Original issue reported on code.google.com by wast...@gmail.com on 18 Feb 2011 at 2:10

GoogleCodeExporter commented 8 years ago
Thanks for your detailed report! we have some issues with GOOG, you might want 
to read Issue 210, specially the last 2 comments on that thread.

Original comment by heldersepu on 18 Feb 2011 at 1:11

GoogleCodeExporter commented 8 years ago

Original comment by heldersepu on 13 Oct 2011 at 8:44