0

Merge branches 'config-include', 'hashchange', 'poi-polylines', 'showlocationmarker' and 'signed-timestamps'

This commit is contained in:
Aaron Griffith
2013-05-20 20:56:40 -04:00
10 changed files with 109 additions and 22 deletions

View File

@@ -219,6 +219,22 @@ def main():
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, hovertext=result)
elif type(result) == tuple:
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result[1], hovertext=result[0])
# Dict support to allow more flexible things in the future as well as polylines on the map.
elif type(result) == dict:
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result['text'])
# Use custom hovertext if provided...
if 'hovertext' in result and isinstance(result['hovertext'], basestring):
d['hovertext'] = result['hovertext']
else: # ...otherwise default to display text.
d['hovertext'] = result['text']
if 'polyline' in result and type(result['polyline']) == tuple: #if type(result.get('polyline', '')) == tuple:
d['polyline'] = []
for point in result['polyline']:
# This poor man's validation code almost definately needs improving.
if type(point) == dict:
d['polyline'].append(dict(x=point['x'],y=point['y'],z=point['z']))
if isinstance(result['color'], basestring):
d['strokeColor'] = result['color']
if "icon" in poi:
d.update({"icon": poi['icon']})
if "createInfoWindow" in poi:
@@ -231,6 +247,22 @@ def main():
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, hovertext=result)
elif type(result) == tuple:
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result[1], hovertext=result[0])
# Dict support to allow more flexible things in the future as well as polylines on the map.
elif type(result) == dict:
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result['text'])
# Use custom hovertext if provided...
if 'hovertext' in result and isinstance(result['hovertext'], basestring):
d['hovertext'] = result['hovertext']
else: # ...otherwise default to display text.
d['hovertext'] = result['text']
if 'polyline' in result and type(result['polyline']) == tuple: #if type(result.get('polyline', '')) == tuple:
d['polyline'] = []
for point in result['polyline']:
# This poor man's validation code almost definately needs improving.
if type(point) == dict:
d['polyline'].append(dict(x=point['x'],y=point['y'],z=point['z']))
if isinstance(result['color'], basestring):
d['strokeColor'] = result['color']
if "icon" in poi:
d.update({"icon": poi['icon']})
if "createInfoWindow" in poi:
@@ -243,6 +275,22 @@ def main():
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, hovertext=result)
elif type(result) == tuple:
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result[1], hovertext=result[0])
# Dict support to allow more flexible things in the future as well as polylines on the map.
elif type(result) == dict:
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result['text'])
# Use custom hovertext if provided...
if 'hovertext' in result and isinstance(result['hovertext'], basestring):
d['hovertext'] = result['hovertext']
else: # ...otherwise default to display text.
d['hovertext'] = result['text']
if 'polyline' in result and type(result['polyline']) == tuple: #if type(result.get('polyline', '')) == tuple:
d['polyline'] = []
for point in result['polyline']:
# This poor man's validation code almost definately needs improving.
if type(point) == dict:
d['polyline'].append(dict(x=point['x'],y=point['y'],z=point['z']))
if isinstance(result['color'], basestring):
d['strokeColor'] = result['color']
if "icon" in poi:
d.update({"icon": poi['icon']})
if "createInfoWindow" in poi: