Merge branches 'config-include', 'hashchange', 'poi-polylines', 'showlocationmarker' and 'signed-timestamps'
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user