[libchamplain] Add support for OpenWeatherMap



commit 43918664b296805d8b1dbe9872af514637f69dc9
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Jul 21 18:55:10 2013 +0200

    Add support for OpenWeatherMap
    
    OpenWeatherMaps provides free (CC-BY-SA 2.0) maps for various
    kind of weather data, such as clouds, wind, temperature and
    precipitation.
    
    This is not fully functional because OWM maps are just layers,
    intended to be placed above OpenStreetMaps.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704645

 champlain/champlain-map-source-factory.c |   70 ++++++++++++++++++++++++++++++
 champlain/champlain-map-source-factory.h |   30 +++++++++++++
 docs/reference/libchamplain.types        |    1 -
 3 files changed, 100 insertions(+), 1 deletions(-)
---
diff --git a/champlain/champlain-map-source-factory.c b/champlain/champlain-map-source-factory.c
index 11d0ad5..5289e8d 100644
--- a/champlain/champlain-map-source-factory.c
+++ b/champlain/champlain-map-source-factory.c
@@ -262,6 +262,76 @@ champlain_map_source_factory_init (ChamplainMapSourceFactory *factory)
         NULL);
   champlain_map_source_factory_register (factory, desc);
 
+  desc = champlain_map_source_desc_new_full (
+        CHAMPLAIN_MAP_SOURCE_OWM_CLOUDS,
+        "OpenWeatherMap cloud layer",
+        "Map data is CC-BY-SA 2.0 OpenWeatherMap contributors",
+        "http://creativecommons.org/licenses/by-sa/2.0/";,
+        0,
+        18,
+        256,
+        CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+        "http://tile.openweathermap.org/map/clouds/#Z#/#X#/#Y#.png";,
+        champlain_map_source_new_generic,
+        NULL);
+  champlain_map_source_factory_register (factory, desc);
+
+  desc = champlain_map_source_desc_new_full (
+        CHAMPLAIN_MAP_SOURCE_OWM_WIND,
+        "OpenWeatherMap wind layer",
+        "Map data is CC-BY-SA 2.0 OpenWeatherMap contributors",
+        "http://creativecommons.org/licenses/by-sa/2.0/";,
+        0,
+        18,
+        256,
+        CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+        "http://tile.openweathermap.org/map/wind/#Z#/#X#/#Y#.png";,
+        champlain_map_source_new_generic,
+        NULL);
+  champlain_map_source_factory_register (factory, desc);
+
+  desc = champlain_map_source_desc_new_full (
+        CHAMPLAIN_MAP_SOURCE_OWM_TEMPERATURE,
+        "OpenWeatherMap temperature layer",
+        "Map data is CC-BY-SA 2.0 OpenWeatherMap contributors",
+        "http://creativecommons.org/licenses/by-sa/2.0/";,
+        0,
+        18,
+        256,
+        CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+        "http://tile.openweathermap.org/map/temp/#Z#/#X#/#Y#.png";,
+        champlain_map_source_new_generic,
+        NULL);
+  champlain_map_source_factory_register (factory, desc);
+
+  desc = champlain_map_source_desc_new_full (
+        CHAMPLAIN_MAP_SOURCE_OWM_PRECIPITATION,
+        "OpenWeatherMap precipitation layer",
+        "Map data is CC-BY-SA 2.0 OpenWeatherMap contributors",
+        "http://creativecommons.org/licenses/by-sa/2.0/";,
+        0,
+        18,
+        256,
+        CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+        "http://tile.openweathermap.org/map/precipitation/#Z#/#X#/#Y#.png";,
+        champlain_map_source_new_generic,
+        NULL);
+  champlain_map_source_factory_register (factory, desc);
+
+  desc = champlain_map_source_desc_new_full (
+        CHAMPLAIN_MAP_SOURCE_OWM_PRESSURE,
+        "OpenWeatherMap sea level pressure layer",
+        "Map data is CC-BY-SA 2.0 OpenWeatherMap contributors",
+        "http://creativecommons.org/licenses/by-sa/2.0/";,
+        0,
+        18,
+        256,
+        CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+        "http://tile.openweathermap.org/map/pressure/#Z#/#X#/#Y#.png";,
+        champlain_map_source_new_generic,
+        NULL);
+  champlain_map_source_factory_register (factory, desc);
+
 #ifdef CHAMPLAIN_HAS_MEMPHIS
   desc = champlain_map_source_desc_new_full (
         CHAMPLAIN_MAP_SOURCE_MEMPHIS_LOCAL,
diff --git a/champlain/champlain-map-source-factory.h b/champlain/champlain-map-source-factory.h
index 8655845..4d6527f 100644
--- a/champlain/champlain-map-source-factory.h
+++ b/champlain/champlain-map-source-factory.h
@@ -148,6 +148,36 @@ GSList *champlain_map_source_factory_get_registered (ChamplainMapSourceFactory *
  * Maps for Free Relief
  */
 #define CHAMPLAIN_MAP_SOURCE_MFF_RELIEF "mff-relief"
+/**
+ * CHAMPLAIN_MAP_SOURCE_OWM_CLOUDS:
+ *
+ * OpenWeatherMap clouds layer
+ */
+#define CHAMPLAIN_MAP_SOURCE_OWM_CLOUDS "owm-clouds"
+/**
+ * CHAMPLAIN_MAP_SOURCE_OWM_PRECIPITATION:
+ *
+ * OpenWeatherMap precipitation
+ */
+#define CHAMPLAIN_MAP_SOURCE_OWM_PRECIPITATION "owm-precipitation"
+/**
+ * CHAMPLAIN_MAP_SOURCE_OWM_PRESSURE:
+ *
+ * OpenWeatherMap sea level pressure
+ */
+#define CHAMPLAIN_MAP_SOURCE_OWM_PRESSURE "owm-pressure"
+/**
+ * CHAMPLAIN_MAP_SOURCE_OWM_WIND:
+ *
+ * OpenWeatherMap wind
+ */
+#define CHAMPLAIN_MAP_SOURCE_OWM_WIND "owm-wind"
+/**
+ * CHAMPLAIN_MAP_SOURCE_OWM_TEMPERATURE:
+ *
+ * OpenWeatherMap temperature
+ */
+#define CHAMPLAIN_MAP_SOURCE_OWM_TEMPERATURE "owm-temperature"
 #else
 #define CHAMPLAIN_MAP_SOURCE_OSM_MAPNIK "OpenStreetMap I"
 #define CHAMPLAIN_MAP_SOURCE_OSM_OSMARENDER "OpenStreetMap II"
diff --git a/docs/reference/libchamplain.types b/docs/reference/libchamplain.types
index 6b579ab..617b049 100644
--- a/docs/reference/libchamplain.types
+++ b/docs/reference/libchamplain.types
@@ -16,7 +16,6 @@ champlain_map_source_get_type
 champlain_marker_get_type
 champlain_marker_layer_get_type
 champlain_memory_cache_get_type
-champlain_memphis_renderer_get_type
 champlain_network_bbox_tile_source_get_type
 champlain_network_tile_source_get_type
 champlain_null_tile_source_get_type


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]