static void coord_layer_marshall( VikCoordLayer *vcl, guint8 **data, gint *len );
static VikCoordLayer *coord_layer_unmarshall( guint8 *data, gint len, VikViewport *vvp );
-static gboolean coord_layer_set_param ( VikCoordLayer *vcl, guint16 id, VikLayerParamData data, VikViewport *vp );
-static VikLayerParamData coord_layer_get_param ( VikCoordLayer *vcl, guint16 id );
+static gboolean coord_layer_set_param ( VikCoordLayer *vcl, guint16 id, VikLayerParamData data, VikViewport *vp, gboolean is_file_operation );
+static VikLayerParamData coord_layer_get_param ( VikCoordLayer *vcl, guint16 id, gboolean is_file_operation );
static void coord_layer_update_gc ( VikCoordLayer *vcl, VikViewport *vp, const gchar *color );
static void coord_layer_post_read ( VikLayer *vl, VikViewport *vp, gboolean from_file );
enum { PARAM_COLOR = 0, PARAM_MIN_INC, PARAM_LINE_THICKNESS, NUM_PARAMS };
VikLayerInterface vik_coord_layer_interface = {
- "Coord",
+ N_("Coordinate"),
+ NULL,
&vikcoordlayer_pixbuf,
NULL,
(VikLayerFuncCreate) vik_coord_layer_create,
(VikLayerFuncRealize) NULL,
- coord_layer_post_read,
+ (VikLayerFuncPostRead) coord_layer_post_read,
(VikLayerFuncFree) vik_coord_layer_free,
(VikLayerFuncProperties) NULL,
(VikLayerFuncSublayerRenameRequest) NULL,
(VikLayerFuncSublayerToggleVisible) NULL,
+ (VikLayerFuncSublayerTooltip) NULL,
+ (VikLayerFuncLayerTooltip) NULL,
+ (VikLayerFuncLayerSelected) NULL,
(VikLayerFuncMarshall) coord_layer_marshall,
(VikLayerFuncUnmarshall) coord_layer_unmarshall,
(VikLayerFuncWriteFileData) NULL,
(VikLayerFuncDeleteItem) NULL,
+ (VikLayerFuncCutItem) NULL,
(VikLayerFuncCopyItem) NULL,
(VikLayerFuncPasteItem) NULL,
(VikLayerFuncFreeCopiedItem) NULL,
(VikLayerFuncDragDropRequest) NULL,
+
+ (VikLayerFuncSelectClick) NULL,
+ (VikLayerFuncSelectMove) NULL,
+ (VikLayerFuncSelectRelease) NULL,
+ (VikLayerFuncSelectedViewportMenu) NULL,
};
struct _VikCoordLayer {
static VikCoordLayer *coord_layer_unmarshall( guint8 *data, gint len, VikViewport *vvp )
{
- VikCoordLayer *rv = vik_coord_layer_new ( vvp );
+ VikCoordLayer *rv = vik_coord_layer_new ();
vik_layer_unmarshall_params ( VIK_LAYER(rv), data, len, vvp );
return rv;
}
-gboolean coord_layer_set_param ( VikCoordLayer *vcl, guint16 id, VikLayerParamData data, VikViewport *vp )
+gboolean coord_layer_set_param ( VikCoordLayer *vcl, guint16 id, VikLayerParamData data, VikViewport *vp, gboolean is_file_operation )
{
switch ( id )
{
return TRUE;
}
-static VikLayerParamData coord_layer_get_param ( VikCoordLayer *vcl, guint16 id )
+static VikLayerParamData coord_layer_get_param ( VikCoordLayer *vcl, guint16 id, gboolean is_file_operation )
{
VikLayerParamData rv;
switch ( id )
max.lat = (topleft.lat > topright.lat) ? topleft.lat : topright.lat;
}
+ /* Can zoom out more than whole world and so the above can give invalid positions */
+ /* Restrict values properly so drawing doesn't go into a near 'infinite' loop */
+ if ( min.lon < -180.0 )
+ min.lon = -180.0;
+ if ( max.lon > 180.0 )
+ max.lon = 180.0;
+ if ( min.lat < -90.0 )
+ min.lat = -90.0;
+ if ( max.lat > 90.0 )
+ max.lat = 90.0;
+
lon = ((double) ((long) ((min.lon)/ vcl->deg_inc))) * vcl->deg_inc;
ll.lon = ll2.lon = lon;