static void
champlain_map_source_init (ChamplainMapSource *champlainMapSource)
{
- ChamplainMapSourcePrivate *priv = GET_PRIVATE (champlainMapSource);
+ //ChamplainMapSourcePrivate *priv = GET_PRIVATE (champlainMapSource);
}
gint
champlain_map_source_get_row_count (ChamplainMapSource *map_source,
gint zoom_level)
{
- ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
+ //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
// FIXME: support other projections
return pow (2, zoom_level);
}
champlain_map_source_get_column_count (ChamplainMapSource *map_source,
gint zoom_level)
{
- ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
+ //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
// FIXME: support other projections
return pow (2, zoom_level);
}
gint zoom_level,
guint x)
{
- ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
+ //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
// FIXME: support other projections
gdouble dx = (float)x / champlain_map_source_get_tile_size (map_source);
return dx / pow (2.0, zoom_level) * 360.0 - 180;
gint zoom_level,
guint y)
{
- ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
+ //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
// FIXME: support other projections
gdouble dy = (float)y / champlain_map_source_get_tile_size (map_source);
double n = M_PI - 2.0 * M_PI * dy / pow (2.0, zoom_level);
void
champlain_map_source_set_name (ChamplainMapSource *map_source,
- char *name)
+ const char *name)
{
ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source);
void champlain_map_source_get_tile (ChamplainMapSource *map_source,
ChamplainView *view, ChamplainZoomLevel *level, ChamplainTile *tile);
+void champlain_map_source_set_name (ChamplainMapSource *map_source,
+ const char *name);
+
#endif
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <glib.h>
+#include <glib/gprintf.h>
#include <glib-object.h>
#include <libsoup/soup.h>
#include <math.h>
}
ChamplainMapSource *
-champlain_map_source_new_osm_mapnik ()
+champlain_map_source_new_osm_mapnik (void)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full ("OpenStreetMap Mapnik",
"(CC) BY 2.0 OpenStreetMap contributors",
}
ChamplainMapSource *
-champlain_map_source_new_oam ()
+champlain_map_source_new_oam (void)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full ("OpenArialMap",
"(CC) BY 3.0 OpenArialMap contributors",
}
ChamplainMapSource *
-champlain_map_source_new_mff_relief ()
+champlain_map_source_new_mff_relief (void)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full ("MapsForFree Relief",
"Map data available under GNU Free Documentation license, Version 1.2 or later",
ChamplainZoomLevel *level,
ChamplainTile *tile)
{
- ChamplainNetworkMapSourcePrivate *priv = GET_PRIVATE (network_map_source);
+ //ChamplainNetworkMapSourcePrivate *priv = GET_PRIVATE (network_map_source);
return g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S
"%s" G_DIR_SEPARATOR_S "%d" G_DIR_SEPARATOR_S
"%d" G_DIR_SEPARATOR_S "%d.png", g_get_user_cache_dir (),
CACHE_SUBDIR, champlain_map_source_get_name (CHAMPLAIN_MAP_SOURCE (network_map_source)),
champlain_zoom_level_get_zoom_level (level),
- champlain_tile_get_x (tile), champlain_tile_get_y (tile),
- NULL);
+ champlain_tile_get_x (tile), champlain_tile_get_y (tile));
}
typedef struct {
FileLoadedCallbackContext *ctx = (FileLoadedCallbackContext*) user_data;
GdkPixbufLoader* loader;
GError *error = NULL;
- gchar* path, *filename;
+ gchar* path = NULL, *filename = NULL;
if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
gchar *license, gchar *license_uri, guint min_zoom, guint map_zoom,
guint tile_size, ChamplainMapProjection projection, gchar *uri_format);
-ChamplainMapSource * champlain_map_source_new_osm_mapnik ();
-ChamplainMapSource * champlain_map_source_new_oam ();
-ChamplainMapSource * champlain_map_source_new_mff_relief ();
+ChamplainMapSource * champlain_map_source_new_osm_mapnik (void);
+ChamplainMapSource * champlain_map_source_new_oam (void);
+ChamplainMapSource * champlain_map_source_new_mff_relief (void);
gchar * champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *source,
gint x, gint y, gint z);