[fusion-commits] r1658 - in trunk/MapGuide: . php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Mon Nov 10 15:40:13 EST 2008
Author: madair
Date: 2008-11-10 15:40:11 -0500 (Mon, 10 Nov 2008)
New Revision: 1658
Modified:
trunk/MapGuide/MapGuide.js
trunk/MapGuide/php/CreateSession.php
trunk/MapGuide/php/LoadMap.php
Log:
re #120: for backwards compatibility, set useOverlay to false for MG installs prior to v2.1.x; move the PHP siteVersion element to LoadMap because opening a template from studio by-passes the CreateSesssion.php call
Modified: trunk/MapGuide/MapGuide.js
===================================================================
--- trunk/MapGuide/MapGuide.js 2008-11-10 19:39:52 UTC (rev 1657)
+++ trunk/MapGuide/MapGuide.js 2008-11-10 20:40:11 UTC (rev 1658)
@@ -73,8 +73,8 @@
this.selectionType = extension.SelectionType ? extension.SelectionType[0] : 'INTERSECTS';
this.selectionColor = extension.SelectionColor ? extension.SelectionColor[0] : '';
this.selectionFormat = extension.SelectionFormat ? extension.SelectionFormat[0] : 'PNG';
- if (extension.SelectionAsOverlay && extension.SelectionAsOverlay[0] == 'true') {
- this.selectionAsOverlay = true;
+ if (extension.SelectionAsOverlay && extension.SelectionAsOverlay[0] == 'false') {
+ this.selectionAsOverlay = false;
}
this.ratio = extension.MapRatio ? extension.MapRatio[0] : 1.0;
@@ -147,13 +147,6 @@
var o;
eval('o='+xhr.responseText);
this.session[0] = o.sessionId;
- var version = o.siteVersion;
- var bits = version.split('.');
- this.siteVersion = new Array(parseInt(bits[0]),
- parseInt(bits[1]),
- parseInt(bits[2]),
- parseInt(bits[3])
- );
this.triggerEvent(Fusion.Event.MAP_SESSION_CREATED);
}
},
@@ -240,6 +233,14 @@
this.mapWidget.setBackgroundColor(o.backgroundColor);
this._oMaxExtent = OpenLayers.Bounds.fromArray(o.extent);
+ var version = o.siteVersion;
+ var bits = version.split('.');
+ this.siteVersion = new Array(parseInt(bits[0]),
+ parseInt(bits[1]),
+ parseInt(bits[2]),
+ parseInt(bits[3])
+ );
+
this.layerRoot.clear();
this.layerRoot.legendLabel = this._sMapTitle;
@@ -547,11 +548,10 @@
* Returns an OpenLayers MapGuide layer object
*/
createOLLayer: function(layerName, bIsBaseLayer, bSingleTile, behaviour) {
- /* TODO : prevent the useOverlay flag based on site version
- if ( !(this.siteVersion[0]>1 && this.siteVersion[2]>=0 && this.siteVersion[3]>2) ) { //v2.0.x or higher
+ /* TODO : prevent the useOverlay flag based on site version */
+ if ( this.siteVersion[0] > 1 && this.siteVersion[1]<1 ) { //v2.0.x or higher
this.selectionAsOverlay = false;
}
- */
var layerOptions = {
units: this.units,
isBaseLayer: bIsBaseLayer,
Modified: trunk/MapGuide/php/CreateSession.php
===================================================================
--- trunk/MapGuide/php/CreateSession.php 2008-11-10 19:39:52 UTC (rev 1657)
+++ trunk/MapGuide/php/CreateSession.php 2008-11-10 20:40:11 UTC (rev 1658)
@@ -36,14 +36,12 @@
$site = $siteConnection->GetSite();
$sessionId = $site->CreateSession();
$user->SetMgSessionId($sessionId);
- $siteVersion = GetSiteVersion();
header('Content-type: text/x-json');
header('X-JSON: true');
$result = null;
$result->sessionId = $sessionId;
$result->userName = $username;
- $result->siteVersion = $siteVersion;
echo var2json($result);
/* start a php session in the web tier as well, using same session id */
Modified: trunk/MapGuide/php/LoadMap.php
===================================================================
--- trunk/MapGuide/php/LoadMap.php 2008-11-10 19:39:52 UTC (rev 1657)
+++ trunk/MapGuide/php/LoadMap.php 2008-11-10 20:40:11 UTC (rev 1658)
@@ -91,6 +91,7 @@
$mapObj->sessionId = $sessionID;
$mapObj->mapId = $mapid;
$mapObj->metersPerUnit = $metersPerUnit;
+ $mapObj->siteVersion = GetSiteVersion();
$mapObj->mapTitle=addslashes($mapTitle);
More information about the fusion-commits
mailing list