GisPluginElev *self = _self;
struct _LoadTileData *load = g_new0(struct _LoadTileData, 1);
- load->path = gis_wms_make_local(self->wms, tile);
+ load->path = gis_wms_fetch(self->wms, tile, GIS_ONCE, NULL, NULL);
g_debug("GisPluginElev: _load_tile: %s", load->path);
load->self = self;
load->tile = tile;
load->data->bil = _load_bil(load->path);
if (!load->data->bil) {
g_remove(load->path);
+ g_free(load->data);
g_free(load->path);
g_free(load);
return;
g_thread_create(_update_tiles, self, FALSE, NULL);
}
-static gpointer _expose(GisCallback *callback, gpointer _self)
-{
- GisPluginElev *self = GIS_PLUGIN_ELEV(_self);
- g_debug("GisPluginElev: expose tiles=%p data=%p",
- self->tiles, self->tiles->data);
- if (LOAD_OPENGL)
- gis_viewer_render_tiles(self->viewer, self->tiles);
- return NULL;
-}
-
/***********
* Methods *
***********/
G_CALLBACK(_on_location_changed), self);
/* Add renderers */
- GisCallback *callback = gis_callback_new(_expose, self);
- gis_viewer_add(viewer, GIS_OBJECT(callback), GIS_LEVEL_WORLD, 0);
+ if (LOAD_OPENGL)
+ gis_viewer_add(viewer, GIS_OBJECT(self->tiles), GIS_LEVEL_WORLD, 0);
return self;
}