[Mapbender-commits] r8877 - in trunk/mapbender: http/plugins http/widgets lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri May 16 05:42:03 PDT 2014
Author: hwbllmnn
Date: 2014-05-16 05:42:03 -0700 (Fri, 16 May 2014)
New Revision: 8877
Modified:
trunk/mapbender/http/plugins/mb_digitize_widget.php
trunk/mapbender/http/widgets/w_digitize.js
trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
fixed loading a new KML w/o keeping the originalKML
Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-16 12:25:43 UTC (rev 8876)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-16 12:42:03 UTC (rev 8877)
@@ -424,6 +424,9 @@
var digit = o.$target.data('mb_digitize');
digit.modeOff();
var pts = digit._digitizePoints;
+ $.each(pts, function(_, v) {
+ Proj4js.transform(kml.targetProj, kml.wgs84, v.pos);
+ });
if(status === 'edit-point') {
editedFeature.geometry.coordinates = [pts[0].pos.x, pts[0].pos.y];
} else if(status === 'edit-line') {
Modified: trunk/mapbender/http/widgets/w_digitize.js
===================================================================
--- trunk/mapbender/http/widgets/w_digitize.js 2014-05-16 12:25:43 UTC (rev 8876)
+++ trunk/mapbender/http/widgets/w_digitize.js 2014-05-16 12:42:03 UTC (rev 8877)
@@ -577,17 +577,20 @@
coordinatesToDigitizePoints: function(coords) {
var map = $('#mapframe1').mapbender();
+ var kml = $('#mapframe1').data('kml');
if($.isArray(coords[0])) {
var pts = [];
$.each(coords, function(_, v) {
if($.isArray(v[0])) {
$.each(v, function(_, v2) {
var pos = {x: v2[0], y: v2[1]};
+ Proj4js.transform(kml.wgs84, kml.targetProj, pos);
var mousePos = map.convertRealToPixel(pos);
pts.push({pos: pos, mousePos: mousePos});
});
} else {
var pos = {x: v[0], y: v[1]};
+ Proj4js.transform(kml.wgs84, kml.targetProj, pos);
var mousePos = map.convertRealToPixel(pos);
pts.push({pos: pos, mousePos: mousePos});
}
@@ -595,6 +598,7 @@
return pts;
} else {
var pos = {x: coords[0], y: coords[1]};
+ Proj4js.transform(kml.wgs84, kml.targetProj, pos);
var mousePos = map.convertRealToPixel(pos);
return [{pos: pos, mousePos: mousePos}];
}
Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-05-16 12:25:43 UTC (rev 8876)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-05-16 12:42:03 UTC (rev 8877)
@@ -233,6 +233,8 @@
// }
// });
+ this.kmlOrder.push(o.url);
+
$.ajax({ url: '../php/kmlToGeoJSON.php',
data: {url: o.url, targetEPSG: 'EPSG:4326'},
type: 'POST',
More information about the Mapbender_commits
mailing list