~ubuntu-branches/ubuntu/natty/libchamplain/natty

« back to all changes in this revision

Viewing changes to champlain/champlain-map-source-factory.c

  • Committer: Bazaar Package Importer
  • Author(s): Sjoerd Simons, Laurent Bigonville, Sjoerd Simons
  • Date: 2009-09-15 00:01:41 UTC
  • mfrom: (1.1.3 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090915000141-i8fg5n1t02zxo79m
Tags: 0.4.0-1
[ Laurent Bigonville ]
* debian/control: Add libchamplain-0.3-dev dependency to
  libchamplain-gtk-0.3-dev

[ Sjoerd Simons ]
* New upstream release (0.4.0)

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
  };
202
202
 
203
203
static
 
204
ChamplainMapSourceDesc OSM_TRANSPORTMAP_DESC =
 
205
  {
 
206
    CHAMPLAIN_MAP_SOURCE_OSM_TRANSPORT_MAP,
 
207
    "OpenStreetMap Transport Map",
 
208
    "(CC) BY 2.0 OpenStreetMap contributors",
 
209
    "http://creativecommons.org/licenses/by/2.0/",
 
210
    0,
 
211
    18,
 
212
    CHAMPLAIN_MAP_PROJECTION_MERCATOR,
 
213
    champlain_map_source_new_generic,
 
214
       "http://tile.xn--pnvkarte-m4a.de/tilegen/#Z#/#X#/#Y#.png",
 
215
    NULL
 
216
  };
 
217
 
 
218
#if 0
 
219
/* Disabling until OpenArealMap works again */
 
220
static
204
221
ChamplainMapSourceDesc OAM_DESC =
205
222
  {
206
223
    CHAMPLAIN_MAP_SOURCE_OAM,
214
231
    "http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/#Z#/#X#/#Y#.jpg",
215
232
    NULL
216
233
  };
 
234
#endif
217
235
 
218
236
static
219
237
ChamplainMapSourceDesc MFF_RELIEF_DESC =
243
261
      OSM_MAPNIK_DESC.constructor, OSM_MAPNIK_DESC.data);
244
262
  champlain_map_source_factory_register (factory, &OSM_CYCLEMAP_DESC,
245
263
      OSM_CYCLEMAP_DESC.constructor, OSM_CYCLEMAP_DESC.data);
 
264
  champlain_map_source_factory_register (factory, &OSM_TRANSPORTMAP_DESC,
 
265
      OSM_TRANSPORTMAP_DESC.constructor, OSM_TRANSPORTMAP_DESC.data);
246
266
  champlain_map_source_factory_register (factory, &OSM_OSMARENDER_DESC,
247
267
      OSM_OSMARENDER_DESC.constructor, OSM_OSMARENDER_DESC.data);
 
268
#if 0
248
269
  champlain_map_source_factory_register (factory, &OAM_DESC,
249
270
      OAM_DESC.constructor, OAM_DESC.data);
 
271
#endif
250
272
  champlain_map_source_factory_register (factory, &MFF_RELIEF_DESC,
251
273
      MFF_RELIEF_DESC.constructor, MFF_RELIEF_DESC.data);
252
274
}
254
276
/**
255
277
 * champlain_map_source_factory_dup_default:
256
278
 *
257
 
 * Returns the singleton #ChamplainMapSourceFactory, it should be freed
 
279
 * Returns: the singleton #ChamplainMapSourceFactory, it should be freed
258
280
 * using #g_object_unref when not needed.
259
281
 *
260
282
 * Since: 0.4
265
287
  return g_object_new (CHAMPLAIN_TYPE_MAP_SOURCE_FACTORY, NULL);
266
288
}
267
289
 
268
 
ChamplainMapSourceFactory *
269
 
champlain_map_source_factory_get_default (void)
270
 
{
271
 
  return champlain_map_source_factory_dup_default ();
272
 
}
273
 
 
274
290
/**
275
291
 * champlain_map_source_factory_dup_list:
276
292
 *
277
 
 * Returns the list of registered map sources, the items should not be freed,
 
293
 * Returns: the list of registered map sources, the items should not be freed,
278
294
 * the list should be freed with #g_slist_free.
279
295
 *
280
296
 * Since: 0.4
285
301
  return g_slist_copy (factory->priv->registered_sources);
286
302
}
287
303
 
288
 
GSList *
289
 
champlain_map_source_factory_get_list (ChamplainMapSourceFactory *factory)
290
 
{
291
 
  return champlain_map_source_factory_dup_list (factory);
292
 
}
293
 
 
294
304
/**
295
305
 * champlain_map_source_factory_create:
296
306
 * @factory: the Factory
297
307
 * @id: the wanted map source id
298
308
 *
299
 
 * Returns a ready to use #ChamplainMapSource matching the given name, returns
 
309
 * Returns: a ready to use #ChamplainMapSource matching the given name, returns
300
310
 * NULL is none match.
301
311
 *
302
312
 * The id should not contain any character that can't be in a filename as it
324
334
 
325
335
/**
326
336
 * champlain_map_source_factory_register:
 
337
 * @factory: A #ChamplainMapSourceFactory
327
338
 * @desc: the description of the map source
328
339
 * @constructor: the new map source constructor function
329
340
 * @data: data to be passed to the constructor function, or NULL
334
345
 * #ChamplainMapSourceDesc, so don't free it. They will not be freed either so
335
346
 * you can use static structs here.
336
347
 *
337
 
 * Returns TRUE if the registration suceeded.
 
348
 * Returns: TRUE if the registration suceeded.
338
349
 *
339
350
 * Since: 0.4
340
351
 */