[mapguide-users] A simple .Net sample

Robert Bray robert.bray at autodesk.com
Sun Mar 26 16:47:17 EST 2006


Ok guys, I am a little confused by this thread. Here is the most basic
example (in PHP):

 

<?php

      include '../mapviewerphp/constants.php';

 

      MgInitializeWebTier('C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini');

 

      $site = new MgSite();

      $site->Open(new MgUserInformation("Anonymous", ""));

 

      $sessionId = $site->CreateSession();

      $webLayout =
"Library://Samples/Sheboygan/Layouts/SheboyganPhp.WebLayout";

?>

 

<html>

 

<head>

    <title>Simple Sample Application</title>

</head>

 

<body marginheight="0" marginwidth="0">

<iframe id="viewerFrame" width="100%" height="100%" frameborder=0
scrolling="no" src="../mapviewerphp/ajaxviewer.php?SESSION=<?=
$sessionId ?>&WEBLAYOUT=<?= $webLayout ?>"></iframe>

</body>

</html>

 

That's it that's all. As long as you define a web layout in MapGuide
Studio you do not need to worry about the content of the mapviewerphp
folder. That is installed as part of the product and is not part of the
sample.

 

If you do not like the UI provided by MapGuide, turn off all of the
elements in the web layout and create your own with HTML/JavaScript. I
think Alain also posted an example to this list recently that modified
the default viewer, placing the legend/layer control on the right.

 

Am I missing something wrt your questions?

 

Bob

 

  _____  

From: triplederby100-propos at yahoo.com
[mailto:triplederby100-propos at yahoo.com] 
Sent: Friday, March 24, 2006 6:26 PM
To: users at mapguide.osgeo.org
Subject: Re: [mapguide-users] A simple .Net sample

 

... and not to mention the processing of template files and replacing
string tokens with some real values at runtime :) Very crafty. But it
appears that's what the "viewer" (as designed) is comprising of. 

But there must be a straight-forward way of getting a client up and
running, be it in .NET or whatever, like I am with MapServer. I second
what you say.

Kaarigar
====================



----- Original Message ----
From: Steven J Reed <sjreed at edcomputing.com>
To: users at mapguide.osgeo.org
Sent: Friday, March 24, 2006 5:13:19 PM
Subject: [mapguide-users] A simple .Net sample




Would it be too much to ask for a simple .Net sample, say something
where the code was all in one place?  The current ajaxviewersample and
dwfviewersample are really just shells that include code from other
directories, then when you look at them they include still more code.
It is difficult to determine what is really needed!

 

While I'm asking, why aren't the .Net samples in the form of .Net
projects?  If you really want .Net programmers to use this put it in the
form they are used to seeing, which is not something that has to be put
in a Program Files\ MapGuideOpenSource\ WebServerExtensions\ www
directory!

 

And of course these samples should have much of the initialization code
in the code-behind module, not embedded in the html code.  

 

Enough bitching, but it really looks like the .Net implementation is an
afterthought!

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20060326/207d2bf1/attachment.html


More information about the Mapguide-users mailing list