Error at $map->Open(...)

alexgonc alexgonc at gmail.com
Tue Nov 28 06:16:42 EST 2006


Hi all

I'm essaying MG using IIS on Windows XP and trying to make a new thematic
layer for my own data, so I've already built my own map using the authoring
tool, Autodesk MapGuide Studio.

I'm using PHP to build the expression for it, with strings, as it is shown
in the code example available at 
  Live Gallery -->
     Modifying Maps & Layers -->
        Create Square Footage Layer  
for which code is available at this URL:
http://data.mapguide.com/mapguide/devguide/viewsource.php?FILENAME=D%3A%5CMapGuideOpenSourceWeb%5Cwww%5Cdevguide%5Cmodifying_maps_and_layers%5Ccreate_new_SquareFootage_layer_definition.php

However, my browser handles an error at the line:

   $map->Open($resourceService, 'New Map');

The error message states:

"ERROR: Invalid argument(s): [0] = " " The string cannot be empty.
Invalid argument(s): [0] = " " The string cannot be empty. Exception
occurred in method MgMap.Open at line 483 in file
c:\build_tux_area\mgdev_opensource\common\service\maplayer\Map.cpp
- MgMap.Open line 483 file
c:\build_tux_area\mgdev_opensource\common\service\maplayer\Map.cpp "

My questions are:
1. What is this "C:\build_tux_area\..." file doing here? I've no such file.
2. What are the arguments that the Open request needs? I've no idea what the
error message points out as invalid argument.
3. Am I including all the needed code lines before the Open request?
4. (Finally) Will the new version of examples include a dotnet sample to do
thematic mapping?

Thanks for the answers!

My code follows:

///////////////////////////////////////////////////////////////////////////////////////////////////////
try
{


    // Initialize a PHP session and register a variable to hold the
    // Server session id, then initialize the Web Extensions,
    // and connect to the Server, and create a session.

    session_start();
    session_register('mgSessionId');

    MgInitializeWebTier ($configFilePath);

    $userInfo = new MgUserInformation("Anonymous", "");
    //$userInfo = new MgUserInformation("Administrator", "admin");
    $site = new MgSite();

    $site->Open($userInfo);

    $HTTP_SESSION_VARS['mgSessionId'] = $site->CreateSession();
    $mapDefinition = "Library://Samples/Concelhos_de_Portugal/Maps/New
Map.MapDefinition";
    $webLayout = "Library://Samples/Concelhos_de_Portugal/Layouts/New Web
layout.WebLayout";

    $siteConnection = new MgSiteConnection();
    $siteConnection->Open($userInfo);
    $resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);
    $map = new MgMap();

//*********** ERROR IS IN THE LINE BELOW
 $map->Open($resourceService, 'New Map');
//************

    $factory = new LayerDefinitionFactory();
    $areaRule1 = $factory->CreateAreaRule(  '1 a 100', 'CONC_ID >= 1 AND
CONC_ID < 100',     'FFFFFF00');
    $areaRule2 = $factory->CreateAreaRule('100 a 200', 'CONC_ID >= 100
AND CONC_ID < 200',  'FFFFBF20');
    $areaRule3 = $factory->CreateAreaRule('200 a 400', 'CONC_ID >= 200
AND CONC_ID < 400', 'FFFF8040');

    $areaTypeStyle = $factory->CreateAreaTypeStyle($areaRule1 . $areaRule2 .
$areaRule3);

    $minScale = '0';
    $maxScale = '10000';
    $areaScaleRange = $factory->CreateScaleRange($minScale, $maxScale,
$areaTypeStyle);


}

-- 
View this message in context: http://www.nabble.com/Error-at-%24map-%3EOpen%28...%29-tf2717746.html#a7577382
Sent from the MapGuide Dev mailing list archive at Nabble.com.





More information about the Mapguide-internals mailing list