Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewharvey/339024 to your computer and use it in GitHub Desktop.
Save andrewharvey/339024 to your computer and use it in GitHub Desktop.
libchamplain edit. This adds NearMap images as libchamplain sources.
diff --git a/champlain/champlain-map-source-factory.c b/champlain/champlain-map-source-factory.c
index e21e509..8bb0f30 100644
--- a/champlain/champlain-map-source-factory.c
+++ b/champlain/champlain-map-source-factory.c
@@ -254,6 +254,96 @@ ChamplainMapSourceDesc MFF_RELIEF_DESC =
};
static
+ChamplainMapSourceDesc NEARMAP_DEM_DESC =
+ {
+ CHAMPLAIN_MAP_SOURCE_NEARMAP_DEM,
+ "Nearmap Relief",
+ "Copyright NearMap Pty Ltd",
+ "http://www.nearmap.com/legal/community-licence.aspx",
+ 0,
+ 17,
+ CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+ champlain_map_source_new_generic,
+ "http://www.nearmap.com/maps/nml=Dem&x=#X#&y=#Y#&z=#Z#",
+ NULL
+ };
+
+static
+ChamplainMapSourceDesc NEARMAP_VERT_DESC =
+ {
+ CHAMPLAIN_MAP_SOURCE_NEARMAP_VERT,
+ "Nearmap Vertical",
+ "Copyright NearMap Pty Ltd",
+ "http://www.nearmap.com/legal/community-licence.aspx",
+ 0,
+ 21,
+ CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+ champlain_map_source_new_generic,
+ "http://www.nearmap.com/maps/nml=Vert&x=#X#&y=#Y#&z=#Z#",
+ NULL
+ };
+
+static
+ChamplainMapSourceDesc NEARMAP_OB_N_DESC =
+ {
+ CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_N,
+ "Nearmap Oblique North",
+ "Copyright NearMap Pty Ltd",
+ "http://www.nearmap.com/legal/community-licence.aspx",
+ 18,
+ 21,
+ CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+ champlain_map_source_new_generic,
+ "http://www.nearmap.com/maps/nml=N&x=#X#&y=#Y#&z=#Z#",
+ NULL
+ };
+
+static
+ChamplainMapSourceDesc NEARMAP_OB_E_DESC =
+ {
+ CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_E,
+ "Nearmap Oblique East",
+ "Copyright NearMap Pty Ltd",
+ "http://www.nearmap.com/legal/community-licence.aspx",
+ 18,
+ 21,
+ CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+ champlain_map_source_new_generic,
+ "http://www.nearmap.com/maps/nml=E&x=#X#&y=#Y#&z=#Z#",
+ NULL
+ };
+
+static
+ChamplainMapSourceDesc NEARMAP_OB_W_DESC =
+ {
+ CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_W,
+ "Nearmap Oblique West",
+ "Copyright NearMap Pty Ltd",
+ "http://www.nearmap.com/legal/community-licence.aspx",
+ 18,
+ 21,
+ CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+ champlain_map_source_new_generic,
+ "http://www.nearmap.com/maps/nml=W&x=#X#&y=#Y#&z=#Z#",
+ NULL
+ };
+
+static
+ChamplainMapSourceDesc NEARMAP_OB_S_DESC =
+ {
+ CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_S,
+ "Nearmap Oblique South",
+ "Copyright NearMap Pty Ltd",
+ "http://www.nearmap.com/legal/community-licence.aspx",
+ 18,
+ 21,
+ CHAMPLAIN_MAP_PROJECTION_MERCATOR,
+ champlain_map_source_new_generic,
+ "http://www.nearmap.com/maps/nml=S&x=#X#&y=#Y#&z=#Z#",
+ NULL
+ };
+
+static
ChamplainMapSourceDesc MEMPHIS_LOCAL_DESC =
{
CHAMPLAIN_MAP_SOURCE_MEMPHIS_LOCAL,
@@ -310,6 +400,19 @@ champlain_map_source_factory_init (ChamplainMapSourceFactory *factory)
MEMPHIS_LOCAL_DESC.constructor, MEMPHIS_LOCAL_DESC.data);
champlain_map_source_factory_register (factory, &MEMPHIS_NETWORK_DESC,
MEMPHIS_NETWORK_DESC.constructor, MEMPHIS_NETWORK_DESC.data);
+
+ champlain_map_source_factory_register (factory, &NEARMAP_DEM_DESC,
+ NEARMAP_DEM_DESC.constructor, NEARMAP_DEM_DESC.data);
+ champlain_map_source_factory_register (factory, &NEARMAP_VERT_DESC,
+ NEARMAP_VERT_DESC.constructor, NEARMAP_VERT_DESC.data);
+ champlain_map_source_factory_register (factory, &NEARMAP_OB_N_DESC,
+ NEARMAP_OB_N_DESC.constructor, NEARMAP_OB_N_DESC.data);
+ champlain_map_source_factory_register (factory, &NEARMAP_OB_S_DESC,
+ NEARMAP_OB_S_DESC.constructor, NEARMAP_OB_S_DESC.data);
+ champlain_map_source_factory_register (factory, &NEARMAP_OB_W_DESC,
+ NEARMAP_OB_W_DESC.constructor, NEARMAP_OB_W_DESC.data);
+ champlain_map_source_factory_register (factory, &NEARMAP_OB_E_DESC,
+ NEARMAP_OB_E_DESC.constructor, NEARMAP_OB_E_DESC.data);
}
/**
diff --git a/champlain/champlain-map-source-factory.h b/champlain/champlain-map-source-factory.h
index accbee5..8e6e588 100644
--- a/champlain/champlain-map-source-factory.h
+++ b/champlain/champlain-map-source-factory.h
@@ -87,6 +87,12 @@ champlain_map_source_factory_register (ChamplainMapSourceFactory *factory,
#define CHAMPLAIN_MAP_SOURCE_MEMPHIS_LOCAL "memphis-local"
#define CHAMPLAIN_MAP_SOURCE_MEMPHIS_NETWORK "memphis-network"
+#define CHAMPLAIN_MAP_SOURCE_NEARMAP_DEM "nearmap-dem"
+#define CHAMPLAIN_MAP_SOURCE_NEARMAP_VERT "nearmap-vert"
+#define CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_N "nearmap-ob-n"
+#define CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_S "nearmap-ob-s"
+#define CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_E "nearmap-ob-e"
+#define CHAMPLAIN_MAP_SOURCE_NEARMAP_OB_W "nearmap-ob-w"
G_END_DECLS
@andrewharvey
Copy link
Author

I wrote this for libchamplain 0.4.6, a newer version is at http://gitorious.org/~andrewharvey/libchamplain/andrewharveys-experiments-mainline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment