[mapguide-commits] r6225 - in trunk/MgDev/Doc/samples: .
dotnetsamples dotnetsamples/bin dotnetsamples/common
dotnetsamples/hello_map dotnetsamples/hello_viewer
dotnetsamples/images dotnetsamples/interacting_with_layers
dotnetsamples/styles dotnetsamples/working_with_feature_data
phpsamples/hello_map phpsamples/interacting_with_layers
phpsamples/working_with_feature_data
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Nov 15 06:39:41 EST 2011
Author: jng
Date: 2011-11-15 03:39:40 -0800 (Tue, 15 Nov 2011)
New Revision: 6225
Added:
trunk/MgDev/Doc/samples/dotnetsamples/
trunk/MgDev/Doc/samples/dotnetsamples/AspNetSamples.mgp
trunk/MgDev/Doc/samples/dotnetsamples/bin/
trunk/MgDev/Doc/samples/dotnetsamples/bin/readme.txt
trunk/MgDev/Doc/samples/dotnetsamples/common/
trunk/MgDev/Doc/samples/dotnetsamples/common/common.aspx
trunk/MgDev/Doc/samples/dotnetsamples/common/pageLoadFunctions.js
trunk/MgDev/Doc/samples/dotnetsamples/common/title.aspx
trunk/MgDev/Doc/samples/dotnetsamples/common/viewsource.aspx
trunk/MgDev/Doc/samples/dotnetsamples/hello_map/
trunk/MgDev/Doc/samples/dotnetsamples/hello_map/display_spatial_reference.aspx
trunk/MgDev/Doc/samples/dotnetsamples/hello_map/task_pane.aspx
trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/
trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/gotopoint.aspx
trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/task_pane.aspx
trunk/MgDev/Doc/samples/dotnetsamples/images/
trunk/MgDev/Doc/samples/dotnetsamples/images/banner.jpg
trunk/MgDev/Doc/samples/dotnetsamples/index.aspx
trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/
trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/layer_visibility.aspx
trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/task_pane.aspx
trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/toggle_roads_label.aspx
trunk/MgDev/Doc/samples/dotnetsamples/main.aspx
trunk/MgDev/Doc/samples/dotnetsamples/styles/
trunk/MgDev/Doc/samples/dotnetsamples/styles/globalStyles.css
trunk/MgDev/Doc/samples/dotnetsamples/styles/otherStyles.css
trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/
trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/listselection.aspx
trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/queryfeatures.aspx
trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/selectfeatures.aspx
trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/task_pane.aspx
Modified:
trunk/MgDev/Doc/samples/phpsamples/hello_map/display_spatial_reference.php
trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/layer_visibility.php
trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/toggle_roads_label.php
trunk/MgDev/Doc/samples/phpsamples/working_with_feature_data/listselection.php
Log:
Devguide updates:
- Add the first half of ASP.net samples
- Update PHP code to not use deprecated APIs
Added: trunk/MgDev/Doc/samples/dotnetsamples/AspNetSamples.mgp
===================================================================
(Binary files differ)
Property changes on: trunk/MgDev/Doc/samples/dotnetsamples/AspNetSamples.mgp
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/MgDev/Doc/samples/dotnetsamples/bin/readme.txt
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/bin/readme.txt (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/bin/readme.txt 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1 @@
+Copy all the dlls from mapviewernet/bin into this directory
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/common/common.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/common/common.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/common/common.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,51 @@
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.Text" %>
+<%@ Import Namespace="System.Globalization" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script language="C#" runat="server">
+
+public class Constants
+{
+ public const string RootDirectory = "C:\\Program Files\\OSGeo\\MapGuide\\";
+
+ public static string MapGuideServerDirectory
+ {
+ get { return Path.Combine(RootDirectory, "Server"); }
+ }
+
+ public static string WebExtensionsDirectory
+ {
+ get { return Path.Combine(RootDirectory, "Web"); }
+ }
+
+ public static string ViewerFilesDirectory
+ {
+ get { return Path.Combine(WebExtensionsDirectory, "www\\viewerfiles"); }
+ }
+
+ public static string WebConfigPath
+ {
+ get { return Path.Combine(WebExtensionsDirectory, "www\\webconfig.ini"); }
+ }
+}
+
+</script>
Added: trunk/MgDev/Doc/samples/dotnetsamples/common/pageLoadFunctions.js
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/common/pageLoadFunctions.js (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/common/pageLoadFunctions.js 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,93 @@
+// Copyright (C) 2007-2011 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+// JavaScript functions to run when the task pane loads.
+// These functions temporarily disable the task pane until the map frame
+// has been loaded.
+
+var saveBodyNodes = document.createElement('body');
+window.onload = function()
+{
+ // If the map has initialized, no need to do anything else.
+
+ if (parent.parent.mapFrame.mapInit)
+ return;
+
+ // Replace the OnMapLoaded function from the main frame. We can use this
+ // method to perform any custom functions that depend
+ // on the map being initialized. In this case, use it to activate the
+ // task pane. Also set mapFrame.mapInit. The DWF Viewer does not use
+ // this variable, but we need it for both AJAX and DWF Viewers as a
+ // check for when to run this window.onload() function.
+ //
+ // Be sure to run the original OnMapLoaded() function; parts
+ // of the Viewer depend on it.
+
+ original_OnMapLoaded = parent.parent.OnMapLoaded;
+ parent.parent.OnMapLoaded = function()
+ {
+ restoreBody();
+ replaceMapName();
+ parent.parent.mapFrame.mapInit = true;
+ original_OnMapLoaded();
+ }
+
+ // Temporarily replace the task pane with holder text while we wait
+ // for initialization to complete. It will be restored when the
+ // OnMapLoaded() function is called.
+
+ replaceBody();
+
+ return;
+
+ // Functions ----------------------------------------------------
+
+ function replaceBody()
+ {
+ // Replace the body of the task pane with inactive holder text.
+ while (document.body.hasChildNodes())
+ {
+ saveBodyNodes.appendChild(document.body.firstChild);
+ }
+ var tempPara = document.createElement('p');
+ var tempText = document.createTextNode('Loading...');
+ tempPara.appendChild(tempText);
+ document.body.appendChild(tempPara);
+ }
+ function restoreBody()
+ {
+ // Remove the holder text and restore the task pane.
+ while (document.body.hasChildNodes())
+ {
+ document.body.removeChild(document.body.firstChild);
+ }
+ while (saveBodyNodes.hasChildNodes())
+ {
+ document.body.appendChild(saveBodyNodes.firstChild);
+ }
+ }
+ function replaceMapName()
+ {
+ // Check document links for empty map name. Replace with the
+ // map name used in this layout.
+ docLinks = document.links;
+ mapName = parent.parent.mapFrame.GetMapName();
+ for (i = 0; i < docLinks.length; i++)
+ {
+ newHref = docLinks[i].href.replace("MAPNAME=unknown", "MAPNAME=" + mapName);
+ docLinks[i].href = newHref;
+ }
+ }
+}
Added: trunk/MgDev/Doc/samples/dotnetsamples/common/title.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/common/title.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/common/title.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+// Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+<html>
+ <head>
+ <title>Title Frame</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript">
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ </head>
+ <body class="TitleFrame">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="TitleText">MapGuide Developer's Guide</td>
+ <td class="TitleText" width="100%" align="right"><?=$_GET['TitleText'] ?></td>
+ </tr>
+ <tr>
+ <td width="100%" bgcolor="#004282"></td>
+ <td align="right"><img src="../images/banner.jpg"></td>
+ </tr>
+ </table>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/common/viewsource.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/common/viewsource.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/common/viewsource.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,43 @@
+<%--
+// Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Web" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+<script runat="server">
+String sourceFile;
+String fileContents;
+</script>
+<%
+ sourceFile = Request.Params["FILENAME"];
+ fileContents = HttpUtility.HtmlEncode(File.ReadAllText(sourceFile));
+%>
+<html>
+ <head>
+ <title>Source of <%= Path.GetFileName(sourceFile) %></title>
+ </head>
+
+ <body>
+ <p><strong><%= sourceFile %></strong></p>
+ <pre style="background-color: #f8f8f8; padding: 10px; border: 2px solid black">
+<code><%= fileContents %>
+</code>
+ </pre>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/hello_map/display_spatial_reference.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/hello_map/display_spatial_reference.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/hello_map/display_spatial_reference.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,85 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+// Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+-->
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+<!-- #Include File="../common/common.aspx" -->
+<html>
+ <head>
+ <title>Hello, map</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript">
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ </head>
+ <body class="AppFrame">
+ <h1 class="AppHeading">Spatial Reference</h1>
+ <%
+
+ // Get the directory paths for this MapGuide installation
+
+ try
+ {
+ // --------------------------------------------------//
+ // Basic initialization needs to be done every time.
+
+ MapGuideApi.MgInitializeWebTier(Constants.WebConfigPath);
+
+ // Get the session information passed from the viewer.
+
+ String sessionId = Request.Params["SESSION"];
+ String mapName = Request.Params["MAPNAME"];
+
+ // Get the user information using the session id,
+ // and set up a connection to the site server.
+
+ MgUserInformation userInfo = new MgUserInformation(sessionId);
+ MgSiteConnection siteConnection = new MgSiteConnection();
+ siteConnection.Open(userInfo);
+
+ // Get an instance of the required service(s).
+
+ MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
+
+ // Finished basic initialization.
+ // --------------------------------------------------//
+
+ // Query the spatial reference system used for the map.
+
+ MgMap map = new MgMap(siteConnection);
+ map.Open(mapName);
+ String srs = map.GetMapSRS();
+
+ // Format it and display it in the task pane.
+
+ Response.Write("<p>Map <strong>" + map.GetName() + "</strong> uses this reference system: </p>");
+ Response.Write("<pre style=\"padding: 2px; border: 1px solid black; background-color: #eee\">" + srs + "</pre>");
+ }
+ catch (MgException ex)
+ {
+ Response.Write("<p><strong>Error:</strong> ");
+ Response.Write(ex.GetDetails());
+ Response.Write("</p>");
+ }
+ %>
+
+</body>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/hello_map/task_pane.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/hello_map/task_pane.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/hello_map/task_pane.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+// Copyright (C) 2004-2011 by Autodesk, Inc.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of version 2.1 of the GNU Lesser
+// General Public License as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+<script runat="server">
+String sessionId;
+String mapName;
+String fullPath;
+</script>
+<html>
+ <head>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <title>Task Pane</title>
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ <meta http-equiv="content-script-type" content="text/javascript">
+ </head>
+ <body class="AppFrame">
+ <h1 class="AppHeading">Hello Map</h1>
+ <%
+ sessionId = Request.Params["SESSION"];
+ mapName = Request.Params["MAPNAME"];
+ %>
+ <p>This sample shows the most basic interaction with a map. It connects to a session
+ and queries information about the map.
+ </p>
+ <ul>
+ <li>
+ <a href="display_spatial_reference.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Display Spatial Reference</a>
+ <br/>Connect to MapGuide session and display basic information.
+ <br/>
+ <%
+ fullPath = Server.MapPath("display_spatial_reference.aspx");
+ %>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>" >View source</a>
+ </li>
+ </ul>
+ <%
+ String path1 = Server.MapPath("../main.aspx");
+ String path2 = Server.MapPath("./task_pane.aspx");
+ String path3 = Server.MapPath("../common/common.aspx");
+ %>
+ <p>View source for support files:</p>
+ <ul>
+ <li><a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= path1 %>">main.aspx</a> (wrapper for Viewer frames)</li>
+ <li><a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= path2 %>">task_pane.aspx</a> (this task pane page)</li>
+ <li><a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= path3 %>">common.aspx</a> (directory paths)</li>
+ </ul>
+ </body>
+</html>
Added: trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/gotopoint.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/gotopoint.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/gotopoint.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,49 @@
+<%--
+ Copyright (C) 2004-2011 by Autodesk, Inc.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of version 2.1 of the GNU Lesser
+ General Public License as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+<%@ Page language="c#" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+ <title>Viewer Sample Application- Goto Point</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript">
+</head>
+<%
+ String x = Request.Params["X"];
+ String y = Request.Params["Y"];
+ String scale = Request.Params["Scale"];
+%>
+<!-- Emit this function and assocate it with the onLoad event for the -->
+<!-- page so that it gets executed when this page loads in the -->
+<!-- browser. The function calls the ZoomToView method on the -->
+<!-- Viewer frame forcing the Viewer to navigate to the specified -->
+<!-- point and scale. -->
+
+<script language="javascript">
+
+function OnPageLoad()
+{
+ parent.ZoomToView(<%= x %>, <%= y %>, <%= scale %>, true);
+}
+
+</script>
+
+<body onLoad="OnPageLoad()">
+
+</body>
+
+</html>
Added: trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/task_pane.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/task_pane.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/hello_viewer/task_pane.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,81 @@
+<%--
+ Copyright (C) 2004-2011 by Autodesk, Inc.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of version 2.1 of the GNU Lesser
+ General Public License as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+<script runat="server">
+String sessionId;
+String mapName;
+</script>
+<html>
+ <head>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <title>Task Pane</title>
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ <meta http-equiv="content-script-type" content="text/javascript">
+ </head>
+ <body class="AppFrame">
+ <h1 class="AppHeading">Hello Viewer</h1>
+ <%
+ sessionId = Request.Params["SESSION"];
+ mapName = Request.Params["MAPNAME"];
+ %>
+ <p>This sample shows different ways of calling MapGuide Viewer API functions.</p>
+ <p><strong>1.</strong> The web layout contains a custom Invoke Script command
+ that calls the <code>ZoomToView()</code> function. Click the <img src="../../stdicons/icon_invokescript.gif" width="16" height="16" />
+ button in the tool bar, task list, or context menu
+ to reposition the map view. The Invoke Script command
+ is defined in the web layout for the sample. It contains the following:
+ </p>
+ <pre><code>ZoomToView(-87.732492,
+43.743934, 5000, true);</code></pre>
+
+ <p><strong>2.</strong> Click <a href="gotopoint.aspx?X=-87.724520&Y=43.768387&Scale=5000" target="scriptFrame">this link</a>
+ to display a different location. This loads a page into the hidden script frame.</p>
+ <%
+ String fullPath = Server.MapPath(".");
+ %>
+ <p>View source for support file:</p>
+ <ul>
+ <li><a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>/gotopoint.aspx">gotopoint.aspx</a></li>
+ </ul>
+
+ <p><strong>3.</strong> Click <a href="#" onclick="parent.parent.ZoomToView(-87.707416, 43.747860, 5000, true);">this link</a>
+ to display a third location. This uses <code>onclick</code> to call JavaScript directly from the task pane.</p>
+ <p>View source for this file:</p>
+ <ul>
+ <li><a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>/task_pane.aspx">task_pane.aspx</a></li>
+ </ul>
+
+ <p><strong>4.</strong> The home task pane loads JavaScript from an external file. The script runs when the map first loads. It disables
+ the task pane and waits until the map has completed loading before enabling the pane. It does this by hooking into
+ the <code>OnMapLoaded()</code> function of the main frame.</p>
+ <p>View files:</p>
+ <ul>
+ <li>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>/../index.aspx" >index.aspx</a>
+ </li>
+ <li>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>/../common/pageLoadFunctions.js" >pageLoadFunctions.js</a>
+ </li>
+ </ul>
+
+ </body>
+</html>
Added: trunk/MgDev/Doc/samples/dotnetsamples/images/banner.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/MgDev/Doc/samples/dotnetsamples/images/banner.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/MgDev/Doc/samples/dotnetsamples/index.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/index.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/index.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,103 @@
+<%--
+ Copyright (C) 2004-2011 by Autodesk, Inc.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of version 2.1 of the GNU Lesser
+ General Public License as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+<script runat="server">
+String sessionId;
+String mapName;
+</script>
+<!-- #Include File="common/common.aspx" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>MapGuide Developer Guide Samples</title>
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="styles/otherStyles.css" rel="stylesheet" type="text/css">
+ <script src="common/pageLoadFunctions.js" type="text/javascript" language="JavaScript">
+ </script>
+ </head>
+ <body class="AppFrame">
+ <%
+ sessionId = Request.Params["SESSION"];
+ if (Request.Params["MAPNAME"] == null)
+ mapName = "unknown";
+ else
+ mapName = Request.Params["MAPNAME"];
+ %>
+
+ <p>At any time, click <img src="../stdicons/icon_home.gif" width="16" height="16" />
+ in the task bar to return to this list of samples.</p>
+ <h1>
+ Basic Samples
+ </h1>
+ <ul>
+ <li><a href="hello_map/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Hello Map</a></li>
+ <li><a href="hello_viewer/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Hello Viewer</a></li>
+ <li><a href="interacting_with_layers/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Interacting With Layers</a></li>
+ <li><a href="working_with_feature_data/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Working With Feature Data</a></li>
+ <li><a href="modifying_maps_and_layers/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Modifying Maps and Layers</a></li>
+ <li><a href="analyzing_features/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Analyzing Features</a></li>
+ <li><a href="digitizing_features/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Digitizing and Redlining</a></li>
+ <li><a href="custom_output/task_pane.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Custom Output</a></li>
+ </ul>
+ <hr />
+ <!-- Not implemented yet
+ <h1>
+ Larger Tasks
+ </h1>
+ <ul>
+ <li><a href="../dotnetviewersample/dwfviewersample.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>" target="_blank">Using DWF Viewer</a></li>
+ <li><a href="../dotnetviewersample/ajaxviewersample.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>" target="_blank">Using Ajax Viewer</a></li>
+ <li><a href="../dotnetviewersample/ajaxtiledviewersample.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>" target="blank">Using Tiled Ajax Viewer</a></li>
+ </ul>
+ -->
+ <%
+ //
+ // To make the developer documentation available as part of the sample applications, copy or move the contents
+ // of WebServerExtensions\Help to WebServerExtensions\www\Help.
+ //
+ // If the docs are located in that directory, this scripts links to them from the task pane.
+ //
+ String helpDir = Path.Combine(Constants.WebExtensionsDirectory, "www\\Help");
+ String devGuide = Server.MapPath("../Help/DevGuide.pdf");
+ String apiRef = Server.MapPath("../Help/index.htm");
+ String viewerApi = Server.MapPath("../Help/viewerapi.html");
+ if (File.Exists(devGuide) || File.Exists(apiRef) || File.Exists(viewerApi))
+ {
+ Response.Write("<hr><h1>Documentation</h1>");
+ Response.Write("<p>Opens in a new window</p><ul>");
+ if (File.Exists(devGuide))
+ {
+ Response.Write("<li><a href=\"../Help/DevGuide.pdf\" target=\"_blank\">Developer\'s Guide (PDF)</a></li>");
+ }
+ if (File.Exists(apiRef))
+ {
+ Response.Write("<li><a href=\"../Help/index.htm\" target=\"_blank\">Web Server Extensions API Reference</a></li>");
+ }
+ if (File.Exists(viewerApi))
+ {
+ Response.Write("<li><a href=\"../Help/viewerapi.html\" target=\"_blank\">Viewer API Reference</a></li>");
+ }
+ Response.Write("</ul>");
+ }
+ %>
+ </body>
+</html>
Added: trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/layer_visibility.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/layer_visibility.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/layer_visibility.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script runat="server">
+String sessionId;
+String mapName;
+</script>
+<!-- #Include File="../common/common.aspx" -->
+<html>
+ <head>
+ <title>Layer Visibility</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript">
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ </head>
+ <body class="AppFrame">
+ <h1 class="AppHeading">Layer Visibility</h1>
+ <%
+
+ try
+ {
+ MapGuideApi.MgInitializeWebTier(Constants.WebConfigPath);
+
+ sessionId = Request.Params["SESSION"];
+ mapName = Request.Params["MAPNAME"];
+
+ MgUserInformation userInfo = new MgUserInformation(sessionId);
+ MgSiteConnection siteConnection = new MgSiteConnection();
+ siteConnection.Open(userInfo);
+
+ MgMap map = new MgMap(siteConnection);
+ map.Open(mapName);
+
+ MgLayerCollection layers = map.GetLayers(); // Get layer collection
+ Response.Write("<p>Layers, in draw order:</p>");
+ Response.Write("<table class=\"taskPane\" cellspacing=\"0\">");
+ Response.Write("<tr><th class=\"rowHead\">Layer</th><th>GetVisible()</th><th>IsVisible()</th></tr>");
+ int count = layers.GetCount();
+ for (int i = 0; i < count; i++)
+ {
+ MgLayerBase layer = layers.GetItem(i);
+ Response.Write("<tr><td class=\"rowHead\">" + layer.GetName() + "</td><td>" + (layer.GetVisible() ? "on" : "off") + "</td><td>" + (layer.IsVisible() ? "on" : "off") + "</td></tr>\n");
+ }
+ Response.Write("</table>");
+ }
+ catch (MgException e)
+ {
+ Response.Write("<p><strong>Error:</strong> ");
+ Response.Write(e.GetDetails());
+ Response.Write("</p>");
+ }
+ %>
+ <p><code>GetVisible()</code> returns the state of the visibility flag for a given layer (the check box in the
+ Layers pane). <code>IsVisible()</code> returns the actual visibility of a layer, based on its visibility flag,
+ the visibility flag of any groups that include the layer, and whether the layer has a defined style for the
+ current view scale.</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/task_pane.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/task_pane.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/task_pane.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,59 @@
+<%--
+ Copyright (C) 2004-2011 by Autodesk, Inc.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of version 2.1 of the GNU Lesser
+ General Public License as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<script runat="server">
+String sessionId;
+String mapName;
+</script>
+<html>
+ <head>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <title>Task Pane</title>
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ <meta http-equiv="content-script-type" content="text/javascript">
+ </head>
+ <body class="AppFrame">
+ <h1 class="AppHeading">Map Layers</h1>
+ <%
+ String sessionId = Request.Params["SESSION"];
+ String mapName = Request.Params["MAPNAME"];
+ %>
+ <ul>
+ <li>
+ <a href="layer_visibility.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Layer Visibility</a>
+ <br/>List layers and visibility status
+ <br/>
+ <%
+ String fullPath = Server.MapPath("layer_visibility.aspx");
+ %>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>" >View source</a>
+ </li>
+ <li>
+ <a href="toggle_roads_label.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>">Rename Roads Layer</a>
+ <br/>Toggle the name of the Roads layer
+ <br/>
+ <?php
+ fullPath = Server.MapPath("toggle_roads_label.aspx");
+ %>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>" >View source</a>
+ </li>
+ </ul>
+
+ </body>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/toggle_roads_label.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/toggle_roads_label.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/interacting_with_layers/toggle_roads_label.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script runat="server">
+String sessionId;
+String mgMapName;
+String newLabel;
+</script>
+<!-- #Include File="../common/common.aspx" -->
+<html>
+ <head>
+ <title>Rename layer</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript">
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+
+ <script language="javascript" type="text/javascript">
+ function OnPageLoad()
+ {
+ parent.parent.mapFrame.Refresh();
+ parent.parent.mapFrame.ZoomToScale(12000);
+ }
+ </script>
+ </head>
+ <body class="AppFrame" onLoad="OnPageLoad();">
+ <h1 class="AppHeading">Rename Roads Layer</h1>
+ <%
+ sessionId = Request.Params["SESSION"];
+ mgMapName = Request.Params["MAPNAME"];
+
+ try
+ {
+ // Initialize the Web Extensions and connect to the Server using
+ // the Web Extensions session identifier stored in PHP
+ // session state.
+
+ MapGuideApi.MgInitializeWebTier (Constants.WebConfigPath);
+
+ MgUserInformation userInfo = new MgUserInformation(sessionId);
+ MgSiteConnection siteConnection = new MgSiteConnection();
+ siteConnection.Open(userInfo);
+
+ MgMap map = new MgMap(siteConnection);
+ map.Open(mgMapName);
+
+ MgLayerCollection layers = map.GetLayers();
+
+ MgLayerBase roadLayer = layers.GetItem("Roads");
+ String roadLabel = roadLayer.GetLegendLabel();
+ if (roadLabel == "Roads")
+ newLabel = "Streets";
+ else
+ newLabel = "Roads";
+
+ roadLayer.SetLegendLabel(newLabel);
+
+ // You must save the updated map or the
+ // changes will not be applied
+ // Also be sure to refresh the map on page load.
+ map.Save();
+
+ Response.Write("<p>Layer label has been changed to " + newLabel + ".</p>");
+ Response.Write("<p><a href=\"toggle_roads_label.aspx?SESSION=" + sessionId + "&MAPNAME=" + mgMapName + "\">Run again</a></p>");
+ }
+ catch (MgLayerNotFoundException e)
+ {
+ Response.Write("<p>Layer not found</p>");
+ }
+ catch (MgObjectNotFoundException e)
+ {
+ Response.Write("<p>Layer not found</p>");
+ }
+ catch (MgException e)
+ {
+ Response.Write(e.GetExceptionMessage());
+ Response.Write(e.GetDetails());
+ }
+ %>
+
+</body>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/main.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/main.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/main.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,78 @@
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script runat="server">
+String sessionId;
+String webLayout;
+String title;
+</script>
+<!-- #Include File="common/common.aspx" -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
+<%
+
+MgSite site = null;
+try
+{
+ // Initialize the web extensions,
+ MapGuideApi.MgInitializeWebTier(Constants.WebConfigPath);
+
+ // Connect to the site server and create a session
+ MgUserInformation userInfo = new MgUserInformation("Author", "author");
+ site = new MgSite();
+ site.Open(userInfo);
+}
+catch (MgException ex)
+{
+ Response.Write("Could not connect to the MapGuide site server. Please contact the MapGuide site administrator.\n");
+ Response.End();
+}
+
+try
+{
+ sessionId = site.CreateSession();
+
+ // Define some constants
+ webLayout = "Library://Samples/Layouts/AspNetSamples.WebLayout";
+ title = "MapGuide Developer's Guide asp.net Samples";
+}
+catch (MgException ex)
+{
+ Response.Write("ERROR: " + ex.GetExceptionMessage() + "\n");
+ Response.Write(ex.GetStackTrace() + "\n");
+}
+%>
+<html>
+ <head>
+ <title><%= title %>
+ </title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+ <meta http-equiv="content-script-type" content="text/javascript" />
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="styles/globalStyles.css" rel="stylesheet" type="text/css" />
+ <link href="styles/globalStyles.css" rel="stylesheet" type="text/css" />
+ </head>
+
+ <frameset rows="110,*" frameborder="NO" border="0" framespacing="0">
+ <frame src="common/Title.aspx?TitleText=<%= title %>" name="TitleFrame" scrolling="NO" noresize />
+ <frame src="/mapguide/mapviewerajax/?SESSION=<%= sessionId %>&WEBLAYOUT=<%= webLayout %>" name="ViewerFrame" />
+ </frameset>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/styles/globalStyles.css
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/styles/globalStyles.css (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/styles/globalStyles.css 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,217 @@
+/*
+Copyright (C) 2004-2011 by Autodesk, Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+/*
+----------------------------------------------------------
+autodesk masthead base styles for screen media
+FileName: ad_mh.css
+Version: 2003.01.10
+2-10-05: Updated with values from global.css for new
+ Corp look.
+----------------------------------------------------------
+*/
+
+
+/* General Elements */
+/* ----------------------------------------------------- */
+body {
+ margin: 0px 0px 0px 0px;
+ color: #000000;
+ font-family: arial,verdana,helvetica,sans-serif;
+ background: #f2f2f2;
+ font-size: 11px; /*global font size, thus 11px = 1em if not redefined elsewhere*/
+ height: 100%;
+}
+td {
+ font-family: Arial,Helvetica,Verdana,Geneva,sans-serif;
+ color: #000000;
+ font-size: 13px;
+}
+
+/*global link settings*/
+a {
+ color:#0082b4;
+ text-decoration:none;
+}
+
+a:visited {
+ color:#46a9de;
+}
+a:hover,
+a:active {
+ text-decoration:underline;
+}
+
+input, select, textarea {
+ font-family: Arial,Helvetica,Verdana,Geneva,sans-serif;
+ font-size: 13px;
+}
+
+hr {
+ color: #CCCCCC;
+ height: 1px;
+ margin: 0px 0px 5px 0px;
+}
+
+/* Formatting Structure */
+/* ----------------------------------------------------- */
+
+table.main {
+ width: 774px;
+ height: 100%;
+ background: #FFFFFF;
+}
+td.sitename {
+ height: 81px;
+ vertical-align: bottom;
+}
+table.sitename {
+ margin: 0px 11px 0px 11px;
+ width: 752px;
+ height: 81px;
+}
+
+td.logo { text-align: right; vertical-align: bottom; }
+
+td.vertnav {
+ height: 20px;
+ border-bottom: solid 1px #999999;
+ padding-left: 11px;
+ vertical-align : middle;
+ color: #000000;
+ font-size: 11px;
+ text-decoration: none;
+}
+
+td.content {
+ padding: 27px 11px 11px 11px;
+ width: 572px;
+ height: 82%;
+ vertical-align: top;
+}
+td.lhsash {
+ background-color: #F2F2F2;
+ padding: 27px 11px 11px 10px; /* Ww */
+ width: 159px; /* Ww */
+ vertical-align: top;
+}
+td.lhnav, td.lhnavbld {
+ padding: 0px 0px 0px 1px; /* Ww */
+}
+
+td.footer {
+ padding: 16px 11px 11px 11px;
+ height: 26px;
+ vertical-align: top;
+ color: #666666;
+ font-size: 11px;
+}
+
+td.langsel { padding: 22px 0px 0px 0px; }
+td.promo { padding: 33px 0px 0px 0px; }
+.promobox { margin-bottom: 11px; }/* 11px space after promo boxes */
+
+
+/* Navigation Links */
+/* ----------------------------------------------------- */
+.sitename, a.sitename, a.sitename:visited, a.sitename:hover {
+ color: #000000;
+ font-size: 16px;
+ font-weight: bold;
+ line-height: 16px;
+ text-decoration: none;
+}
+.lhnav {
+ color: #000000;
+ font-size: 11px;
+ text-decoration: none;
+}
+a.lhnav, a.lhnav:visited {
+ color: #0082B4;
+ text-decoration: none;
+}
+a.lhnav:hover {
+ color: #0082B4;
+ text-decoration: underline;
+}
+.lhnavbld {
+ color: #000000;
+ font-size: 11px;
+ font-weight: bold;
+ text-decoration: none;
+}
+a.lhnavbld, a.lhnavbld:visited {
+ color: #0082B4;
+ text-decoration: none;
+}
+a.lhnavbld:hover {
+ color: #0082B4;
+ text-decoration: underline;
+}
+.ftnav, a.ftnav, a.ftnav:visited {
+ color: #0082B4;
+ font-size: 11px;
+ text-decoration: none;
+}
+a.ftnav:hover {
+ text-decoration: underline;
+}
+
+
+/* DIV */
+/* ----------------------------------------------------- */
+div.clear { clear: both; }
+div.lh-blue {
+ color: #0066CC;
+ padding: 0px 4px 0px 1px; /* Ww */
+ font-size: 11px;
+}/* blue '-' on the LHSash subnavigation */
+div.lh-black {
+ color: #000000;
+ padding: 0px 4px 0px 1px; /* Ww */
+ font-size: 11px;
+}/* black '-' on the LHSash subnavigation */
+
+
+/* Text Formatting */
+/* ----------------------------------------------------- */
+.title {
+ color: #000000;
+ font-weight: bold;
+ font-size: 14px;
+ }
+ .pdf {
+ color: #666666;
+ font-size: 8pt;
+ font-style : italic;
+ text-decoration: none;
+}
+.bold {
+ font-weight: bold;
+}
+
+/* Images */
+/* ----------------------------------------------------- */
+img { border: 0px; }/* remove border from image */
+.img-left {
+ margin: 0px 11px 11px 0px;
+ float : left;
+}
+.img-right {
+ margin: 0px 0px 11px 11px;
+ float: right;
+}
Added: trunk/MgDev/Doc/samples/dotnetsamples/styles/otherStyles.css
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/styles/otherStyles.css (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/styles/otherStyles.css 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,118 @@
+/*
+Copyright (C) 2004-2008 by Autodesk, Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+body.TitleFrame {
+ background-color: #FFFFFF;
+ margin: 0px;
+ vertical-align: bottom;
+}
+
+td.TitleText {
+ margin: 0px;
+ font-size: 20px;
+ vertical-align: bottom;
+ padding: 5px;
+ font-weight: bold;
+ color: #000000;
+}
+
+table.taskPane
+{
+ border: 0;
+}
+table.taskPane td, th {
+ font-family: Arial,Helvetica,Verdana,Geneva,sans-serif;
+ color: #000000;
+ font-size: 13px;
+ text-align: right;
+ border: 0;
+ border-bottom: 1px solid black;
+ margin: 4px;
+ padding: 2px 4px 2px 4px;
+}
+table.taskPane th
+{
+ background-color: #eee;
+ font-weight: normal;
+ border-top: 1px solid black;
+}
+table.taskPane td.rowHead, th.rowHead
+{
+ text-align: left;
+}
+
+body.AppFrame {
+ margin: 5px 5px 5px 5px;
+ color: #000000;
+ font-family: arial,verdana,helvetica,sans-serif;
+ background: #FFFFFF;
+ font-size: 13px; /*global font size, thus 11px = 1em if not redefined elsewhere*/
+ width: auto;
+ height: auto;
+}
+
+h1 {
+font-size: 18px;
+}
+
+body.AppFrame h1 {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 18px;
+ font-weight: bold;
+ margin: 15px 0 0 0;
+ padding-bottom: 0;
+}
+
+body.AppFrame ul
+{
+ margin-top: 5px;
+}
+
+body.AppFrame p
+{
+ margin: 5px;
+}
+
+body.AppFrame hr
+{
+ margin: 5px;
+}
+
+td.NavItem {
+ vertical-align: middle;
+ width: 100%;
+ margin-top: 2px;
+ margin-bottom: 2px;
+ margin-left: 4px;
+ height: 20px;
+ background-position: center;
+}
+
+a.NavLink {
+ vertical-align: middle;
+ line-height: 20px;
+ background-position: center;
+ margin: 0px;
+ padding: 0px;
+ height: 20px;
+}
+
+
+img.NavPic {
+ background-position: center;
+ vertical-align: middle;
+}
Added: trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/listselection.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/listselection.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/listselection.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,132 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script runat="server">
+String sessionId;
+String mapName;
+MgSelection selection = null;
+</script>
+<!-- #Include File="../common/common.aspx" -->
+<html>
+
+ <head>
+ <title>Viewer Sample Application - List Selected Parcels</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript" />
+ <meta http-equiv="content-style-type" content="text/css" />
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ </head>
+
+ <body class="AppFrame" >
+
+ <h1 class="AppHeading">Selected Parcels</h1>
+
+ <%
+ sessionId = Request.Params["SESSION"];
+ mapName = Request.Params["MAPNAME"];
+
+ try
+ {
+ // Initialize the Web Extensions and connect to the Server using
+ // the Web Extensions session identifier stored in PHP session state.
+
+ MapGuideApi.MgInitializeWebTier (Constants.WebConfigPath);
+
+ MgUserInformation userInfo = new MgUserInformation(sessionId);
+ MgSiteConnection siteConnection = new MgSiteConnection();
+ siteConnection.Open(userInfo);
+
+ MgMap map = new MgMap(siteConnection);
+ map.Open(mapName);
+
+ // ----------------------------------------------------------
+ // Use the following code for AJAX or DWF Viewers
+ // This requires passing selection data via HTTP POST
+
+ MgReadOnlyLayerCollection layers = null;
+ if (!String.IsNullOrEmpty(Request.Form["SELECTION"]))
+ {
+ selection = new MgSelection(map, HttpUtility.UrlDecode(Request.Form["SELECTION"]));
+ layers = selection.GetLayers();
+ }
+ // ---------------------------------------------------------
+
+ // ---------------------------------------------------------
+ // Use the following code for AJAX Viewers only.
+ // This does not require passing selection data via HTTP POST.
+ //
+ // selection = new MgSelection(map);
+ // selection.Open(resourceService, mapName);
+ // layers = selection.GetLayers();
+ // ---------------------------------------------------------
+
+ if (layers != null && selection != null)
+ {
+ for (int i = 0; i < layers.GetCount(); i++)
+ {
+ // Only check selected features in the Parcels layer.
+
+ MgLayerBase layer = layers.GetItem(i);
+
+ if (layer.GetName() == "Parcels")
+ {
+
+ // Create a filter containing the IDs of the selected features on this layer
+
+ String layerClassName = layer.GetFeatureClassName();
+
+ MgFeatureReader featureReader = selection.GetSelectedFeatures(layer, layerClassName, false);
+
+ // Process each item in the MgFeatureReader, displaying the owner name
+
+ try {
+ while (featureReader.ReadNext())
+ {
+ String val = featureReader.GetString("NAME") + "<br /> " + featureReader.GetString("RPROPAD");
+ Response.Write(val + "<br />");
+ }
+ } finally { //Finally guarantees code in this block will execute
+ featureReader.Close();
+ }
+ }
+ }
+ }
+ else
+ {
+ Response.Write("No selected layers");
+ Response.Write("</p>");
+ }
+ }
+ catch (MgException e)
+ {
+ Response.Write("<p>" + e.GetExceptionMessage() + "</p>");
+ Response.Write("<p>" + e.GetDetails() + "</p>");
+ }
+ %>
+
+ <% String fileName = Server.MapPath("listselection.aspx"); %>
+ <p><a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fileName %>" >View source</a></p>
+ </body>
+
+</html>
Added: trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/queryfeatures.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/queryfeatures.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/queryfeatures.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,125 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script runat="server">
+String sessionId;
+String mapName;
+</script>
+<!-- #Include File="../common/common.aspx" -->
+<html>
+
+ <head>
+ <title>Viewer Sample Application - Query Parcels</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript" />
+ <meta http-equiv="content-style-type" content="text/css" />
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ </head>
+
+ <body class="AppFrame">
+
+ <h1 class="AppHeading">Feature Query</h1>
+
+ <%
+
+ sessionId = Request.Params["SESSION"];
+ mapName = Request.Params["MAPNAME"];
+
+ try
+ {
+
+ // Initialize the Web Extensions and connect to
+ // the Server using the Web Extensions session
+ // identifier stored in PHP session state.
+
+ MapGuideApi.MgInitializeWebTier(Constants.WebConfigPath);
+
+ MgUserInformation userInfo = new MgUserInformation(sessionId);
+ MgSiteConnection siteConnection = new MgSiteConnection();
+ siteConnection.Open(userInfo);
+
+ MgMap map = new MgMap(siteConnection);
+ map.Open(mapName);
+
+ // Get the geometry for the boundaries of District 1
+
+ MgFeatureQueryOptions districtQuery = new MgFeatureQueryOptions();
+ districtQuery.SetFilter("Autogenerated_SDF_ID = 1");
+
+ MgLayerBase layer = map.GetLayers().GetItem("Districts");
+ MgFeatureReader featureReader = layer.SelectFeatures(districtQuery);
+ MgByteReader districtGeometryData = null;
+ try {
+ featureReader.ReadNext();
+ districtGeometryData = featureReader.GetGeometry("Data");
+ } finally { //Ensures this block is always run
+ featureReader.Close();
+ }
+
+ // Convert the AGF binary data to MgGeometry.
+
+ MgAgfReaderWriter agfReaderWriter = new MgAgfReaderWriter();
+ MgGeometry districtGeometry = agfReaderWriter.Read(districtGeometryData);
+
+ // Create a filter to select the desired features.
+ // Combine a basic filter and a spatial filter.
+
+ MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
+ queryOptions.SetFilter("RNAME LIKE 'SCHMITT%'");
+
+ queryOptions.SetSpatialFilter("SHPGEOM", districtGeometry, MgFeatureSpatialOperations.Inside);
+
+ // Select the features.
+
+ layer = map.GetLayers().GetItem("Parcels");
+ featureReader = layer.SelectFeatures(queryOptions);
+
+ // For each selected feature, display the address.
+
+ Response.Write("<p>Properties owned by Schmitt ");
+ Response.Write("in District 1</p><p>");
+
+ try {
+ while (featureReader.ReadNext())
+ {
+ String val = featureReader.GetString("RPROPAD");
+ Response.Write( val + "<br />");
+ }
+ } finally { //Ensures this block is always run
+ featureReader.Close();
+ }
+ Response.Write("</p>");
+ }
+ catch (MgException e)
+ {
+ Response.Write(e.GetExceptionMessage());
+ Response.Write(e.GetDetails());
+ }
+ catch (Exception e)
+ {
+ Response.Write(e.Message);
+ }
+ %>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/selectfeatures.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/selectfeatures.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/selectfeatures.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,129 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script runat="server">
+String sessionId;
+String mapName;
+String selectionXml;
+</script>
+<!-- #Include File="../common/common.aspx" -->
+<html>
+
+ <head>
+ <title>Viewer Sample Application - Server-side Selection</title>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-script-type" content="text/javascript" />
+ <meta http-equiv="content-style-type" content="text/css" />
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ </head>
+
+ <body class="AppFrame" onLoad="OnPageLoad()">
+
+ <h1 class="AppHeading">Select features</h1>
+
+ <%
+
+ sessionId = Request.Params["SESSION"];
+ mapName = Request.Params["MAPNAME"];
+
+ try
+ {
+
+ // Initialize the Web Extensions and connect to the Server using
+ // the Web Extensions session identifier stored in PHP session state.
+
+ MapGuideApi.MgInitializeWebTier (Constants.WebConfigPath);
+
+ MgUserInformation userInfo = new MgUserInformation(sessionId);
+ MgSiteConnection siteConnection = new MgSiteConnection();
+ siteConnection.Open(userInfo);
+
+ MgMap map = new MgMap(siteConnection);
+ map.Open(mapName);
+
+ // Get the geometry for the boundaries of District 1
+
+ MgFeatureQueryOptions districtQuery = new MgFeatureQueryOptions();
+ districtQuery.SetFilter("Autogenerated_SDF_ID = 1");
+
+ MgLayerBase layer = map.GetLayers().GetItem("Districts");
+ MgFeatureReader featureReader = layer.SelectFeatures(districtQuery);
+ MgByteReader districtGeometryData = null;
+ try {
+ featureReader.ReadNext();
+ districtGeometryData = featureReader.GetGeometry("Data");
+ } finally { //Ensures the reader is closed regardless
+ featureReader.Close();
+ }
+
+ // Convert the AGF binary data to MgGeometry.
+
+ MgAgfReaderWriter agfReaderWriter = new MgAgfReaderWriter();
+ MgGeometry districtGeometry = agfReaderWriter.Read(districtGeometryData);
+
+ // Create a filter to select the desired features. Combine
+ // a basic filter and a spatial filter.
+
+ MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
+ queryOptions.SetFilter("RNAME LIKE 'SCHMITT%'");
+ queryOptions.SetSpatialFilter("SHPGEOM", districtGeometry, MgFeatureSpatialOperations.Inside);
+
+ // Get the features from the feature source,
+ // turn it into a selection, then save the selection as XML.
+
+ layer = map.GetLayers().GetItem("Parcels");
+ featureReader = layer.SelectFeatures(queryOptions);
+
+ MgSelection selection = new MgSelection(map);
+ selection.AddFeatures(layer, featureReader, 0);
+ selectionXml = selection.ToXml();
+
+ Response.Write("Selecting parcels owned by Schmitt in District 1");
+ }
+ catch (MgException e)
+ {
+ Response.Write(e.GetExceptionMessage());
+ Response.Write(e.GetDetails());
+ }
+ %>
+
+ </body>
+
+ <script language="javascript">
+
+ <!-- Emit this function and assocate it with the onLoad event for the -.
+ <!-- page so that it gets executed when this page loads in the -.
+ <!-- browser. The function calls the SetSelectionXML method on the -.
+ <!-- Viewer Frame, which updates the current selection on the viewer -.
+ <!-- and the server. -.
+
+ function OnPageLoad()
+ {
+ selectionXml = '<%= selectionXml %>';
+ parent.parent.SetSelectionXML(selectionXml);
+ }
+
+ </script>
+
+</html>
\ No newline at end of file
Added: trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/task_pane.aspx
===================================================================
--- trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/task_pane.aspx (rev 0)
+++ trunk/MgDev/Doc/samples/dotnetsamples/working_with_feature_data/task_pane.aspx 2011-11-15 11:39:40 UTC (rev 6225)
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%--
+Copyright (C) 2004-2011 by Autodesk, Inc.
+This library is free software; you can redistribute it and/or
+modify it under the terms of version 2.1 of the GNU Lesser
+General Public License as published by the Free Software Foundation.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+--%>
+
+<%@ Page language="c#" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Collections.Specialized" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="OSGeo.MapGuide" %>
+
+<script runat="server">
+String sessionId;
+String mapName;
+</script>
+<html>
+ <head>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+ <meta http-equiv="content-style-type" content="text/css">
+ <link href="../styles/globalStyles.css" rel="stylesheet" type="text/css">
+ <link href="../styles/otherStyles.css" rel="stylesheet" type="text/css">
+ <script language="javascript">
+ function ZoomToDistrict()
+ {
+ parent.parent.ZoomToView(-87.726134, 43.770338, 8000, true);
+ }
+ function listSelection()
+ {
+ xmlSel = encodeURIComponent(parent.parent.mapFrame.GetSelectionXML());
+ params = new Array("SESSION", parent.parent.mapFrame.GetSessionId(),
+ "MAPNAME", parent.parent.mapFrame.GetMapName(),
+ "SELECTION", xmlSel);
+ pageUrl = "../dotnetsamples/working_with_feature_data/listselection.aspx";
+ parent.parent.formFrame.Submit(pageUrl, params, "taskPaneFrame");
+ }
+ </script>
+ <meta http-equiv="content-script-type" content="text/javascript">
+ </head>
+ <body class="AppFrame">
+ <h1 class="AppHeading">Working With Feature Data</h1>
+ <p>
+ <%
+ sessionId = Request.Params["SESSION"];
+ mapName = Request.Params["MAPNAME"];
+ %>
+ <ul>
+ <li>
+ <a href="#" onclick="ZoomToDistrict();" >Zoom to District 1</a>
+ <br />Position the map to display parcels in District 1
+ </li>
+ <li>
+ <a href="queryfeatures.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>" >Query features</a>
+ <br />List properties in District 1 owned by Schmitt
+ <br/>
+ <%
+ String fullPath = Server.MapPath("queryfeatures.aspx");
+ %>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>" >View source</a>
+ </li>
+ <li>
+ <a href="selectfeatures.aspx?SESSION=<%= sessionId %>&MAPNAME=<%= mapName %>" >Set active selection</a>
+ <br />Select properties in District 1 owned by Schmitt
+ <br/>
+ <%
+ fullPath = Server.MapPath("selectfeatures.aspx");
+ %>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>" >View source</a>
+ </li>
+ <li>
+ <a href="#" onclick="listSelection();" >List selected features</a>
+ <br />Lists currently selected features
+ <br/>
+ <%
+ fullPath = Server.MapPath("listselection.aspx");
+ %>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>" >View source</a>
+ </li>
+ </ul>
+ </p>
+ <p>View the source for this task pane, showing JavaScript for repositioning map and initiating selection list.</p>
+ <ul>
+ <li>
+ <%
+ fullPath = Server.MapPath("task_pane.aspx");
+ %>
+ <a target="_blank" href="../common/viewsource.aspx?FILENAME=<%= fullPath %>" >task_pane.aspx</a>
+ </li>
+ </ul>
+ </p>
+ </body>
+</html>
Modified: trunk/MgDev/Doc/samples/phpsamples/hello_map/display_spatial_reference.php
===================================================================
--- trunk/MgDev/Doc/samples/phpsamples/hello_map/display_spatial_reference.php 2011-11-14 10:05:28 UTC (rev 6224)
+++ trunk/MgDev/Doc/samples/phpsamples/hello_map/display_spatial_reference.php 2011-11-15 11:39:40 UTC (rev 6225)
@@ -62,8 +62,8 @@
// Query the spatial reference system used for the map.
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
$srs = $map->GetMapSRS();
// Format it and display it in the task pane.
Modified: trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/layer_visibility.php
===================================================================
--- trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/layer_visibility.php 2011-11-14 10:05:28 UTC (rev 6224)
+++ trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/layer_visibility.php 2011-11-15 11:39:40 UTC (rev 6225)
@@ -41,14 +41,9 @@
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
- // Get an instance of the required service(s).
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
- $resourceService = $siteConnection->
- CreateService(MgServiceType::ResourceService);
-
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
-
$layers = $map->GetLayers(); // Get layer collection
echo "<p>Layers, in draw order:</p>";
echo '<table class="taskPane" cellspacing="0">';
Modified: trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/toggle_roads_label.php
===================================================================
--- trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/toggle_roads_label.php 2011-11-14 10:05:28 UTC (rev 6224)
+++ trunk/MgDev/Doc/samples/phpsamples/interacting_with_layers/toggle_roads_label.php 2011-11-15 11:39:40 UTC (rev 6225)
@@ -54,12 +54,9 @@
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
- $resourceService =
- $siteConnection->CreateService(MgServiceType::ResourceService);
+ $map = new MgMap($siteConnection);
+ $map->Open($mgMapName);
- $map = new MgMap();
- $map->Open($resourceService, $mgMapName);
-
$layers = $map->GetLayers();
$roadLayer = $layers->GetItem('Roads');
@@ -74,7 +71,7 @@
// You must save the updated map or the
// changes will not be applied
// Also be sure to refresh the map on page load.
- $map->Save($resourceService);
+ $map->Save();
echo "<p>Layer label has been changed to $newLabel.</p>";
Modified: trunk/MgDev/Doc/samples/phpsamples/working_with_feature_data/listselection.php
===================================================================
--- trunk/MgDev/Doc/samples/phpsamples/working_with_feature_data/listselection.php 2011-11-14 10:05:28 UTC (rev 6224)
+++ trunk/MgDev/Doc/samples/phpsamples/working_with_feature_data/listselection.php 2011-11-15 11:39:40 UTC (rev 6225)
@@ -48,11 +48,10 @@
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
- $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
$featureService = $siteConnection->CreateService(MgServiceType::FeatureService);
- $map = new MgMap();
- $map->Open($resourceService, $mapName);
+ $map = new MgMap($siteConnection);
+ $map->Open($mapName);
// ----------------------------------------------------------
// Use the following code for AJAX or DWF Viewers
More information about the mapguide-commits
mailing list