[Mapbender-commits] r8924 - trunk/mapbender/lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Jun 24 06:45:53 PDT 2014
Author: hwbllmnn
Date: 2014-06-24 06:45:53 -0700 (Tue, 24 Jun 2014)
New Revision: 8924
Modified:
trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
repair unclosed polygons before transformation
Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-06-05 09:40:24 UTC (rev 8923)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-06-24 13:45:53 UTC (rev 8924)
@@ -551,6 +551,17 @@
}
feats = self.cache[url][map.getSrs()];
if(!feats) {
+ $.each(item.data.features, function(_, v) {
+ if(v.geometry.type === 'Polygon') {
+ $.each(v.geometry.coordinates, function(_, coords) {
+ if(coords[0][0] !== coords[coords.length-1][0]
+ || coords[0][1] !== coords[coords.length-1][1]) {
+ coords.push(coords[0]);
+ }
+ });
+ }
+ });
+ console.log(item.data.features)
$.ajax({
url: '../php/transformgeojson.php?targetEPSG=' + map.getSrs(),
type: 'POST',
More information about the Mapbender_commits
mailing list