[mapguide-users] A simple .Net sample
Steven J Reed
sjreed at edcomputing.com
Mon Mar 27 16:34:27 EST 2006
Bob,
I think you are missing something.you gave a PHP example when the thread is
asking for a simple .Net example! I suppose I can translate the PHP to Java
and go from there, but what I was asking for is a .Net example!
Even so, the simple example that you provided is the first simple piece of
code I've seen!
Simple .Net applications don't involve hard-coding stuff in HTML. .Net
programmers are used to dragging an object from the Toolbar onto a page,
setting properties on the Property Pages, maybe writing some code in VB or
C# in the Page_Load method, and having the application work. Once the app
works in a rudimentary form, they may add server-side event handling
routines to add functionality. Almost as a last resort and/or to improve
performance, consideration is given to client side code.
Examples of .Net applications are typically distributed as .Net solutions or
projects, where the user can unzip a complete application and run it without
having to make significant changes. Really good samples are distributed in
both VB and C#!
.Steve
_____
From: Robert Bray [mailto:robert.bray at autodesk.com]
Sent: Sunday, March 26, 2006 1:47 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] A simple .Net sample
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/20060327/5770bb8f/attachment.html
More information about the Mapguide_users
mailing list