예제 #1
0
 def add_overlays(self, *overlays):
     """Add overlay providers from strings `overlays`."""
     for overlay in overlays:
         try:
             self.overlays.append(poor.TileSource(overlay))
             self.overlays.sort(key=lambda x: x.z)
             poor.conf.set_add("overlays", overlay)
             self.tilecollection.clear()
         except Exception as error:
             print("Failed to load overlay '{}': {}"
                   .format(overlay, str(error)),
                   file=sys.stderr)
             poor.conf.set_remove("overlays", overlay)
예제 #2
0
 def set_basemap(self, basemap):
     """Set basemap from string `basemap`."""
     try:
         self.basemap = poor.TileSource(basemap)
         poor.conf.basemap = basemap
         self._drop_download_queues()
         self.tilecollection.clear()
     except Exception as error:
         print("Failed to load basemap '{}': {}"
               .format(basemap, str(error)),
               file=sys.stderr)
         if self.basemap is None:
             default = poor.conf.get_default("basemap")
             if default != basemap:
                 self.set_basemap(default)