[fusion-commits] r2847 - in trunk: layers/MapGuide/php widgets/BufferPanel widgets/FeatureInfo/classes widgets/Query/classes widgets/QuickPlot widgets/Redline/classes widgets/Search widgets/SelectWithin widgets/Theme/classes
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Jun 17 04:56:08 PDT 2014
Author: jng
Date: 2014-06-17 04:56:07 -0700 (Tue, 17 Jun 2014)
New Revision: 2847
Modified:
trunk/layers/MapGuide/php/Buffer.php
trunk/layers/MapGuide/php/ClearSelection.php
trunk/layers/MapGuide/php/GetSelectionProperties.php
trunk/layers/MapGuide/php/LayerInfo.php
trunk/layers/MapGuide/php/Legend.php
trunk/layers/MapGuide/php/LoadMap.php
trunk/layers/MapGuide/php/LoadScaleRanges.php
trunk/layers/MapGuide/php/Measure.php
trunk/layers/MapGuide/php/Query.php
trunk/layers/MapGuide/php/SaveMap.php
trunk/layers/MapGuide/php/SaveSelection.php
trunk/layers/MapGuide/php/Selection.php
trunk/layers/MapGuide/php/SetLayers.php
trunk/layers/MapGuide/php/Utilities.php
trunk/widgets/BufferPanel/Buffer.php
trunk/widgets/FeatureInfo/classes/featureinfo.php
trunk/widgets/Query/classes/query.php
trunk/widgets/QuickPlot/GenerateLegend.php
trunk/widgets/QuickPlot/GeneratePicture.php
trunk/widgets/Redline/classes/markupeditor.php
trunk/widgets/Redline/classes/markupmanager.php
trunk/widgets/Search/Search.php
trunk/widgets/SelectWithin/SelectWithin.php
trunk/widgets/Theme/classes/theme.php
Log:
This submission includes the following changes:
- Remove usage of deprecated APIs.
- MgMap() constructor and related methods (replaced with MgMap(MgSiteConnection) and related methods)
- MgCreateSdfParams (replaced with MgFileFeatureSourceParams)
- Fix PHP warnings in Selection.php
Modified: trunk/layers/MapGuide/php/Buffer.php
===================================================================
--- trunk/layers/MapGuide/php/Buffer.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/Buffer.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -60,8 +60,8 @@
$schemaName = 'BufferSchema';
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
/* Get the map SRS - we use this to convert distances */
$srsFactory = new MgCoordinateSystemFactory();
@@ -268,7 +268,7 @@
}
$result = $featureService->UpdateFeatures($featureSourceId, $oCommandsColl, false);
$layer->ForceRefresh();
- $map->Save($resourceService);
+ $map->Save();
echo "<Buffer>";
echo "<Layer>".$layerId->ToString();
echo "</Layer>";
Modified: trunk/layers/MapGuide/php/ClearSelection.php
===================================================================
--- trunk/layers/MapGuide/php/ClearSelection.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/ClearSelection.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -39,8 +39,8 @@
{
$resourceSrvc = $siteConnection->CreateService(MgServiceType::ResourceService);
- $map = new MgMap();
- $map->Open($resourceSrvc, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$sel = new MgSelection($map);
Modified: trunk/layers/MapGuide/php/GetSelectionProperties.php
===================================================================
--- trunk/layers/MapGuide/php/GetSelectionProperties.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/GetSelectionProperties.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -40,8 +40,8 @@
{
//load the map runtime state
//
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
// Create the selection set
$selection = new MgSelection($map);
if($selText != "") {
Modified: trunk/layers/MapGuide/php/LayerInfo.php
===================================================================
--- trunk/layers/MapGuide/php/LayerInfo.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/LayerInfo.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -49,8 +49,8 @@
}
//Get a runtime map from a map definition
-$map = new MgMap();
-$map->Open($resourceService, $mapName);
+$map = new MgMap($siteConnection);
+$map->Open($mapName);
//Get the layer
$layerCollection=$map->GetLayers();
@@ -68,7 +68,7 @@
} else {
$layer->SetSelectable(false);
}
- $map->Save($resourceService);
+ $map->Save();
}
//property mappings from the session
Modified: trunk/layers/MapGuide/php/Legend.php
===================================================================
--- trunk/layers/MapGuide/php/Legend.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/Legend.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -46,9 +46,9 @@
}
//Get a runtime map from a map definition
-$map = new MgMap();
+$map = new MgMap($siteConnection);
-$map->Open($resourceService, $mapName);
+$map->Open($mapName);
//Get layer collection as xml
header('content-type: text/xml');
Modified: trunk/layers/MapGuide/php/LoadMap.php
===================================================================
--- trunk/layers/MapGuide/php/LoadMap.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/LoadMap.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -48,11 +48,11 @@
if (isset($_REQUEST['mapid']))
{
$mapid = $_REQUEST['mapid'];
- $resourceID = new MgResourceIdentifier($mapid);
- $map = new MgMap();
+ $resourceID = new MgResourceIdentifier($mapid);
+ $map = new MgMap($siteConnection);
$mapTitle = $resourceID->GetName();
- $map->Create($resourceService, $resourceID, $mapTitle);
+ $map->Create($resourceID, $mapTitle);
$mapName = uniqid($mapTitle);
$mapStateId = new MgResourceIdentifier("Session:" . $sessionID . "//" . $mapName . "." . MgResourceType::Map);
@@ -65,8 +65,8 @@
$map->Save($resourceService, $mapStateId);
} else {
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$mapTitle = $map->GetName();
$mapid = $map->GetMapDefinition()->ToString();
}
Modified: trunk/layers/MapGuide/php/LoadScaleRanges.php
===================================================================
--- trunk/layers/MapGuide/php/LoadScaleRanges.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/LoadScaleRanges.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -59,8 +59,8 @@
$mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
-$map = new MgMap();
-$map->Open($resourceService, $mapName);
+$map = new MgMap($siteConnection);
+$map->Open($mapName);
$layers=$map->GetLayers();
$scaleObj = new stdClass();
Modified: trunk/layers/MapGuide/php/Measure.php
===================================================================
--- trunk/layers/MapGuide/php/Measure.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/Measure.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -50,8 +50,8 @@
$y1 = $_REQUEST['y1'];
$x2 = $_REQUEST['x2'];
$y2 = $_REQUEST['y2'];
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$srsFactory = new MgCoordinateSystemFactory();
$srs = GetMapSRS($map);
$srsMap = $srsFactory->Create($srs);
Modified: trunk/layers/MapGuide/php/Query.php
===================================================================
--- trunk/layers/MapGuide/php/Query.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/Query.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -76,8 +76,8 @@
/* open the map from the session using the provided map name. The map was
previously created by calling LoadMap. */
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
/* add the features to the map selection and save it*/
$selection = new MgSelection($map);
Modified: trunk/layers/MapGuide/php/SaveMap.php
===================================================================
--- trunk/layers/MapGuide/php/SaveMap.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/SaveMap.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -45,8 +45,8 @@
{
$mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
$renderingService = $siteConnection->CreateService(MgServiceType::RenderingService);
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$selection = new MgSelection($map);
$selection->Open($resourceService, $mapName);
Modified: trunk/layers/MapGuide/php/SaveSelection.php
===================================================================
--- trunk/layers/MapGuide/php/SaveSelection.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/SaveSelection.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -42,8 +42,8 @@
{
//load the map runtime state
//
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
// Create the selection set and save it
$selection = new MgSelection($map);
if($selText != "") {
Modified: trunk/layers/MapGuide/php/Selection.php
===================================================================
--- trunk/layers/MapGuide/php/Selection.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/Selection.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -38,7 +38,7 @@
include('../../../common/php/Utilities.php');
include('Utilities.php');
-$result = NULL;
+$result = new stdClass();
$result->layers = array();
if (isset($_SESSION['selection_array']))
@@ -69,7 +69,7 @@
$aSelectedLayers = $properties->layers;
if (count($aSelectedLayers) > 0)
{
- $result->extents = NULL;
+ $result->extents = new stdClass();
$result->extents->minx = $properties->extents->minx;
$result->extents->miny = $properties->extents->miny;
$result->extents->maxx = $properties->extents->maxx;
@@ -84,6 +84,7 @@
$properties->$layerNameInProperties->numelements > 0)
{
array_push($result->layers, $layerName);
+ $result->$layerName = new stdClass();
$result->$layerName->propertynames = $properties->$layerNameInProperties->propertynames;
$result->$layerName->propertyvalues = $properties->$layerNameInProperties->propertyvalues;
$result->$layerName->propertytypes = $properties->$layerNameInProperties->propertytypes;
Modified: trunk/layers/MapGuide/php/SetLayers.php
===================================================================
--- trunk/layers/MapGuide/php/SetLayers.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/SetLayers.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -54,8 +54,8 @@
/* open the map from the session using the provided map name. The map was
previously created by calling LoadMap. */
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$mapLayers = $map->GetLayers();
@@ -99,7 +99,7 @@
}
*/
- $map->Save($resourceService);
+ $map->Save();
echo "success: true";
}
catch (MgException $e)
Modified: trunk/layers/MapGuide/php/Utilities.php
===================================================================
--- trunk/layers/MapGuide/php/Utilities.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/layers/MapGuide/php/Utilities.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -56,7 +56,7 @@
$schema->GetClasses()->Add($classDef);
//finally, creation of the feature source
- $params = new MgCreateSdfParams("LatLong", GetMapSRS($map), $schema);
+ $params = new MgFileFeatureSourceParams("OSGeo.SDF", "LatLong", GetMapSRS($map), $schema);
$featureService->CreateFeatureSource($dataSourceId, $params);
}
Modified: trunk/widgets/BufferPanel/Buffer.php
===================================================================
--- trunk/widgets/BufferPanel/Buffer.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/BufferPanel/Buffer.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -80,8 +80,8 @@
//load the map runtime state
//
- $map = new MgMap();
- $map->Open($resourceSrvc, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
//locate the buffer layer in the map. It might or might not already exist
//
@@ -147,7 +147,7 @@
$schema->GetClasses()->Add($classDef);
//finally, creation of the feature source
- $sdfParams = new MgCreateSdfParams("LatLong", $srsDefMap, $schema);
+ $sdfParams = new MgFileFeatureSourceParams("OSGeo.SDF", "LatLong", $srsDefMap, $schema);
$featureSrvc->CreateFeatureSource($dataSourceId, $sdfParams);
//Add layer to map
@@ -325,7 +325,7 @@
// Save the new map state
//
$layer->ForceRefresh();
- $map->Save($resourceSrvc);
+ $map->Save();
//build report message
$title = GetLocalizedString( "BUFFERREPORTTITLE", $locale );
Modified: trunk/widgets/FeatureInfo/classes/featureinfo.php
===================================================================
--- trunk/widgets/FeatureInfo/classes/featureinfo.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/FeatureInfo/classes/featureinfo.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -38,8 +38,8 @@
$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
$layers = $map->GetLayers();
for ($i = 0; $i < $layers->GetCount(); $i++)
Modified: trunk/widgets/Query/classes/query.php
===================================================================
--- trunk/widgets/Query/classes/query.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/Query/classes/query.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -67,10 +67,8 @@
{
$layerNames = array();
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
$layers = $map->GetLayers();
for ($i = 0; $i < $layers->GetCount(); $i++)
@@ -93,18 +91,13 @@
{
$properties = array();
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
+ $layers = $map->GetLayers();
+ $layer = $layers->GetItem($this->args['LAYERNAME']);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
- $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
+ $classDef = $layer->GetClassDefinition();
- $featureService = $this->site->CreateService(MgServiceType::FeatureService);
- $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
- $schemaClass = explode(':', $layer->GetFeatureClassName());
-
- $classDef = $featureService->GetClassDefinition($resId, $schemaClass[0], $schemaClass[1]);
-
for ($i = 0; $i < $classDef->GetProperties()->GetCount(); $i++)
{
$propertyDef = $classDef->GetProperties()->GetItem($i);
@@ -125,11 +118,9 @@
{
$result = true;
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
-
$layers = $map->GetLayers();
if ($layers->Contains('_QuerySpatialFilter'))
{
@@ -139,7 +130,7 @@
else
$layer->SetVisible(false);
- $map->Save($resourceService);
+ $map->Save();
}
return $result;
@@ -156,8 +147,8 @@
$updateCommands = new MgFeatureCommandCollection();
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
$layer = null;
$layers = $map->GetLayers();
@@ -171,7 +162,7 @@
// Create the Feature Source (SDF)
$sdfSchema = $this->CreateFilterSchema();
- $sdfParams = new MgCreateSdfParams('MAPCS', $map->GetMapSRS(), $sdfSchema);
+ $sdfParams = new MgFileFeatureSourceParams('OSGeo.SDF', 'MAPCS', $map->GetMapSRS(), $sdfSchema);
$featureService->CreateFeatureSource($sdfResId, $sdfParams);
// Create the Layer
@@ -197,7 +188,7 @@
// Make the layer visible
$layer->SetVisible(true);
- $map->Save($resourceService);
+ $map->Save();
// Add the geometry to the filter feature source
@@ -219,12 +210,11 @@
{
$result = array();
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
+ $layers = $map->GetLayers();
+ $layer = $layers->GetItem($this->args['LAYERNAME']);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
- $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
-
$featureService = $this->site->CreateService(MgServiceType::FeatureService);
$resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
$featureClass = $layer->GetFeatureClassName();
@@ -233,9 +223,9 @@
// Initialize the coordinate system transform
- $schemaAndClass = explode(":", $featureClass);
- $classDef = $featureService->GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);
- $geomProp = $classDef->GetProperties()->GetItem($featureGeometry);
+ $classDef = $layer->GetClassDefinition();
+ $clsProps = $classDef->GetProperties();
+ $geomProp = $clsProps->GetItem($featureGeometry);
$spatialContext = $geomProp->GetSpatialContextAssociation();
$csTransform = null;
@@ -296,7 +286,7 @@
$count = 0;
$geometryReaderWriter = new MgAgfReaderWriter();
- $featureReader = $featureService->SelectFeatures($resId, $layer->GetFeatureClassName(), $queryOptions);
+ $featureReader = $layer->SelectFeatures($queryOptions);
while ($featureReader->ReadNext() && ($queryMax <= 0 || $count < $queryMax))
{
$displayValue = $this->GetFeaturePropertyValue($featureReader, $this->args['OUTPUTPROPERTY']);
@@ -319,16 +309,14 @@
function GetSelectionXML()
{
$json = new Services_JSON();
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
$featureService = $this->site->CreateService(MgServiceType::FeatureService);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
- $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
- $resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
+ $layers = $map->GetLayers();
+ $layer = $layers->GetItem($this->args['LAYERNAME']);
$featureClass = $layer->GetFeatureClassName();
- $schemaAndClass = explode(":", $featureClass);
- $classDef = $featureService->GetClassDefinition($resId, $schemaAndClass[0], $schemaAndClass[1]);
+ $classDef = $layer->GetClassDefinition();
$properties = new MgPropertyCollection();
$idList = $json->decode($this->args['IDLIST']);
Modified: trunk/widgets/QuickPlot/GenerateLegend.php
===================================================================
--- trunk/widgets/QuickPlot/GenerateLegend.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/QuickPlot/GenerateLegend.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -190,8 +190,8 @@
$resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
$mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$scale = $map->GetViewScale();
CompileVisibleLayerCount($map);
Modified: trunk/widgets/QuickPlot/GeneratePicture.php
===================================================================
--- trunk/widgets/QuickPlot/GeneratePicture.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/QuickPlot/GeneratePicture.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -94,11 +94,10 @@
$userInfo = new MgUserInformation($sessionID);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
- $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
$renderingService = $siteConnection->CreateService(MgServiceType::RenderingService);
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$selection = new MgSelection($map);
@@ -117,14 +116,14 @@
$color = new MgColor($colorString);
$mgReader = $renderingService->RenderMap($map,
- $selection,
- $center,
- $scaleDenominator,
- $toSize->width,
- $toSize->height,
- $color,
- "PNG",
- false);
+ $selection,
+ $center,
+ $scaleDenominator,
+ $toSize->width,
+ $toSize->height,
+ $color,
+ "PNG",
+ false);
$tempImage = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "mgo" . uniqid();
$mgReader->ToFile($tempImage);
Modified: trunk/widgets/Redline/classes/markupeditor.php
===================================================================
--- trunk/widgets/Redline/classes/markupeditor.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/Redline/classes/markupeditor.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -77,7 +77,6 @@
function GetTransform()
{
$coordSysFactory = new MgCoordinateSystemFactory();
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
$featureService = $this->site->CreateService(MgServiceType::FeatureService);
$featureSourceId = $this->GetFeatureSource();
@@ -89,8 +88,8 @@
$wkt = $scReader->GetCoordinateSystemWkt();
$scReader->Close();
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
if (null == $wkt)
return null; //It's bunk. Assume map SRS
@@ -285,10 +284,8 @@
function GetSelectionXML()
{
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
-
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
$markupLayer = $map->GetLayers()->GetItem('_' . $this->GetMarkupName());
$selection = new MgSelection($map);
Modified: trunk/widgets/Redline/classes/markupmanager.php
===================================================================
--- trunk/widgets/Redline/classes/markupmanager.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/Redline/classes/markupmanager.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -344,8 +344,8 @@
{
$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
// Create the Layer Groups
@@ -375,23 +375,21 @@
$markupLayer->SetGroup($markupGroup);
$map->GetLayers()->Insert(0, $markupLayer);
- $map->Save($resourceService);
+ $map->Save();
}
function CloseMarkup()
{
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
-
// Add the Markup Layer
$markupLayerResId = new MgResourceIdentifier($this->args['OPENMARKUP']);
$index = $map->GetLayers()->IndexOf('_' . $markupLayerResId->GetName());
$map->GetLayers()->RemoveAt($index);
- $map->Save($resourceService);
+ $map->Save();
}
function UniqueMarkupName(&$markupName)
@@ -695,8 +693,8 @@
$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
$featureService = $this->site->CreateService(MgServiceType::FeatureService);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
$featureSourceId = "";
$bUpdate = array_key_exists("EDITMARKUPLAYER", $this->args) && array_key_exists("MARKUPLAYERNAME", $this->args) && array_key_exists("EDITFEATURESOURCE", $this->args);
@@ -1135,11 +1133,9 @@
{
$openMarkup = array();
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
-
$layerGroups = $map->GetLayerGroups();
if ($layerGroups->Contains('_Markup'))
{
Modified: trunk/widgets/Search/Search.php
===================================================================
--- trunk/widgets/Search/Search.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/Search/Search.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -67,8 +67,8 @@
$featureSrvc = $siteConnection->CreateService(MgServiceType::FeatureService);
//Create a temporary map runtime object, locate the layer
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$layers = $map->GetLayers();
$layer = null;
//fwrite($logHandle,"found layers:".$layers->GetCount()."\n");
Modified: trunk/widgets/SelectWithin/SelectWithin.php
===================================================================
--- trunk/widgets/SelectWithin/SelectWithin.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/SelectWithin/SelectWithin.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -46,8 +46,8 @@
$renderingSrvc = $siteConnection->CreateService(MgServiceType::RenderingService);
//load the map runtime state
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
//object to hold response
$result = NULL;
Modified: trunk/widgets/Theme/classes/theme.php
===================================================================
--- trunk/widgets/Theme/classes/theme.php 2014-06-14 15:52:16 UTC (rev 2846)
+++ trunk/widgets/Theme/classes/theme.php 2014-06-17 11:56:07 UTC (rev 2847)
@@ -40,11 +40,10 @@
{
$layerNames = array();
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
$featureService = $this->site->CreateService(MgServiceType::FeatureService);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
$layers = $map->GetLayers();
for ($i = 0; $i < $layers->GetCount(); $i++)
@@ -89,9 +88,10 @@
$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
- $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
+ $layers = $map->GetLayers();
+ $layer = $layers->GetItem($this->args['LAYERNAME']);
// First get a list of all of the Feature Class properties that can be used for theming.
@@ -150,13 +150,11 @@
function GetPropertyMinMaxCount()
{
- $resourceService = $this->site->CreateService(MgServiceType::ResourceService);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
+ $layers = $map->GetLayers();
+ $layer = $layers->GetItem($this->args['LAYERNAME']);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
- $layer = $map->GetLayers()->GetItem($this->args['LAYERNAME']);
-
- $featureService = $this->site->CreateService(MgServiceType::FeatureService);
$resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
$filter = $layer->GetFilter();
@@ -193,7 +191,7 @@
if($filter != '')
$queryOptions->SetFilter($filter);
- $featureReader = $featureService->SelectFeatures($resId, $layer->GetFeatureClassName(), $queryOptions);
+ $featureReader = $layer->SelectFeatures($queryOptions);
while($featureReader->ReadNext())
{
@@ -228,8 +226,8 @@
$resourceService = $this->site->CreateService(MgServiceType::ResourceService);
$featureService = $this->site->CreateService(MgServiceType::FeatureService);
- $map = new MgMap();
- $map->Open($resourceService, $this->args['MAPNAME']);
+ $map = new MgMap($this->site);
+ $map->Open($this->args['MAPNAME']);
$layers = $map->GetLayers();
$layer = $layers->GetItem($this->args['LAYERNAME']);
@@ -317,7 +315,7 @@
$aggregateOptions->AddComputedProperty('THEME_VALUE', 'UNIQUE("' . $this->args['PROPERTYNAME'] . '")');
if($filter != '')
$aggregateOptions->SetFilter($filter);
- $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
+ $dataReader = $layer->SelectAggregate($aggregateOptions);
while ($dataReader->ReadNext())
{
$value = $this->GetFeaturePropertyValue($dataReader, 'THEME_VALUE');
@@ -377,7 +375,7 @@
if($filter != '')
$aggregateOptions->SetFilter($filter);
- $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
+ $dataReader = $layer->SelectAggregate($aggregateOptions);
while ($dataReader->ReadNext())
{
$value = $this->GetFeaturePropertyValue($dataReader, 'THEME_VALUE');
@@ -446,7 +444,7 @@
$newLayer->SetSelectable($layer->GetLegendLabel());
$layers->Insert($layers->IndexOf($layer), $newLayer);
- $map->Save($resourceService);
+ $map->Save();
return $uniqueName;
}
More information about the fusion-commits
mailing list