[mapguide-commits] r9862 - trunk/MgDev/Doc/samples/javasamples/interacting_with_layers
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sat Jun 19 02:20:46 PDT 2021
Author: jng
Date: 2021-06-19 02:20:45 -0700 (Sat, 19 Jun 2021)
New Revision: 9862
Modified:
trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp
Log:
#2839: Fix up devguide sample to work with MapGuideJavaApiEx.jar
Modified: trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp 2021-06-18 11:18:36 UTC (rev 9861)
+++ trunk/MgDev/Doc/samples/javasamples/interacting_with_layers/toggle_roads_label.jsp 2021-06-19 09:20:45 UTC (rev 9862)
@@ -51,7 +51,7 @@
// the Web Extensions session identifier stored in PHP
// session state.
- MapGuideJavaApi.MgInitializeWebTier(webconfigFilePath);
+ MapGuideJavaApiEx.MgInitializeWebTier(webconfigFilePath);
// Get the user information using the session id,
// and set up a connection to the site server.
@@ -58,15 +58,15 @@
MgUserInformation userInfo = new MgUserInformation(sessionId);
MgSiteConnection siteConnection = new MgSiteConnection();
- siteConnection.Open(userInfo);
+ siteConnection.open(userInfo);
MgMap map = new MgMap(siteConnection);
- map.Open(mapName);
+ map.open(mapName);
- MgLayerCollection layers = map.GetLayers(); // Get layer collection
+ MgLayerCollection layers = map.getLayers(); // Get layer collection
- MgLayer roadLayer = (MgLayer) layers.GetItem("Roads");
- String roadLabel = roadLayer.GetLegendLabel();
+ MgLayer roadLayer = (MgLayer) layers.getItem("Roads");
+ String roadLabel = roadLayer.getLegendLabel();
String newLabel;
if (roadLabel.equals("Roads"))
newLabel = "Streets";
@@ -73,12 +73,12 @@
else
newLabel = "Roads";
- roadLayer.SetLegendLabel(newLabel);
+ 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();
+ map.save();
out.println("<p>Layer label has been changed to " + newLabel + ".</p>");
@@ -96,8 +96,8 @@
}
catch (MgException e)
{
- out.println(e.GetExceptionMessage());
- out.println(e.GetDetails());
+ out.println(e.getExceptionMessage());
+ out.println(e.getDetails());
}
%>
More information about the mapguide-commits
mailing list