[fusion-commits] r2744 - in sandbox/adsk/2.4j: layers/Generic layers/MapGuide/php lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Jul 11 23:15:10 PDT 2013
Author: liuar
Date: 2013-07-11 23:15:10 -0700 (Thu, 11 Jul 2013)
New Revision: 2744
Modified:
sandbox/adsk/2.4j/layers/Generic/Generic.js
sandbox/adsk/2.4j/layers/MapGuide/php/LoadMap.php
sandbox/adsk/2.4j/lib/Map.js
Log:
This submission did the followings:
1. Call setCenter() when the map is not fractional zoom.
2 Add null check before delete layer.
3. If the map uses Google CS, the EPSG code is 3857. And the code Open Layers uses is 900913. In theory, they should be same. But the odd thing is their WKT strings are different. So I have to set the WKT to "" when the EPSG code is 3857 to avoid unnecessary CS transformation.
Modified: sandbox/adsk/2.4j/layers/Generic/Generic.js
===================================================================
--- sandbox/adsk/2.4j/layers/Generic/Generic.js 2013-07-03 06:37:17 UTC (rev 2743)
+++ sandbox/adsk/2.4j/layers/Generic/Generic.js 2013-07-12 06:15:10 UTC (rev 2744)
@@ -244,7 +244,8 @@
if (this.layerRoot) {
parentGroup = this.mapWidget.layerRoot;
var oldLayer = parentGroup.findLayerByAttribute("layerName", this.layerRoot.layerName);
- parentGroup.deleteLayer(oldLayer.uniqueId);
+ if (oldLayer)
+ parentGroup.deleteLayer(oldLayer.uniqueId);
}
this.layerRoot = new Fusion.Layers.Layer(rootOpts,this);
if (parentGroup) {
Modified: sandbox/adsk/2.4j/layers/MapGuide/php/LoadMap.php
===================================================================
--- sandbox/adsk/2.4j/layers/MapGuide/php/LoadMap.php 2013-07-03 06:37:17 UTC (rev 2743)
+++ sandbox/adsk/2.4j/layers/MapGuide/php/LoadMap.php 2013-07-12 06:15:10 UTC (rev 2744)
@@ -89,6 +89,8 @@
if($epsgCode == 3857)
{
$epsgCode = 900913;
+ // We need to set the srs code to null because OpenLayers doesn't know the srs code.
+ $srs = "";
}
} catch (MgException $e) {
Modified: sandbox/adsk/2.4j/lib/Map.js
===================================================================
--- sandbox/adsk/2.4j/lib/Map.js 2013-07-03 06:37:17 UTC (rev 2743)
+++ sandbox/adsk/2.4j/lib/Map.js 2013-07-12 06:15:10 UTC (rev 2744)
@@ -1002,6 +1002,7 @@
this.setExtents(new OpenLayers.Bounds(fMinX, fMinY, fMaxX, fMaxY));
} else {
var currentZoomLevel = this.oMapOL.getZoom();
+ this.oMapOL.setCenter(new OpenLayers.LonLat(fX, fY));
if (nFactor > 1) {
this.oMapOL.zoomTo(currentZoomLevel+1);
} else if (nFactor < 1) {
More information about the fusion-commits
mailing list