[fusion-commits] r1673 - in trunk: layers layers/Generic
layers/MapGuide layers/MapServer lib
templates/mapserver/standard widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Nov 19 11:26:40 EST 2008
Author: madair
Date: 2008-11-19 11:26:40 -0500 (Wed, 19 Nov 2008)
New Revision: 1673
Modified:
trunk/layers/Generic/Generic.js
trunk/layers/Layers.js
trunk/layers/MapGuide/MapGuide.js
trunk/layers/MapServer/MapServer.js
trunk/lib/Map.js
trunk/templates/mapserver/standard/ApplicationDefinition.xml
trunk/widgets/TaskPane.js
Log:
re #140: fixes to get Google layer working; allow caching for tiled maps
Modified: trunk/layers/Generic/Generic.js
===================================================================
--- trunk/layers/Generic/Generic.js 2008-11-19 15:58:49 UTC (rev 1672)
+++ trunk/layers/Generic/Generic.js 2008-11-19 16:26:40 UTC (rev 1673)
@@ -105,8 +105,11 @@
this.mapTag.layerOptions.type = G_NORMAL_MAP;
break;
}
+ this.mapTag.layerOptions.maxExtent = null; //maxExtent not allowed on Google layers
this.oLayerOL = new OpenLayers.Layer.Google(this.getMapName(), this.mapTag.layerOptions );
- break;
+ this.mapWidget.fractionalZoom = false; //fractionalZoom not permitted with Google layers
+ this.mapWidget.oMapOL.setOptions({fractionalZoom: false});
+ break;
default:
this.oLayerOL = new OpenLayers.Layer[this.layerType](
this.getMapName(),
@@ -126,7 +129,7 @@
}
//this.triggerEvent(Fusion.Event.LAYER_LOADED);
- window.setTimeout(OpenLayers.Function.bind(this.asyncTrigger, this),1000);
+ window.setTimeout(OpenLayers.Function.bind(this.asyncTrigger, this),1);
},
asyncTrigger: function() {
Modified: trunk/layers/Layers.js
===================================================================
--- trunk/layers/Layers.js 2008-11-19 15:58:49 UTC (rev 1672)
+++ trunk/layers/Layers.js 2008-11-19 16:26:40 UTC (rev 1673)
@@ -45,6 +45,7 @@
sMapResourceId: null, //pointer to the resource that defines the map (URL, MapFile, MGOS, etc)
sImageType: 'png', //TODO: set this in AppDef?
clientAgent: 'Fusion Viewer',
+ noCache: false,
_sMapTitle: null,
_sMapname: null,
@@ -65,6 +66,9 @@
}
this.mapTag = mapTag;
+ if (!this.mapTag.layerOptions) {
+ this.mapTag.layerOptions = {};
+ }
this.ratio = this.mapTag.layerOptions.MapRatio ? this.extension.MapRatio[0] : 1.0;
this.bSingleTile = mapTag.singleTile; //this is set in thhe AppDef.Map class
this.bIsBaseLayer = mapTag.isBaseLayer;
Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js 2008-11-19 15:58:49 UTC (rev 1672)
+++ trunk/layers/MapGuide/MapGuide.js 2008-11-19 16:26:40 UTC (rev 1673)
@@ -94,6 +94,8 @@
this.layerRoot = new Fusion.Layers.Group(rootOpts,this);
this.keepAliveInterval = parseInt(mapTag.extension.KeepAliveInterval ? mapTag.extension.KeepAliveInterval[0] : 300);
+ this.noCache = true;
+
var sid = Fusion.sessionId;
if (sid) {
this.session[0] = sid;
Modified: trunk/layers/MapServer/MapServer.js
===================================================================
--- trunk/layers/MapServer/MapServer.js 2008-11-19 15:58:49 UTC (rev 1672)
+++ trunk/layers/MapServer/MapServer.js 2008-11-19 16:26:40 UTC (rev 1673)
@@ -69,6 +69,7 @@
this.layerRoot = new Fusion.Layers.Group(rootOpts,this);
this.keepAliveInterval = parseInt(mapTag.extension.KeepAliveInterval ? mapTag.extension.KeepAliveInterval[0] : 300);
+ this.noCache = true;
if (mapTag.sid) {
this.session[0] = mapTag.sid;
Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js 2008-11-19 15:58:49 UTC (rev 1672)
+++ trunk/lib/Map.js 2008-11-19 16:26:40 UTC (rev 1673)
@@ -68,7 +68,7 @@
mapsLoaded: false,
layerRoot: null,
singleTile: true,
- fractionalZoom: true, //TODO: set this in AppDef?
+ fractionalZoom: true,
maxScale: null, //set this to a large number in AppDef to zoom out beyond maxExtent, e.g. 1 billion
/**
@@ -344,7 +344,8 @@
this.oMapOL.setOptions({
maxExtent: this.maxExtent,
units: map.units,
- projection: this.projection});
+ projection: this.projection
+ });
}
//if bRestrictExtent is null, use the default OL behaviour with somewhat restricted map navigation
@@ -608,7 +609,7 @@
//update the timestamp param to prevent caching
for (var i=0; i<this.aMaps.length; i++ ) {
- if (this.aMaps[i].oLayerOL.params) {
+ if (this.aMaps[i].oLayerOL.params && this.aMaps[i].noCache) {
this.aMaps[i].oLayerOL.params.ts = (new Date()).getTime();
}
}
@@ -660,7 +661,7 @@
return (this._oCurrentExtents) ? true : false;
},
- zoom : function(fX, fY, nFactor) {
+ zoom: function(fX, fY, nFactor) {
//do this differntly with OL code??
if (nFactor == 1 || nFactor == 0) {
/*recenter*/
Modified: trunk/templates/mapserver/standard/ApplicationDefinition.xml
===================================================================
--- trunk/templates/mapserver/standard/ApplicationDefinition.xml 2008-11-19 15:58:49 UTC (rev 1672)
+++ trunk/templates/mapserver/standard/ApplicationDefinition.xml 2008-11-19 16:26:40 UTC (rev 1673)
@@ -86,9 +86,6 @@
<Options>
<name>GoogleLayer</name>
<type>G_PHYSICAL_MAP</type>
- <isBaseLayer>true</isBaseLayer>
- <sphericalMercator>true</sphericalMercator>
- <maxExtent>-141,41,-43,90</maxExtent>
</Options>
</Extension>
</Map>
@@ -1126,7 +1123,7 @@
<MapId>reliance-roads</MapId>
</MapWidget>
-<!-- OVERVIEW MAP -->
+<!-- OVERVIEW MAP
<Widget xsi:type="WidgetType">
@@ -1134,10 +1131,10 @@
<Type>OverviewMap</Type>
<Description/>
<Extension xsi:type="CustomContentType">
- <!--MapId>mapserverKeymap</MapId-->
+ <MapId>mapserverKeymap</MapId>
</Extension>
</Widget>
-
+ -->
<!-- PRINT -->
<Widget xsi:type="UiWidgetType">
Modified: trunk/widgets/TaskPane.js
===================================================================
--- trunk/widgets/TaskPane.js 2008-11-19 15:58:49 UTC (rev 1672)
+++ trunk/widgets/TaskPane.js 2008-11-19 16:26:40 UTC (rev 1673)
@@ -56,8 +56,6 @@
initialTask = url + initialTask;
}
- console.log(homeIcon);
-
homeIcon = json.HomeIcon ? json.HomeIcon[0] : homeIcon;
homeClass = json.HomeClass ? json.HomeClass[0] : homeClass;
prevIcon = json.PreviousIcon ? json.PreviousIcon[0] : prevIcon;
More information about the fusion-commits
mailing list