View Single Post
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#9
Originally Posted by kempja View Post
I realised that I should have posted that here. Anyone any idea whether a URL can be deciphered from the above for Michelin Maps? - they have good coverage of Europe....

Ta.
Not without making modifications to Maemo Mapper. I investigated ViaMichelin's website, and its PNG files are accessed using complex, encoded URLs that look something like this:

http://m1.viamichelin.com/mapsgene/dm/mapdirect
;d29yXzAwMjRt;MDAwMDAwMDAxMjAwMDAwMDAwMTA=

The part after the semicolon presumably identifies a bitmap (254x254 pixels, which is weird). Now, the website uses javascript, and although it's heavily obfuscated, in theory the algorithm for generating one of those identifiers is buried somewhere in that javascript code. The same algorithm could be used in Maemo Mapper to translate between lat/lon and ViaMichelin's codified ID, but I'm not really motivated enough to sift through the mounds of javascript.

By the way, if you ever come across an online map that you'd like to use in Maemo Mapper, I am always open to the possibility of adding new types of URLs. All you need to give me is an easy way to map a Maemo Mapper coordinate (x, y, zoom) into the URL. Most URLs have their own quirky style of encoding, some of them more obfuscated than others. For example, Google Maps Satellite uses a qrst-encoded quadtree URL, whereas Virtual Earth uses a 0123-encoded quadtree URL, so the code in Maemo Mapper to handle each is similar, just tweaked slightly for each source.

Firefox has this great utility for spying on exactly what images a website pulls in. For example, go to Google Maps and use the "Tools | Page Info" menu item in Firefox. The "Media" tab contains a list of all media pulled in by the page, including images. In the case of Google Maps, there are a bunch of "mt1.google.com"-style URLs that reveal exactly the URL format that Google Maps uses to retrieve its bitmaps. This is how Maemo Mapper first came into being.

Back in the olden days, MapQuest didn't even have an AJAX-ified website, so you couldn't use the "Page Info" trick used for Google Maps. Nowadays, however, MapQuest uses a completely different URL format. When you use Firefox's Page Info tool, you see a bunch of URLs like "http://tile3.mqcdn.com/map/Scale29337258/0/5/0/2.gif", where "ScaleXXXXX" maps somewhat to Google Maps's "zoom=" variable, and the "5" and "2" map to the X and Y coordinates of the map.

So, it might be possible to write an algorithm that translates "5, 2, 29337258" into Maemo Mapper's "x, y, zoom" format. Unfortunately, I think MapQuest uses a projection other than Mercator, and the scales don't cleanly match between Mercator and MapQuest, which makes it difficult, perhaps even impossible, to use in Maemo Mapper. It just takes some investigation...

P.S. kempja: would you mind removing the "script" code from your post, or at least break it up into smaller lines? It causes the page to render poorly in most browsers.

Last edited by gnuite; 2007-03-19 at 17:36.