[Mapbender-commits] r8879 - in trunk/mapbender/http: classes javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri May 16 06:11:17 PDT 2014
Author: hwbllmnn
Date: 2014-05-16 06:11:17 -0700 (Fri, 16 May 2014)
New Revision: 8879
Modified:
trunk/mapbender/http/classes/class_map.php
trunk/mapbender/http/classes/class_wmc.php
trunk/mapbender/http/classes/class_wmcToXml.php
trunk/mapbender/http/javascripts/mod_loadwmc.js
trunk/mapbender/http/javascripts/mod_savewmc.js
Log:
added loading of kmls out of DB WMCs
Modified: trunk/mapbender/http/classes/class_map.php
===================================================================
--- trunk/mapbender/http/classes/class_map.php 2014-05-16 12:45:23 UTC (rev 8878)
+++ trunk/mapbender/http/classes/class_map.php 2014-05-16 13:11:17 UTC (rev 8879)
@@ -16,7 +16,6 @@
private $isOverview = false;
private $wmsArray = array();
private $kmls;
- private $originalKmls;
private $kmlOrder;
/**
@@ -224,14 +223,6 @@
$this->kmls = $kmls;
}
- public function getOriginalKmls() {
- return $this->originalKmls;
- }
-
- public function setOriginalKmls($originalKmls) {
- $this->originalKmls = $originalKmls;
- }
-
public function getKmlOrder() {
return $this->kmlOrder;
}
@@ -518,9 +509,6 @@
if(property_exists($jsMapObject, 'kmls')) {
$this->kmls = $jsMapObject->kmls;
}
- if(property_exists($jsMapObject, 'originalKmls')) {
- $this->originalKmls = $jsMapObject->originalKmls;
- }
if(property_exists($jsMapObject, 'kmlOrder')) {
$this->kmlOrder = $jsMapObject->kmlOrder;
}
Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php 2014-05-16 12:45:23 UTC (rev 8878)
+++ trunk/mapbender/http/classes/class_wmc.php 2014-05-16 13:11:17 UTC (rev 8879)
@@ -1156,9 +1156,6 @@
// set general extension data
if (count($this->generalExtensionArray) > 0) {
- if(array_key_exists('ORIGINALKMLS', $this->generalExtensionArray)) {
- $this->generalExtensionArray['ORIGINALKMLS'] = unserialize(base64_decode($this->generalExtensionArray['ORIGINALKMLS']));
- }
$json = new Mapbender_JSON();
array_push($wmcJsArray, "restoredWmcExtensionData = " . $json->encode($this->generalExtensionArray) . ";");
}
Modified: trunk/mapbender/http/classes/class_wmcToXml.php
===================================================================
--- trunk/mapbender/http/classes/class_wmcToXml.php 2014-05-16 12:45:23 UTC (rev 8878)
+++ trunk/mapbender/http/classes/class_wmcToXml.php 2014-05-16 13:11:17 UTC (rev 8879)
@@ -146,9 +146,6 @@
if($this->wmc->mainMap->getKmls()) {
$extensionData['kmls'] = json_encode($this->wmc->mainMap->getKmls());
}
- if($this->wmc->mainMap->getOriginalKmls()) {
- $extensionData['originalKmls'] = base64_encode(serialize($this->wmc->mainMap->getOriginalKmls()));
- }
if($this->wmc->mainMap->getKmlOrder()) {
$extensionData['kmlOrder'] = json_encode($this->wmc->mainMap->getKmlOrder());
}
Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js 2014-05-16 12:45:23 UTC (rev 8878)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js 2014-05-16 13:11:17 UTC (rev 8879)
@@ -487,6 +487,17 @@
eval(obj.javascript[j]);
}
if (args.method === "loadWmc") {
+ var kml = $('#mapframe1').data('kml');
+ if(kml) {
+ try {
+ kml._kmls = JSON.parse(restoredWmcExtensionData.KMLS);
+ kml.kmlOrder = JSON.parse(restoredWmcExtensionData.KMLORDER);
+ kml.render();
+ } catch(e) {
+ // just ignore the exception for now
+ }
+ }
+ console.log(restoredWmcExtensionData)
that.events.loaded.trigger({
extensionData: restoredWmcExtensionData
});
Modified: trunk/mapbender/http/javascripts/mod_savewmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_savewmc.js 2014-05-16 12:45:23 UTC (rev 8878)
+++ trunk/mapbender/http/javascripts/mod_savewmc.js 2014-05-16 13:11:17 UTC (rev 8879)
@@ -169,7 +169,6 @@
var kml = $('#mapframe1').data('kml');
if(kml) {
mb_mapObj[0].kmls = kml._kmls;
- mb_mapObj[0].originalKmls = kml.originalKmls;
mb_mapObj[0].kmlOrder = kml.kmlOrder;
}
@@ -201,7 +200,7 @@
//
// reversal of above WORKAROUND
//
- for (var i = 0; i < mb_mapObj.length; i++) {
+ for (i = 0; i < mb_mapObj.length; i++) {
mb_mapObj[i].$target = $target[i];
}
};
More information about the Mapbender_commits
mailing list