Tile sources as param widgets
See original GitHub issueI wrote this bit of code so that I can display the tile sources as widgets. It seems like it might be useful in geoviews itself:
import geoviews as gv
import geoviews.tile_sources as gvts
import param
import panel as pn
class GVTS(param.Parameterized):
source = param.ObjectSelector(default=list(gvts.tile_sources.keys())[0], objects=list(gvts.tile_sources.keys()), label='Web Map Tile Services')
def widget(self):
return pn.panel(self.param, parameters=['source'])
@param.depends('source')
def view(self):
return gvts.tile_sources[self.source]
def panel(self):
return pn.Column(self.widget, self.view)
I’m not super happy with the syntax on the tile sources in the ObjectSelector. I wanted to do something like this:
source = param.ObjectSelector(default=gvts.tile_sources['EsriImagery'], objects=gvts.tile_sources, label='Web Map Tile Services')
But that gave me extra widgets that I didn’t want to expose to the user and I couldn’t see a way around it. I suspect its due to the use of dict as ObjectSelector.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Custom Widgets Dictionary - XWiki - the EasyVista Wiki
When you use a Custom Widget, the related data sources are automatically created. Check that they are well formed (all parameters correctly ...
Read more >ListTile class - material library - Flutter - Dart API docs
A list tile contains one to three lines of text optionally flanked by icons or other widgets, such as check boxes. The icons...
Read more >Add tms and zoomOffset options to TileLayer #31 - GitHub
I'm trying to use some tiles I generated with custom maps. ... TileLayer cannot change all the parameter leaflet.tilelayer (here) would accept.
Read more >Catalog of Out Of Box widgets you can add to a dashboard
Widgets display information and charts on dashboards. Many widgets are configurable or are scoped to a team or to the logged in user...
Read more >Built-in Widgets - Qtile Docs
If the change_command parameter is set to None, the widget will attempt to use ... .org/user_builds/qtile/checkouts/latest/libqtile/resources/battery-icons'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just came across this issue and think it should be closed. Unless someone wants to add a snippet to the docs. Here is an (arguably) simpler version using
@pn.depends
I’m a bit confused; to me the grabcut.py files seem messy because they are using string URLs rather than
gvts.tile_sources
, but that’s a matter of updating grabcut.py rather than GeoViews. I’m not able to see just what would go into GeoViews that would be reusable, beyondtile_sources
that’s already in GeoViews. I must be missing something?