static void trw_layer_marshall( VikTrwLayer *vtl, guint8 **data, gint *len );
static VikTrwLayer *trw_layer_unmarshall( guint8 *data, gint len, VikViewport *vvp );
-static gboolean trw_layer_set_param ( VikTrwLayer *vtl, guint16 id, VikLayerParamData data, VikViewport *vp );
-static VikLayerParamData trw_layer_get_param ( VikTrwLayer *vtl, guint16 id );
+static gboolean trw_layer_set_param ( VikTrwLayer *vtl, guint16 id, VikLayerParamData data, VikViewport *vp, gboolean is_file_operation );
+static VikLayerParamData trw_layer_get_param ( VikTrwLayer *vtl, guint16 id, gboolean is_file_operation );
static void trw_layer_del_item ( VikTrwLayer *vtl, gint subtype, gpointer sublayer );
static void trw_layer_copy_item ( VikTrwLayer *vtl, gint subtype, gpointer sublayer, guint8 **item, guint *len );
}
}
-static gboolean trw_layer_set_param ( VikTrwLayer *vtl, guint16 id, VikLayerParamData data, VikViewport *vp )
+static gboolean trw_layer_set_param ( VikTrwLayer *vtl, guint16 id, VikLayerParamData data, VikViewport *vp, gboolean is_file_operation )
{
switch ( id )
{
return TRUE;
}
-static VikLayerParamData trw_layer_get_param ( VikTrwLayer *vtl, guint16 id )
+static VikLayerParamData trw_layer_get_param ( VikTrwLayer *vtl, guint16 id, gboolean is_file_operation )
{
VikLayerParamData rv;
switch ( id )
if ( drawpoints && dp->vtl->coord_mode == VIK_COORD_UTM && tp->coord.utm_zone != dp->center->utm_zone )
draw_utm_skip_insignia ( dp->vp, main_gc, x, y);
- if ( dp->vtl->drawmode == DRAWMODE_BY_VELOCITY )
+ if ( dp->vtl->drawmode == DRAWMODE_BY_VELOCITY ) {
dp->track_gc_iter = calculate_velocity ( dp->vtl, tp, tp2 );
+ main_gc = g_array_index(dp->vtl->track_gc, GdkGC *, dp->track_gc_iter);
+ }
if (!useoldvals)
vik_viewport_coord_to_screen ( dp->vp, &(tp2->coord), &oldx, &oldy );
if ( dp->vtl->coord_mode != VIK_COORD_UTM || tp->coord.utm_zone == dp->center->utm_zone )
{
vik_viewport_coord_to_screen ( dp->vp, &(tp->coord), &x, &y );
- if ( dp->vtl->drawmode == DRAWMODE_BY_VELOCITY )
+ if ( dp->vtl->drawmode == DRAWMODE_BY_VELOCITY ) {
dp->track_gc_iter = calculate_velocity ( dp->vtl, tp, tp2 );
+ main_gc = g_array_index(dp->vtl->track_gc, GdkGC *, dp->track_gc_iter);
+ }
if ( drawing_white_background )
vik_viewport_draw_line ( dp->vp, dp->vtl->track_bg_gc, oldx, oldy, x, y);
return TRUE;
}
+ if ( !vtl->vl.visible || !vtl->waypoints_visible )
+ return FALSE;
+
if ( vtl->current_wp && vtl->current_wp->visible )
{
/* first check if current WP is within area (other may be 'closer', but we want to move the current) */
if (!vtl || vtl->vl.type != VIK_LAYER_TRW)
return FALSE;
+ if ( !vtl->vl.visible || !vtl->tracks_visible )
+ return FALSE;
+
if ( vtl->current_tpl )
{
/* first check if it is within range of prev. tp. and if current_tp track is shown. (if it is, we are moving that trackpoint.) */
new_map = TRUE;
}
- /* fill-ins for far apart points */
- GList *cur_rect, *next_rect;
GList *fillins = NULL;
- for (cur_rect = rects_to_download;
- (next_rect = cur_rect->next) != NULL;
- cur_rect = cur_rect->next) {
- if ((wh.lon < ABS(GLRECT(cur_rect)->center.east_west - GLRECT(next_rect)->center.east_west)) ||
- (wh.lat < ABS(GLRECT(cur_rect)->center.north_south - GLRECT(next_rect)->center.north_south))) {
- fillins = add_fillins(fillins, &GLRECT(cur_rect)->center, &GLRECT(next_rect)->center, &wh);
+ /* 'fillin' doesn't work in UTM mode - potentially ending up in massive loop continually allocating memory - hence don't do it */
+ /* seems that ATM the function get_next_coord works only for LATLON */
+ if ( cur_coord->mode == VIK_COORD_LATLON ) {
+ /* fill-ins for far apart points */
+ GList *cur_rect, *next_rect;
+ for (cur_rect = rects_to_download;
+ (next_rect = cur_rect->next) != NULL;
+ cur_rect = cur_rect->next) {
+ if ((wh.lon < ABS(GLRECT(cur_rect)->center.east_west - GLRECT(next_rect)->center.east_west)) ||
+ (wh.lat < ABS(GLRECT(cur_rect)->center.north_south - GLRECT(next_rect)->center.north_south))) {
+ fillins = add_fillins(fillins, &GLRECT(cur_rect)->center, &GLRECT(next_rect)->center, &wh);
+ }
}
- }
+ } else
+ g_message("%s: this feature works only in Mercator mode", __FUNCTION__);
if (fillins) {
GList *iter = fillins;