here.inspector.ipyleaflet package
here.inspector.ipyleaflet package
An inspector for the HERE PySDK based on ipyleaflet.
class here.inspector.ipyleaflet.IpyleafletInspector
Bases: Inspector
An inspector based on ipyleaflet.
add_features(features: GeoSeries | GeoDataFrame | BaseGeometry | Iterable[BaseGeometry] | Iterable[Tuple[BaseGeometry, Dict[str, Any]]] | Dict[str, Any] | Iterable[Dict[str, Any]] | None = None, name=None, style: Color | Dict | None = None, hover_style: Color | Dict | None = None, point_style: Color | Dict | None = None) IpyleafletInspector
Add to the inspector a collection of map features (attributed geometries) as new layer.
The features layer can be named and styled.
Parameters:
-
features –
the attributed geometries to render. Supported types: -
gpd.GeoSeries, unattributed geometries -gpd.GeoDataFrame, attributes geometries -BaseGeometry, individual geometries -Iterableof BaseGeometry, it can be any containerbut also a
Generatorof unattributed geometries-
Iterableof pair ofBaseGeometryandDict, it can be any container
but also aGeneratorof geometries paired with attributes -
Dicta parsed GeoJSONFeatureCollectionorFeature -
Iterableof parsed GeoJSON Feature, it can be any container
but also aGeneratorof parsed GeoJSON features
-
-
name – an optional name to assign to the layer
-
style – an optional style for the features. If not present, a default one is picked. It can be a generic inspector style, as defined in
here.inspector.styles, or directly an ipyleaflet style dictionary. -
hover_style – an optional hover style. If not present, a default one is picked, based on
style. It can be a generic inspector style, as defined inhere.inspector.styles, or directly an ipyleaflet style dictionary. -
point_style – an optional point style. If not present, a default one is picked, based on
style. It can be a generic inspector style, as defined inhere.inspector.styles, or directly an ipyleaflet style dictionary.
Returns:
self, for further chaining
add_tiles(tiles: Series | Iterable[int] | None = None, name=None, style: Color | Dict | None = None, hover_style: Color | Dict | None = None) IpyleafletInspector
Add to the inspector a tiling grid as new layer.
The grid can be a complete grid or contain only some tiles. The grid layer can be named and styled.
Parameters:
-
tiles – the identifier of the tiles to render. Supported types: -
pd.Seriesof tile identifiers -Iterableof tile identifiers, it can be any container but also aGenerator-Noneadd the complete grid of all the tiles defined by the tiling scheme -
name – an optional name to assign to the layer
-
style – an optional style for the tiling grid. If not present, a default one is picked. It can be a generic inspector style, as defined in
here.inspector.styles, or directly an ipyleaflet style dictionary. -
hover_style – an optional hover style. If not present, a default one is picked, based on
style. It can be a generic inspector style, as defined inhere.inspector.styles, or directly an ipyleaflet style dictionary.
Returns:
self, for further chaining
Return the inspector’s backend, in this case its Map object.
The backend is populated with the features, tiling grids and settings specified so far. Users can further configure the Map, but also UI components, according to the ipyleaflet documentation.
Returns:
The ipyleaflet.Map object created by the inspector
Raises:
ValueError – in case the backend can’t be configured with the data provided
set_basemap(basemap: dict | TileProvider | None = None) Inspector
Set a custom basemap to use as a background.
This overrides the default base map of the theme, if any is defined. Setting it to None restores the default base map.
Parameters:
basemap – Either a dictionary or an object of class:xyzservices.lib.TileProvider.
Returns:
``self`, for further chaining
set_center(center: Point) IpyleafletInspector
Configure the location to show in the inspector when opened.
If not set, an optimal starting location is calculated from the features and tiling grids.
Parameters:
center – the center point of the map
Returns:
self, for further chaining
set_colors(colors: List[Color] | None = None) IpyleafletInspector
Set the list of colors the inspector cycles through to render content when no color or style is specified.
The default color list can be overridden in here.inspector.options.default_colors.
Parameters:
colors – a non-empty list of colors
Returns:
self, for further chaining
set_theme(theme: Theme | None = None) IpyleafletInspector
Set the inspector theme.
This determines the background map, if any, and colors. The default theme can be overridden in here.inspector.options.default_theme.
Parameters:
theme – one of the predefined inspector themes
Returns:
self, for further chaining
set_zoom(zoom: int) IpyleafletInspector
Configure the starting zoom level of the inspector.
If not set, an optimal starting zoom level is calculated from the geodata and tiling grids.
Parameters:
zoom – the zoom level, from 0 to 31
Returns:
self, for further chaining
Show the inspector in a Jupyter notebook with the features and tiles loaded so far.
Returns:
The ipyleaflet.Map object created by the inspector