[fusion-commits] r1806 - in trunk: common/php layers
layers/MapGuide/php layers/MapServer/php
templates/mapserver/standard widgets widgets/SelectWithin
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Mar 4 15:38:54 EST 2009
Author: pdeschamps
Date: 2009-03-04 15:38:53 -0500 (Wed, 04 Mar 2009)
New Revision: 1806
Modified:
trunk/common/php/Xml2JSON.php
trunk/layers/Layers.js
trunk/layers/MapGuide/php/CreateSession.php
trunk/layers/MapGuide/php/GetSelectionProperties.php
trunk/layers/MapGuide/php/LoadMap.php
trunk/layers/MapGuide/php/Measure.php
trunk/layers/MapGuide/php/Query.php
trunk/layers/MapGuide/php/SaveSelection.php
trunk/layers/MapGuide/php/Selection.php
trunk/layers/MapGuide/php/SetLayers.php
trunk/layers/MapServer/php/CreateSession.php
trunk/layers/MapServer/php/LoadMap.php
trunk/layers/MapServer/php/LoadScaleRanges.php
trunk/layers/MapServer/php/Maptip.php
trunk/layers/MapServer/php/Measure.php
trunk/layers/MapServer/php/Query.php
trunk/layers/MapServer/php/Selection.php
trunk/layers/MapServer/php/SetLayers.php
trunk/templates/mapserver/standard/ApplicationDefinition.xml
trunk/templates/mapserver/standard/index.html
trunk/widgets/Legend.js
trunk/widgets/ScalebarDual.js
trunk/widgets/SelectWithin/SelectWithin.php
Log:
closes #32: added application/json to content-type
Modified: trunk/common/php/Xml2JSON.php
===================================================================
--- trunk/common/php/Xml2JSON.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/common/php/Xml2JSON.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -35,7 +35,7 @@
if (!isset($REQUEST_VARS['xml'])) {
die('xml not set');
}
- header('Content-type: text/plain');
+ header('Content-type: application/json');
header('X-JSON: true');
$xml = rawurldecode ($REQUEST_VARS['xml']);
$xml = trim($xml);
Modified: trunk/layers/Layers.js
===================================================================
--- trunk/layers/Layers.js 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/Layers.js 2009-03-04 20:38:53 UTC (rev 1806)
@@ -317,6 +317,7 @@
this.initiallyVisible = o.visible;
this.actuallyVisible = o.actuallyVisible;
this.registerEventID(Fusion.Event.GROUP_PROPERTY_CHANGED);
+ this.groupParent = o.groupParent;
},
show: function(noDraw) {
@@ -524,7 +525,7 @@
set: function(property, value) {
this[property] = value;
this.triggerEvent(Fusion.Event.LAYER_PROPERTY_CHANGED, this);
- }
+ },
});
Modified: trunk/layers/MapGuide/php/CreateSession.php
===================================================================
--- trunk/layers/MapGuide/php/CreateSession.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/CreateSession.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -37,7 +37,7 @@
$sessionId = $site->CreateSession();
$user->SetMgSessionId($sessionId);
- header('Content-type: text/x-json');
+ header('Content-type: application/json');
header('X-JSON: true');
$result = null;
$result->sessionId = $sessionId;
Modified: trunk/layers/MapGuide/php/GetSelectionProperties.php
===================================================================
--- trunk/layers/MapGuide/php/GetSelectionProperties.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/GetSelectionProperties.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -57,7 +57,7 @@
$properties->layers = array();
//process
- header('Content-type: text/x-json');
+ header('Content-type: application/json');
header('X-JSON: true');
$layers = $selection->GetLayers();
$nLayers = $layers->GetCount();
Modified: trunk/layers/MapGuide/php/LoadMap.php
===================================================================
--- trunk/layers/MapGuide/php/LoadMap.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/LoadMap.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -85,8 +85,8 @@
}
- //header('Content-type: text/x-json');
- //header('X-JSON: true');
+ header('Content-type: application/json');
+ header('X-JSON: true');
$mapObj->sessionId = $sessionID;
$mapObj->mapId = $mapid;
Modified: trunk/layers/MapGuide/php/Measure.php
===================================================================
--- trunk/layers/MapGuide/php/Measure.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/Measure.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -57,7 +57,7 @@
$distance = $srsMap->MeasureEuclideanDistance($x1, $y1, $x2, $y2);
}
$distance = $srsMap->ConvertCoordinateSystemUnitsToMeters($distance);
- header('Content-type: text/x-json');
+ header('Content-type: application/json');
header('X-JSON: true');
echo "{distance:$distance}";
exit;
Modified: trunk/layers/MapGuide/php/Query.php
===================================================================
--- trunk/layers/MapGuide/php/Query.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/Query.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -350,7 +350,7 @@
//print_r($properties);
//echo "/* SelectionXML:".$selection->ToXML()."*/";
- header('Content-type: text/x-json');
+ header('Content-type: application/json');
header('X-JSON: true');
$layers = $selection->GetLayers();
$result = NULL;
Modified: trunk/layers/MapGuide/php/SaveSelection.php
===================================================================
--- trunk/layers/MapGuide/php/SaveSelection.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/SaveSelection.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -49,7 +49,7 @@
//now return a data struture which is the same as Query.php
//process
- header('Content-type: text/x-json');
+ header('Content-type: application/json');
header('X-JSON: true');
$layers = $selection->GetLayers();
Modified: trunk/layers/MapGuide/php/Selection.php
===================================================================
--- trunk/layers/MapGuide/php/Selection.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/Selection.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -139,7 +139,7 @@
}
-header('Content-type: text/x-json');
+header('Content-type: application/json');
header('X-JSON: true');
echo var2json($result);
Modified: trunk/layers/MapGuide/php/SetLayers.php
===================================================================
--- trunk/layers/MapGuide/php/SetLayers.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapGuide/php/SetLayers.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -30,7 +30,7 @@
*****************************************************************************/
-header('Content-type: text/x-json');
+header('Content-type: application/json');
header('X-JSON: true');
echo "{";
Modified: trunk/layers/MapServer/php/CreateSession.php
===================================================================
--- trunk/layers/MapServer/php/CreateSession.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/CreateSession.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -36,7 +36,7 @@
$sessionId = session_id();
loadFusionConfig();
-header('Content-type: text/x-json');
+header('Content-type: application/json');
header('X-JSON: true');
$result = null;
$result->sessionId = $sessionId;
Modified: trunk/layers/MapServer/php/LoadMap.php
===================================================================
--- trunk/layers/MapServer/php/LoadMap.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/LoadMap.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -139,8 +139,8 @@
$mapObj = NULL;
if ($oMap) {
- //header('Content-type: text/x-json');
- //header('X-JSON: true');
+ header('Content-type: application/json');
+ header('X-JSON: true');
$mapObj->sessionId = $sessionID;
$mapObj->mapId = $mapId;
Modified: trunk/layers/MapServer/php/LoadScaleRanges.php
===================================================================
--- trunk/layers/MapServer/php/LoadScaleRanges.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/LoadScaleRanges.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -140,7 +140,7 @@
}
-header('Content-type: text/x-json');
+header('Content-type: application/json');
header('X-JSON: true');
echo var2json($scaleObj);
Modified: trunk/layers/MapServer/php/Maptip.php
===================================================================
--- trunk/layers/MapServer/php/Maptip.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/Maptip.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -63,8 +63,8 @@
/* a spatial filter in the form on a WKT geometry */
$spatialFilter = (isset($_REQUEST['spatialfilter']) && $_REQUEST['spatialfilter'] != '') ? urldecode($_REQUEST['spatialfilter']) : false;
- // header('Content-type: text/x-json');
- // header('X-JSON: true');
+header('Content-type: application/json');
+header('X-JSON: true');
if (!isset($mapName)) {
die("{'error':'mapname not set'}");
Modified: trunk/layers/MapServer/php/Measure.php
===================================================================
--- trunk/layers/MapServer/php/Measure.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/Measure.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -58,7 +58,7 @@
$distance = GetMetersPerUnit($oMap->units)*$distance;
}
- header('Content-type: text/x-json');
+ header('Content-type: application/json');
header('X-JSON: true');
echo "{distance:$distance}";
exit;
Modified: trunk/layers/MapServer/php/Query.php
===================================================================
--- trunk/layers/MapServer/php/Query.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/Query.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -122,7 +122,7 @@
if ($bExtendSelection) {
}
-header('Content-type: text/x-json');
+header('Content-type: application/json');
header('X-JSON: true');
if ($result->hasSelection) {
$oMap->savequery(getSessionSavePath()."query.qry");
Modified: trunk/layers/MapServer/php/Selection.php
===================================================================
--- trunk/layers/MapServer/php/Selection.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/Selection.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -176,7 +176,7 @@
}
}
-header('Content-type: text/x-json');
+header('Content-type: application/json');
header('X-JSON: true');
echo var2json($result);
Modified: trunk/layers/MapServer/php/SetLayers.php
===================================================================
--- trunk/layers/MapServer/php/SetLayers.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/layers/MapServer/php/SetLayers.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -32,7 +32,7 @@
include ("Common.php");
include ("Utilities.php");
-header('Content-type: text/x-json');
+header('Content-type: application/json');
header('X-JSON: true');
if (isset($_SESSION['maps']) && isset($_SESSION['maps'][$mapName])) {
Modified: trunk/templates/mapserver/standard/ApplicationDefinition.xml
===================================================================
--- trunk/templates/mapserver/standard/ApplicationDefinition.xml 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/templates/mapserver/standard/ApplicationDefinition.xml 2009-03-04 20:38:53 UTC (rev 1806)
@@ -14,7 +14,7 @@
<Type>MapServer</Type>
<SingleTile>true</SingleTile>
<Extension>
- <MapFile>/ms4w/apps/gmap/htdocs/gmap_groups.map</MapFile>
+ <MapFile>/home/pdeschamps/fgs/apps/gmap-orig/htdocs/gmap_groups.map</MapFile>
</Extension>
</Map>
</MapGroup>
@@ -23,7 +23,7 @@
<Type>MapServer</Type>
<SingleTile>true</SingleTile>
<Extension>
- <MapFile>/ms4w/apps/gmap/htdocs/gmap75.map</MapFile>
+ <MapFile>/home/pdeschamps/fgs/apps/gmap-orig/htdocs/gmap75.map</MapFile>
</Extension>
</Map>
</MapGroup>
@@ -49,7 +49,7 @@
<Type>MapServer</Type>
<SingleTile>true</SingleTile>
<Extension>
- <MapFile>/ms4w/apps/gmap/htdocs/gmapLonLat.map</MapFile>
+ <MapFile>/home/pdeschamps/fgs/apps/gmap-orig/htdocs/gmap75.map</MapFile>
<Options>
<isBaseLayer>false</isBaseLayer>
<singleTile>true</singleTile>
@@ -1193,7 +1193,13 @@
<TextField>AREA_KMSQ</TextField>
<CustomURL>http://localhost/showParkArea.php?parkId=[PARK_ID]&areakmsq=[AREA_KMSQ]</CustomURL>
</Maptip>
+
<Maptip>
+ <Layer>Precipitation</Layer>
+ <Label>Station ID</Label>
+ <TextField>STATN_ID</TextField>
+ </Maptip>
+ <Maptip>
<Layer>park</Layer>
<Label>Year Established</Label>
<TextField>YEAR_EST</TextField>
Modified: trunk/templates/mapserver/standard/index.html
===================================================================
--- trunk/templates/mapserver/standard/index.html 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/templates/mapserver/standard/index.html 2009-03-04 20:38:53 UTC (rev 1806)
@@ -97,7 +97,8 @@
<div id="SelectionPanel"></div>
<div id="OverviewMap"></div>
</div>
-<div id="Map"><div id="Navigator"></div></div>
+<div id="Map"><div id="Navigator"></div>
+<div id="Maptip"></div></div>
<div id="Statusbar"></div>
<div id="TaskPane"></div>
<div id="PoweredBy" class="statusBarItem">
Modified: trunk/widgets/Legend.js
===================================================================
--- trunk/widgets/Legend.js 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/widgets/Legend.js 2009-03-04 20:38:53 UTC (rev 1806)
@@ -59,7 +59,7 @@
/**
* Constant: defaultRootFolderIcon
* {String} The default image for the root folder
- */
+ */
defaultRootFolderIcon: 'images/icons/legend-map.png',
/**
@@ -74,7 +74,7 @@
*/
defaultGroupInfoIcon: 'images/icons/tree_group_info.png',
- initializeWidget: function(widgetTag) {
+ initializeWidget: function(widgetTag) {
// TODO: maybe it's a good idea to do a function like Fusion.Widget.BindRenderer.. for limit the code
// duplication if we plan to apply this pattern to others widgets
Fusion.addWidgetStyleSheet(widgetTag.location + 'Legend/Legend.css');
@@ -85,7 +85,7 @@
if (json.LegendRenderer)
{
var renderer = eval(json.LegendRenderer[0]);
- if (renderer && renderer.prototype.CLASS_NAME
+ if (renderer && renderer.prototype.CLASS_NAME
&& renderer.prototype.CLASS_NAME == "Fusion.Widget.Legend.LegendRenderer") {
this.renderer = new renderer(this, widgetTag);
} else if (typeof renderer == "function") {
@@ -102,13 +102,13 @@
}
if (this.renderer.mapReloaded)
- this.getMap().registerForEvent(Fusion.Event.MAP_RELOADED,
+ this.getMap().registerForEvent(Fusion.Event.MAP_RELOADED,
OpenLayers.Function.bind(this.renderer.mapReloaded, this.renderer));
if (this.renderer.mapLoading)
- this.getMap().registerForEvent(Fusion.Event.MAP_LOADING,
+ this.getMap().registerForEvent(Fusion.Event.MAP_LOADING,
OpenLayers.Function.bind(this.renderer.mapLoading,this.renderer));
if (this.renderer.mapLoaded)
- this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,
+ this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,
OpenLayers.Function.bind(this.renderer.mapLoaded, this.renderer));
}
});
@@ -187,15 +187,15 @@
/* Class: Fusion.Widget.Legend.LegendRendererDefault
* This class provide a default legend as a collapsable tree.
- *
+ *
*/
-Fusion.Widget.Legend.LegendRendererDefault = OpenLayers.Class(Fusion.Widget.Legend.LegendRenderer,
+Fusion.Widget.Legend.LegendRendererDefault = OpenLayers.Class(Fusion.Widget.Legend.LegendRenderer,
{
/**
* Property: showRootFolder
* {Boolean} This controls whether the tree will have a single root node that
- * contains the name of the map as its label. By default, the root node does
+ * contains the name of the map as its label. By default, the root node does
* not appear. Set to "true" or "1" to make the root node appear.
*/
showRootFolder: false,
@@ -231,7 +231,7 @@
this.imgLayerDWFIcon = json.LayerDWFIcon ? json.LayerDWFIcon[0] : this.oLegend.defaultLayerDWFIcon;
this.imgLayerRasterIcon = json.LayerRasterIcon ? json.LayerRasterIcon[0] : this.oLegend.defaultLayerRasterIcon;
this.imgLayerThemeIcon = json.LayerThemeIcon ? json.LayerThemeIcon[0] : this.oLegend.defaultLayerThemeIcon;
- this.imgDisabledLayerIcon = json.DisabledLayerIcon ? json.DisabledLayerIcon[0] : this.oLegend.defaultDisabledLayerIcon;
+ this.imgDisabledLayerIcon = json.DisabledLayerIcon ? json.DisabledLayerIcon[0] : this.oLegend.defaultDisabledLayerIcon;
this.imgLayerInfoIcon = json.LayerInfoIcon ? json.LayerInfoIcon[0] : this.oLegend.defaultLayerInfoIcon;
this.imgGroupInfoIcon = json.GroupInfoIcon ? json.GroupInfoIcon[0] : this.oLegend.defaultGroupInfoIcon;
@@ -425,7 +425,7 @@
label: group.legendLabel,
open: group.expandInLegend,
draw: this.renderFolder,
- 'class':'fusionLegendFolder'
+ 'class':'fusionLegendFolder'
};
group.legend.treeItem = new Jx.TreeFolder(opt);
group.legend.treeItem.contextMenu = this.getContextMenu(group.legend.treeItem);
@@ -522,7 +522,7 @@
}
for (var i=0; i<group.layers.length; i++) {
this.updateLayer(group.layers[i], fScale);
- }
+ }
},
updateLayer: function(layer, fScale) {
@@ -564,7 +564,7 @@
layer.legend.treeItem = this.createTreeItem(layer, style, fScale, this.bIncludeVisToggle);
OpenLayers.Event.observe(layer.legend.treeItem.checkBox, 'click', OpenLayers.Function.bind(this.stateChanged, this, layer));
- layer.parentGroup.legend.treeItem.append(layer.legend.treeItem);
+ layer.parentGroup.legend.treeItem.append(layer.legend.treeItem);
} else if (layer.legend.treeItem instanceof Jx.TreeFolder) {
this.clearTreeItem(layer);
layer.legend.treeItem = this.createTreeItem(layer, style, fScale, this.bIncludeVisToggle);
@@ -578,7 +578,7 @@
} else {
$(layer.legend.treeItem.domObj).addClass('jxDisabled');
}
- }
+ }
}
layer.legend.treeItem.checkBox.checked = layer.visible?true:false;
if (layer.layerTypes[0] == 4 || range.styles.length > 0) {
Modified: trunk/widgets/ScalebarDual.js
===================================================================
--- trunk/widgets/ScalebarDual.js 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/widgets/ScalebarDual.js 2009-03-04 20:38:53 UTC (rev 1806)
@@ -34,8 +34,8 @@
initializeWidget: function(widgetTag) {
var json = widgetTag.extension;
var maxWidth = json.MaxWidth ? parseInt(json.MaxWidth[0]) : 300;
- var topInUnits = json.TopInUnits ? json.TopInUnits[0] : 'ft';
- var topOutUnits = json.TopOutUnits ? json.TopOutUnits[0] : 'mi';
+ var topInUnits = json.TopInUnits ? json.TopInUnits[0] : 'in';
+ var topOutUnits = json.TopOutUnits ? json.TopOutUnits[0] : 'cm';
var bottomInUnits = json.BottomInUnits ? json.BottomInUnits[0] : 'm';
var bottomOutUnits = json.BottomOutUnits ? json.BottomOutUnits[0] : 'km';
var options = { //set these from widgetTag extension
Modified: trunk/widgets/SelectWithin/SelectWithin.php
===================================================================
--- trunk/widgets/SelectWithin/SelectWithin.php 2009-03-04 20:27:32 UTC (rev 1805)
+++ trunk/widgets/SelectWithin/SelectWithin.php 2009-03-04 20:38:53 UTC (rev 1806)
@@ -123,7 +123,7 @@
}
}
- header('Content-type: text/x-json');
+ header('Content-type: application/json');
header('X-JSON: true');
echo var2json($result);
} catch(MgException $e) {
More information about the fusion-commits
mailing list