+void vik_viewport_get_min_max_lat_lon ( VikViewport *vp, gdouble *min_lat, gdouble *max_lat, gdouble *min_lon, gdouble *max_lon )
+{
+ VikCoord tleft, tright, bleft, bright;
+
+ vik_viewport_screen_to_coord ( vp, 0, 0, &tleft );
+ vik_viewport_screen_to_coord ( vp, vik_viewport_get_width(vp), 0, &tright );
+ vik_viewport_screen_to_coord ( vp, 0, vik_viewport_get_height(vp), &bleft );
+ vik_viewport_screen_to_coord ( vp, vp->width, vp->height, &bright );
+
+ vik_coord_convert(&tleft, VIK_COORD_LATLON);
+ vik_coord_convert(&tright, VIK_COORD_LATLON);
+ vik_coord_convert(&bleft, VIK_COORD_LATLON);
+ vik_coord_convert(&bright, VIK_COORD_LATLON);
+
+ *max_lat = MAX(tleft.north_south, tright.north_south);
+ *min_lat = MIN(bleft.north_south, bright.north_south);
+ *max_lon = MAX(tright.east_west, bright.east_west);
+ *min_lon = MIN(tleft.east_west, bleft.east_west);
+}
+
+void vik_viewport_reset_copyrights ( VikViewport *vp )
+{
+ g_return_if_fail ( vp != NULL );
+ g_slist_foreach ( vp->copyrights, (GFunc)g_free, NULL );
+ g_slist_free ( vp->copyrights );
+ vp->copyrights = NULL;
+}