Home | Trees | Indices | Help |
---|
|
Encode a list of lat,lon points in the base64 format that Google Maps understands.
This is code (very) gratefully borrowed from the bycycle.org project. All credit goes to them. I simply took advantage of their good work.
|
|||
string ,string
|
|
||
string , int
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
threshold = 1e-05
|
|||
num_levels = 4
|
|||
zoom_factor = 32
|
|||
zoom_level_breaks =
|
|||
__package__ =
|
|||
i = 3
|
|
Encode a set of lat/long points. Generate:
Example: >>> pairs = ((38.5, -120.2), (43.252, -126.453), (40.7, -120.95)) >>> encode_pairs(pairs) ('_p~iF~ps|U_c_\\fhde@~lqNwxq`@', 'BBB')
|
Encode a single latitude or longitude. Example: >>> x = -179.9832104 >>> encoded_x, prev = encode_lat_or_long(x, 0) >>> encoded_x '`~oia@' >>> prev -17998321 >>> x = -120.2 >>> encode_lat_or_long(x, prev) ('al{kJ', -12020000)
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat May 1 23:03:30 2010 | http://epydoc.sourceforge.net |