[fusion-commits] r2746 - in trunk: layers/Generic layers/MapGuide/php lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Sun Jul 21 19:49:32 PDT 2013
Author: liuar
Date: 2013-07-21 19:49:32 -0700 (Sun, 21 Jul 2013)
New Revision: 2746
Modified:
trunk/layers/Generic/Generic.js
trunk/layers/MapGuide/php/LoadMap.php
trunk/lib/Map.js
Log:
Integrate #2744 to trunk. 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: trunk/layers/Generic/Generic.js
===================================================================
--- trunk/layers/Generic/Generic.js 2013-07-17 06:25:16 UTC (rev 2745)
+++ trunk/layers/Generic/Generic.js 2013-07-22 02:49:32 UTC (rev 2746)
@@ -247,7 +247,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: trunk/layers/MapGuide/php/LoadMap.php
===================================================================
--- trunk/layers/MapGuide/php/LoadMap.php 2013-07-17 06:25:16 UTC (rev 2745)
+++ trunk/layers/MapGuide/php/LoadMap.php 2013-07-22 02:49:32 UTC (rev 2746)
@@ -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: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js 2013-07-17 06:25:16 UTC (rev 2745)
+++ trunk/lib/Map.js 2013-07-22 02:49:32 UTC (rev 2746)
@@ -1274,6 +1274,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