Dave, r u using the standard redding mgp sample?

can you save the attached file is under
C:\Program Files\MapGuideOpenSource2.0\WebServerExtensions\www\

and then call 
http://localhost:8008/mapguide/dumpmap.php?map=Library://Dave/Redding/ReddingTiled.MapDefinition

this dumps out the required configuration parameters...

it's not currently possible to write an ajax client without delving
into the web api to
extract the configuration params, grrr which is a pain

z

On Tue, Jan 6, 2009 at 5:11 AM, Dave Wilson <[email protected]> wrote:
> Happy New Year Zac.
>
> I can see the difference in the requests. Here are two using the seeder that 
> fail:
>
> <2009-01-05T10:43:31>           127.0.0.1       qa      
> GetTile.1.2.0:5(Library://Dave/Redding/ReddingTiled.MapDefinition,Base 
> Layers,229499,153168,7) Success
> <2009-01-05T10:43:31>           127.0.0.1       qa      
> GetTile.1.2.0:5(Library://Dave/Redding/ReddingTiled.MapDefinition,Base 
> Layers,229501,153169,7) Success
>
> And here is one from the viewer which works:
>
> <2009-01-05T10:44:05>   Ajax Viewer     144.111.170.116 qa      
> GetTile.1.2.0:5(Library://Dave/Redding/ReddingTiled.MapDefinition,Base 
> Layers,2,1,7) Success
>
> The symptom is in the column and row parameters which are huge.
>
> The projection is a California State Plane CA-I (NAD27 California State 
> Planes, Zone I(401), US Foot)
>
> However the map doesn't load so I'm thinking the OpenLayers call to generate 
> the layer fails, yet an alert confirms the center is correct for the bounds. 
> I'm trying to figure out how to step through the script to see where it's 
> failing in Firebug.
>
> Thanks,
> Dave
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Zac Spitzer
> Sent: Friday, December 19, 2008 5:14 PM
> To: MapGuide Users Mail List
> Subject: Re: [mapguide-users] mapguide_tile_seeder.html problems
>
> ok, it's a pure openlayers question then, which fusion / flexible
> layers & studio also uses
>
> in the mapguide server access log you should be seeing GetTile requests
>
> opening the map in the basic viewer should be generating the same
> initial GetTile requests
> as the tiler should be generating (unless you have an custom initial
> view specified)
>
> can you post access log extracts generated by both the tiler and the
> basic viewer?
>
> BTW which one of these projections are you using?
>
> http://spatialreference.org/ref/?search=Montana&srtext=Search
>
> z
>
>
> On Sat, Dec 20, 2008 at 7:47 AM, Dave Wilson <[email protected]> wrote:
>> Ok that doesn't appear to be exactly the problem. I do get the center of the 
>> map shown by the alert so the bounds are correct.
>>
>> I tried the seeder with Sheboygan and that works, but it fails to load my 
>> non-LL84 based map. There are no errors in the server error log to indicate 
>> the call to center and zoom the map fails. The bounds and coordinates all 
>> look good. The map just isn't loaded and I can't see a reason for it. It's 
>> not something silly like the path is wrong otherwise I'd be getting errors 
>> in the server error log.
>>
>> Otherwise it looks cool when it runs Sheboygan.
>>
>> Dave
>>
>> -----Original Message-----
>> From: [email protected] 
>> [mailto:[email protected]] On Behalf Of Zac Spitzer
>> Sent: Friday, December 19, 2008 12:42 AM
>> To: MapGuide Users Mail List
>> Subject: Re: [mapguide-users] mapguide_tile_seeder.html problems
>>
>> whats does alert(extent.getCenterLonLat()); shown?
>>
>> z
>>
>> On Fri, Dec 19, 2008 at 11:34 AM, Dave Wilson <[email protected]> 
>> wrote:
>>> I'm not a programmer per say, but I'm technical enough to break things
>>> rather well J
>>>
>>>
>>>
>>> I'm trying to use the mapguide_tile_seeer.html in the context of MapGuide
>>> Enterprise 2009.
>>>
>>>
>>>
>>> I copied the script to my www folder (virtual directory root of my MapGuide
>>> site).
>>>
>>> I edited the reference to OpenLayers to be <script
>>> src="http://openlayers.org/api/OpenLayers.js";></script>
>>>
>>> I changed my main URL.
>>>
>>> I changed my bounds to match my map (note for coordinate systems with bounds
>>> that are not lat/lon don't include comma separators in the bounds values).
>>>
>>> I changed my temp scales to match those defined in my map.
>>>
>>> I changed my map definition to point to my map resource.
>>>
>>> I changed the base layer group name.
>>>
>>>
>>>
>>> My map is not in a Lat/Lon coordinate system, but Montana State Plane. My
>>> map doesn't load. I'm guessing that the line to center the map fails as it's
>>> trying to do a map.setCenter(extent.getCenterLonLat());
>>>
>>>
>>>
>>> What do I need to modify this to for non-LonLat maps?
>>>
>>>
>>>
>>> Or is the problem likely something else. I know my path to my map is valid.
>>>
>>>
>>>
>>> Any help is appreciated.
>>>
>>>
>>>
>>> I would also like to add that maybe some comments in the top of the file to
>>> highlight the 7 required steps above might be useful in explaining how to
>>> use the file J
>>>
>>>
>>>
>>> Dave
>>>
>>>
>>>
>>> Dave Wilson
>>>
>>> GBU CRT, Calgary
>>>
>>> Autodesk Canada Inc
>>>
>>> Ph: 403.538.3069
>>>
>>> Fax: 403.264.1442
>>>
>>>
>>>
>>> _______________________________________________
>>> mapguide-users mailing list
>>> [email protected]
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>
>>>
>>
>>
>>
>> --
>> Zac Spitzer -
>> http://zacster.blogspot.com
>> +61 405 847 168
>> _______________________________________________
>> mapguide-users mailing list
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>> _______________________________________________
>> mapguide-users mailing list
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>
>
>
> --
> Zac Spitzer -
> http://zacster.blogspot.com
> +61 405 847 168
> _______________________________________________
> mapguide-users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>



-- 
Zac Spitzer -
http://zacster.blogspot.com
+61 405 847 168
 <?php
    try
    {
        // Include constants like MgServiceType::ResourceService
//        include '/usr/local/mapguideopensource/webserverextensions/www/mapviewerphp/constants.php';		
        include 'C:\Program Files\MapGuideOpenSource2.0\WebServerExtensions\www\mapviewerphp\Constants.php';
        // Initialize
        //MgInitializeWebTier('../webconfig.ini');
        MgInitializeWebTier('C:\Program Files\MapGuideOpenSource2.0\WebServerExtensions\www\webconfig.ini');
		

        // Initialize


		
        // Establish a connection with a MapGuide site.
        $user = new MgUserInformation('Administrator', 'text8');
        $siteConnection = new MgSiteConnection();
        $siteConnection->Open($user);
        // Create a session repository
        $site = $siteConnection->GetSite();
        $sessionID = $site->CreateSession();
        $user->SetMgSessionId($sessionID);
        // Get an instance of the required services.
        $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
        $mappingService = $siteConnection->CreateService(MgServiceType::MappingService);
   
        // Get a runtime map from a map definition
        $resourceID = new  MgResourceIdentifier($_GET['map']);
        $map = new MgMap();
        $map->Create($resourceService, $resourceID, 'Calgary');
   
        // Show information about the map
        echo "   Session ID of map:      " . $map->GetSessionId() . "<br>";
        echo "   Object ID:              " . $map->GetObjectId() . "<br>";
   
        $envelope = $map->GetDataExtent();
        echo "<br>   Envelope:               ";
        PrintEnvelope($envelope);
   
        $extent = $map->GetMapExtent();
        echo "   <br>lower left coordinate:  ";
        PrintCoordinate( $extent->GetLowerLeftCoordinate() );
        echo "   upper right coordinate: " ;
        PrintCoordinate( $extent->GetUpperRightCoordinate() );
    	echo "   <br>	 " ;	
        $point = $map->GetViewCenter();
        echo "   view center:            ";
        PrintPoint($point);
   
        echo "   View scale:             " . $map->GetViewScale() . "<br>";
        echo "   Display dpi:            " . $map->GetDisplayDpi() . "<br>";
        echo "   Display width:          " . $map->GetDisplayWidth() . "<br>";
        echo "   Display height:         " . $map->GetDisplayHeight() . "<br>";
		
		 $srs = $map->GetMapSRS();
        if($srs != "")
        {
            $csFactory = new MgCoordinateSystemFactory();
            $cs = $csFactory->Create($srs);
            $metersPerUnit = $cs->ConvertCoordinateSystemUnitsToMeters(1.0);
            $unitsType = $cs->GetUnits();
			echo " Meters per unit: " . $metersPerUnit . " " . $unitsType ."<br><br>";
        }
        else
        {
            $metersPerUnit = 1.0;
			echo " Meters per unit: " . $metersPerUnit . "<br><br>";
        }
		
        PrintFiniteScales( $map );
   
        $layerCollection = $map->GetLayers();
        echo "   Layers: <br>";
        PrintLayerCollection( $layerCollection );
   
        $layerGroupCollection = $map->GetLayerGroups();
        echo "   Layer groups: <br>";
        PrintLayerGroupCollection( $layerGroupCollection );
   
        echo "   Finite display scales: <br>";
        PrintFiniteDisplayScales( $map );
   
        echo "Done n";
    }
    catch (MgException $e)
    {
        echo "ERROR: " . $e->GetMessage() . "<br>";
        echo $e->GetDetails() . "<br>";
        echo $e->GetStackTrace() . "<br>";
    }
   
    /********************************************************************/
    function PrintEnvelope($envelope)
    {
        echo "depth = " . $envelope->GetDepth() . ", height = " . $envelope->GetHeight() . ", width = " . $envelope->GetWidth() . "<br>";
    }
   
    /********************************************************************/
    function PrintCoordinate($coordinate)
    {
        echo "(" . $coordinate->GetX() . ", " . $coordinate->GetY() . ") <br>";
    }
   
    /********************************************************************/
    function PrintPoint($point)
    {
        PrintCoordinate( $point->GetCoordinate() );
    }
   
    /********************************************************************/
    function PrintLayerCollection($layerCollection)
    {
        for ($i = 0; $i < $layerCollection->GetCount(); $i++)
        {
            $layer = $layerCollection->GetItem($i);
            echo "      layer #" . ($i + 1) . ": <br>" ;
            PrintLayer($layer);
        }
    }
   
    /********************************************************************/
    function PrintLayer($layer)
    {
        echo "      name:                '" . $layer->GetName() . "'<br>";
        $layerDefinition = $layer->GetLayerDefinition();
        echo "      layer definition:    '" . $layerDefinition->ToString()  . "'<br>";
        echo "      legend label:        '" . $layer->GetLegendLabel()  . "'<br>";
        echo "      display in legend:   " . ConvertBooleanToString($layer->GetDisplayInLegend()) . "<br>";
        echo "      expand in legend:    " . ConvertBooleanToString($layer->GetExpandInLegend()) . "<br>";
        echo "      selectable:          " . ConvertBooleanToString($layer->GetSelectable()) . "<br>";
        echo "      potentially visible: " . ConvertBooleanToString($layer->GetVisible()) . "<br>";
        echo "      actually visible:    " . ConvertBooleanToString($layer->IsVisible()) . "<br>";
        echo "      needs refresh:       " . ConvertBooleanToString($layer->NeedsRefresh()) . "<br><br>";
		echo "      UUID:       " . $layer->GetObjectId() . "<br><br>";
		
    }
   
    /********************************************************************/
    function PrintLayerGroupCollection($layerGroupCollection)
    {
        for ($i = 0; $i < $layerGroupCollection->GetCount(); $i++)
        {
            $layerGroup = $layerGroupCollection->GetItem($i);
            echo "      layer group #" . ($i + 1) . ": " ;
            PrintLayerGroup($layerGroup);
        }
    }
   
    /********************************************************************/
    function PrintLayerGroup($layerGroup)
    {
        echo "      layer group name        '" . $layerGroup->GetName() . "'n";
        echo "      display in legend:      " . ConvertBooleanToString($layerGroup->GetDisplayInLegend()) . "<br>";
        echo "      expand in legend:       " . ConvertBooleanToString($layerGroup->GetExpandInLegend()) . "<br>";
        $parentGroup = $layerGroup->GetGroup();
        echo "      group                   " . $parentGroup->GetName() . "<br>";
        echo "      legend label            " . $layerGroup->GetLegendLabel() . "<br>";
        echo "      object ID               " . $layerGroup->GetObjectId() . "<br>";
        echo "      potentially visible:    " . ConvertBooleanToString($layerGroup->GetVisible()) . "<br>";
        echo "      actually visible:       " . ConvertBooleanToString($layerGroup->IsVisible()) . "<br>";
    }
   
    /********************************************************************/
    function PrintFiniteDisplayScales($map)
    {
        for ($i = 0; $i < $map->GetFiniteDisplayScaleCount(); $i++)
        {
            echo "      finite display scale #" . ($i + 1) . ": " . $map->GetFiniteDisplayScaleAt($i) . "<br>";
        }
		echo "[";
		
        for ($i = 0; $i < $map->GetFiniteDisplayScaleCount(); $i++)
        {
            echo $map->GetFiniteDisplayScaleAt($i) . ", ";
        }

		echo "]<br>";
    }
	
	function PrintFiniteScales($map)
    {
		echo "[";
		
        for ($i = 0; $i < $map->GetFiniteDisplayScaleCount(); $i++)
        {
            echo $map->GetFiniteDisplayScaleAt($i) . ", ";
        }

		echo "]<br>";
    }
   
    /********************************************************************/
    // Converts a boolean to "yes" or "no".
    function ConvertBooleanToString($boolean)
    {
        if (is_bool($boolean))
            return ($boolean ? "yes" : "no");
        else
            return "ERROR in ConvertBooleanToString.";
    }
   
    /********************************************************************/
    ?>
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to