Adds a layer to the map. Args: layer (object): The layer to add to the map. index (int, optional): The index at which to add the layer. Defaults to None.
(self, obj, index=None, **kwargs)
| 214 | self.set_catalog_source(kwargs["catalog_source"]) |
| 215 | |
| 216 | def add(self, obj, index=None, **kwargs) -> None: |
| 217 | """Adds a layer to the map. |
| 218 | |
| 219 | Args: |
| 220 | layer (object): The layer to add to the map. |
| 221 | index (int, optional): The index at which to add the layer. Defaults to None. |
| 222 | """ |
| 223 | if isinstance(obj, str): |
| 224 | if obj in basemaps.keys(): |
| 225 | obj = get_basemap(obj) |
| 226 | else: |
| 227 | if obj == "nasa_earth_data": |
| 228 | from .toolbar import nasa_data_gui |
| 229 | |
| 230 | nasa_data_gui(self, **kwargs) |
| 231 | elif obj == "NASA_OPERA": |
| 232 | from .toolbar import nasa_opera_gui |
| 233 | |
| 234 | nasa_opera_gui(self, **kwargs) |
| 235 | elif obj == "inspector": |
| 236 | from .toolbar import inspector_gui |
| 237 | |
| 238 | inspector_gui(self, **kwargs) |
| 239 | |
| 240 | elif obj == "stac": |
| 241 | self.add_stac_gui(**kwargs) |
| 242 | elif obj == "basemap": |
| 243 | self.add_basemap_gui(**kwargs) |
| 244 | elif obj == "inspector": |
| 245 | self.add_inspector_gui(**kwargs) |
| 246 | elif obj == "layer_manager": |
| 247 | self.add_layer_manager(**kwargs) |
| 248 | elif obj == "oam": |
| 249 | self.add_oam_gui(**kwargs) |
| 250 | return |
| 251 | |
| 252 | super().add(obj, index=index) |
| 253 | |
| 254 | if hasattr(self, "_layer_manager_widget"): |
| 255 | self.update_layer_manager() |
| 256 | |
| 257 | def set_center(self, lon, lat, zoom=None) -> None: |
| 258 | """Centers the map view at a given coordinates with the given zoom level. |
no test coverage detected