From cde94993c3a78da3f2385a51c8c966bbf44efc8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Koke=C5=A1?= Date: Wed, 6 Nov 2013 15:06:26 +0100 Subject: [PATCH 1/4] Update GeoExt.data.PrintProvider for basic XYZ layer format support It's just similar encoder like that OSM one, but with extension autodetection and tileOriginCorner coming from OpenLayers. I'm not sure, if there's need to implement path_format and how should look customParams (as string like ?param1=value1¶m2=value2, or Ext.encode[{param1:value1,param2:value2}]). --- lib/GeoExt/data/PrintProvider.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/GeoExt/data/PrintProvider.js b/lib/GeoExt/data/PrintProvider.js index 88d6eafe..39c7138a 100644 --- a/lib/GeoExt/data/PrintProvider.js +++ b/lib/GeoExt/data/PrintProvider.js @@ -666,6 +666,15 @@ GeoExt.data.PrintProvider = Ext.extend(Ext.util.Observable, { extension: "png" }); }, + "XYZ": function (layer) { + var enc = this.encoders.layers.TileCache.call(this, layer); + return Ext.apply(enc, { + type: 'XYZ', + baseURL: enc.baseURL.substr(0, enc.baseURL.indexOf("$")), + extension: enc.baseURL.substr(enc.baseURL.lastIndexOf("$")).split(".").pop(), + tileOriginCorner: layer.tileOriginCorner + }); + }, "TMS": function(layer) { var enc = this.encoders.layers.TileCache.call(this, layer); return Ext.apply(enc, { From dc2c511a0a3ac5ed54716b669ce66adc851dec40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Koke=C5=A1?= Date: Thu, 7 Nov 2013 11:40:05 +0100 Subject: [PATCH 2/4] Update GeoExt.form.recordToField to support GDAL CouchDB/Geocouch driver GDAL driver for CouchDB/Geocouch creates _design/ogr_metadata document with field types without namespace prefix, so detect if type has namespace or not and optionally remove it. --- lib/GeoExt/widgets/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GeoExt/widgets/form.js b/lib/GeoExt/widgets/form.js index 71db5f84..a5cc2644 100644 --- a/lib/GeoExt/widgets/form.js +++ b/lib/GeoExt/widgets/form.js @@ -156,7 +156,7 @@ GeoExt.form.recordToField = function(record, options) { // field, just return it return type; } - type = type.split(":").pop(); // remove ns prefix + type = type.split(":").length > 1 ? type.split(":").pop() : type; // optionally remove ns prefix var field; var name = record.get("name"); From 7e57c0554e019825095cb35320284d854517eb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Koke=C5=A1?= Date: Fri, 8 Nov 2013 09:31:53 +0100 Subject: [PATCH 3/4] Support for CouchDB _design/ogr_metadata with REAL type --- lib/GeoExt/widgets/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GeoExt/widgets/form.js b/lib/GeoExt/widgets/form.js index a5cc2644..0e7b331f 100644 --- a/lib/GeoExt/widgets/form.js +++ b/lib/GeoExt/widgets/form.js @@ -243,7 +243,7 @@ GeoExt.form.recordToField.REGEXES = { "^(text|string)$", "i" ), "number": new RegExp( - "^(number|float|decimal|double|int|long|integer|short)$", "i" + "^(number|float|decimal|double|real|int|long|integer|short)$", "i" ), "boolean": new RegExp( "^(boolean)$", "i" From 7a48030f37c33d020f5d83dbefd929018f81878e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Koke=C5=A1?= Date: Wed, 20 Nov 2013 10:36:19 +0100 Subject: [PATCH 4/4] Update PrintProvider.js Source formatting. --- lib/GeoExt/data/PrintProvider.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/GeoExt/data/PrintProvider.js b/lib/GeoExt/data/PrintProvider.js index 39c7138a..d2a99663 100644 --- a/lib/GeoExt/data/PrintProvider.js +++ b/lib/GeoExt/data/PrintProvider.js @@ -667,14 +667,14 @@ GeoExt.data.PrintProvider = Ext.extend(Ext.util.Observable, { }); }, "XYZ": function (layer) { - var enc = this.encoders.layers.TileCache.call(this, layer); - return Ext.apply(enc, { - type: 'XYZ', - baseURL: enc.baseURL.substr(0, enc.baseURL.indexOf("$")), - extension: enc.baseURL.substr(enc.baseURL.lastIndexOf("$")).split(".").pop(), - tileOriginCorner: layer.tileOriginCorner - }); - }, + var enc = this.encoders.layers.TileCache.call(this, layer); + return Ext.apply(enc, { + type: 'XYZ', + baseURL: enc.baseURL.substr(0, enc.baseURL.indexOf("$")), + extension: enc.baseURL.substr(enc.baseURL.lastIndexOf("$")).split(".").pop(), + tileOriginCorner: layer.tileOriginCorner + }); + }, "TMS": function(layer) { var enc = this.encoders.layers.TileCache.call(this, layer); return Ext.apply(enc, {