[fusion-commits] r2572 - in trunk: lib widgets widgets/GoogleStreetViewer
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Aug 28 01:36:35 PDT 2012
Author: liuar
Date: 2012-08-28 01:36:34 -0700 (Tue, 28 Aug 2012)
New Revision: 2572
Modified:
trunk/lib/MapMessage.js
trunk/widgets/GoogleStreetViewer.js
trunk/widgets/GoogleStreetViewer/GoogleStreetView.templ
Log:
On behalf of Ted Yang.
fix the ticket 2101: http://trac.osgeo.org/mapguide/ticket/2101
The submission is mainly implement the RFC 125:http://trac.osgeo.org/mapguide/wiki/MapGuideRfc125
part 2 refine error handling
Modified: trunk/lib/MapMessage.js
===================================================================
--- trunk/lib/MapMessage.js 2012-08-24 10:12:22 UTC (rev 2571)
+++ trunk/lib/MapMessage.js 2012-08-28 08:36:34 UTC (rev 2572)
@@ -36,14 +36,16 @@
this.parentNode.appendChild(container);
}
- container.style.cssText = this.containerCssText;
+ this.container.style.cssText = this.containerCssText;
var offset = {left:10, top:10};
- container.style.left = offset.left + "px";
- container.style.top = offset.top + "px";
+ this.container.style.left = offset.left + "px";
+ this.container.style.top = offset.top + "px";
+ this.container.innerHTML = "";
+
// Create the inner table
var table = document.createElement("table");
- container.appendChild(table);
+ this.container.appendChild(table);
table.style.width = "100%";
table.cellSpacing = "0";
table.cellPadding = "0";
@@ -77,8 +79,12 @@
this.container.fade(0);
window.setTimeout((function()
{
- this.container.parentNode.removeChild(this.container);
- this.container = null;
+ if (typeof (this.container) != "undefined" && this.container != null)
+ {
+ this.container.parentNode.removeChild(this.container);
+ this.container = null;
+ }
+
}).bind(this), 500);
}
},
@@ -123,6 +129,14 @@
this.removeBar();
},
+ hideDesignatedMessage: function(message)
+ {
+ if(message == this.message)
+ {
+ this.removeBar();
+ }
+ },
+
refreshLayout: function()
{
if (typeof (this.container) != "undefined" && this.container != null)
Modified: trunk/widgets/GoogleStreetViewer/GoogleStreetView.templ
===================================================================
--- trunk/widgets/GoogleStreetViewer/GoogleStreetView.templ 2012-08-24 10:12:22 UTC (rev 2571)
+++ trunk/widgets/GoogleStreetViewer/GoogleStreetView.templ 2012-08-28 08:36:34 UTC (rev 2572)
@@ -177,7 +177,7 @@
if (status == google.maps.StreetViewStatus.OK) {
if(typeof(widget.hideMessage) == "function") {
- widget.hideMessage();
+ widget.hideMessage(widget.serviceUnavailableMessage);
}
}
else
Modified: trunk/widgets/GoogleStreetViewer.js
===================================================================
--- trunk/widgets/GoogleStreetViewer.js 2012-08-24 10:12:22 UTC (rev 2571)
+++ trunk/widgets/GoogleStreetViewer.js 2012-08-28 08:36:34 UTC (rev 2572)
@@ -173,18 +173,19 @@
lonlat.transform(mapProj, this.targetCs);
targetLonLat.transform(mapProj, this.targetCs);
- //this.hideMessage();
+ this.hideMessage(this.csTransformErrorMessage);
+
+ // Transform Z
+ var unitsPerMeter = this.getUnitsPerMeter(this.targetCs);
+ var unitsPerMeterInMap = this.getUnitsPerMeter(mapProj);
+
+ this.GoogleSVPage.setView(lonlat.lon, lonlat.lat, position.z*unitsPerMeter/unitsPerMeterInMap,
+ targetLonLat.lon, targetLonLat.lat, position.targetZ*unitsPerMeter/unitsPerMeterInMap);
+
}catch(e)
{
- //this.showMessage(this.warningMessage);
- }
-
- // Transform Z
- var unitsPerMeter = this.getUnitsPerMeter(this.targetCs);
- var unitsPerMeterInMap = this.getUnitsPerMeter(mapProj);
-
- this.GoogleSVPage.setView(lonlat.lon, lonlat.lat, position.z*unitsPerMeter/unitsPerMeterInMap,
- targetLonLat.lon, targetLonLat.lat, position.targetZ*unitsPerMeter/unitsPerMeterInMap);
+ this.showMessage(this.csTransformErrorMessage);
+ }
},
getUnitsPerMeter: function(cs) {
@@ -226,27 +227,28 @@
source.transform(this.targetCs, mapProj);
target.transform(this.targetCs, mapProj);
- //this.hideMessage();
+ this.hideMessage(this.csTransformErrorMessage);
+
+ x = source.lon;
+ y = source.lat;
+ targetX = target.lon;
+ targetY = target.lat;
+ // Transform Z
+ var unitsPerMeter = this.getUnitsPerMeter(this.targetCs);
+ var unitsPerMeterInMap = this.getUnitsPerMeter(mapProj);
+ z = z*unitsPerMeterInMap/unitsPerMeter;
+ targetZ = targetZ*unitsPerMeterInMap/unitsPerMeter;
+
+ if(!this.getMap().getCurrentExtents().contains(x, y)) {
+ this.getMap().zoom(x, y, 1);
+ }
+
+ this.symbolLayer.updateSymbolPosition(x, y, z, targetX, targetY, targetZ, this);
+
}catch(e)
{
- //this.showMessage(this.warningMessage);
+ this.showMessage(this.csTransformErrorMessage);
}
-
- x = source.lon;
- y = source.lat;
- targetX = target.lon;
- targetY = target.lat;
- // Transform Z
- var unitsPerMeter = this.getUnitsPerMeter(this.targetCs);
- var unitsPerMeterInMap = this.getUnitsPerMeter(mapProj);
- z = z*unitsPerMeterInMap/unitsPerMeter;
- targetZ = targetZ*unitsPerMeterInMap/unitsPerMeter;
-
- if(!this.getMap().getCurrentExtents().contains(x, y)) {
- this.getMap().zoom(x, y, 1);
- }
-
- this.symbolLayer.updateSymbolPosition(x, y, z, targetX, targetY, targetZ, this);
},
setGoogleSVPage: function(GoogleSVWindow) {
@@ -290,11 +292,16 @@
{
this.getMap().message.warn(message);
},
- hideMessage: function()
+ hideMessage: function(message)
{
if(this.getMap().message){
- this.getMap().message.hide();
+ this.getMap().message.hideDesignatedMessage(message);
}
}
});
+Proj4js.reportError = function(msg) {
+ throw msg;
+ //console.log(msg);
+ };
+
More information about the fusion-commits
mailing list