Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
except GPXXMLSyntaxException:
return None
pts = [p.point for p in trace.get_points_data()]
bbox = trace.get_bounds()
mins = (bbox.min_latitude, bbox.min_longitude)
maxs = (bbox.max_latitude, bbox.max_longitude)
bbox = mins, maxs
center = list(bbox_center(*bbox))
z = zoom_for_bbox(*(mins + maxs))
m = ipyleaflet.Map(center=center, zoom=z + 1)
# FIXME: make path styling configurable
poly = ipyleaflet.Polyline(locations=[(p.latitude, p.longitude)
for p in pts], fill=False)
m.add_layer(layer=poly)
for p in pts:
cm = ipyleaflet.CircleMarker(location=(p.latitude, p.longitude), radius=5)
m.add_layer(layer=cm)
self.data = m
return m
for i,k in enumerate(keyValues):
if i > 0:
key += "."
if k in value:
key += value[k]
keys.append(key)
if key in self._markers:
marker = self._markers[key]
else:
if self._icon != None:
icon = maps.Icon(icon_url=self._icon,icon_size=[40,30])
marker = maps.Marker(icon=icon)
else:
marker = maps.CircleMarker()
marker.stroke = border
marker.fill_opacity = opacity
self._map.add_layer(marker)
self._markers[key] = marker
if len(popup) > 0:
marker.popup = widgets.HTML()
if self._lat in value and self._lon in value:
lat = value[self._lat]
lon = value[self._lon]
marker.location = (lat,lon)
if tracking and center == None:
center = marker.location