<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
In that case, you will do something different.<br>
<br>
You need to setup the layer to display all points correctly.<br>
Use Studio or Maestro to accomplish this.<br>
<br>
When the user needs to view the layer, you do this:<br>
1. Get a copy of the LayerDefinition<br>
2. Modify the "FILTER" property of the LayerDefinition to display only
the required data, eg: "ID > 500 AND ID < 510".<br>
3. Save the copy in the session repository under a random name.<br>
4. Get the runtime map, and either<br>
5a. Replace the resourceId of an existing layer with the one from step
3, or<br>
5b. Insert a new layer into the runtime map, pointing to the temporary
layerdefinition from step 3<br>
6. Make sure the layer from step 5 is visible<br>
7. Save the modified runtime map<br>
8. Refresh the client.<br>
<br>
If your map already contains the layer to be show, choose 5a, otherwise
choose 5b.<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
padmini godavarthi skrev:
<blockquote cite="mid:20811652.post@talk.nabble.com" type="cite">
<pre wrap="">
Hi,
Thank u very much for u r reply.
I will check it out .
My Doubt is that
1) If i create a package in mapguide maestro , connecing to the oracle how
can access the data using queries.
suppose i create a feature resource for a table data in oracle after
that i followed all the procedure and created a package successfully. If
user wants to query this table and wants to display only some of the
features on the map dynamically .How can i provide this?
If u know this plz help me
Regards,
Padmini.
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">There is not much I can say to help you there.
It is very difficult to create LayerDefinitions and WebLayouts
programatically.
The problem with creating a LayerDefinition is the number of properties
you have to set.
Such properties include, scalerange, point styles, rules, fonts,
linewidth, colors, etc.
The WebLayout has all the buttons and menu items.
I would recommend you reconsider alternatives.
To create a new LayerDefinition, simply do:
Dim layerdefinition as new MaestroAPI.LayerDefinition()
You can use the same approach for any of the other items.
Then you can save it as you like, using con.SaveResourceAs(...).
There is no help anywhere, that explains what properties to set.
You can look in the Maestro code, or examine the Sheboygan
LayerDefinitions to see what happens.
A simple shortcut, would be to create a "template" from Maestro, and then
use that template when you start out. You can then modify the template,
and save it as a resource. To produce a "template", simply create a new
LayerDefinition
in Maestro, and then click the "Edit Xml". Copy-n-paste the Xml to a
file (say C:\template.xml).
To load a template as an object, you can use (C# code, can never
remember generics in VB):
MaestroAPI.LayerDefinition layerdefinition;
using(System.IO.FileStream fs =
System.IO.File.OpenRead("C:\\template.xml"))
layerdefintion =
con.DeserializeObject<MaestroAPI.LayerDefinition>(fs);
You can then modify the geometry column, featuresource pointer, columns,
filter, tooltip and other items, until it fits the newly uploaded
SHP file. As I said, it will be dificult, and there is no help avalible
for the task. Your primary tool is the error log:
C:\program files\mapguideopensource2.0\server\logs\error.log
Good luck.
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
Thanks .its working fine now.
To build a map, you must have all the components:
1. FeatureSource, references data
2. LayerDefinition, references a FeatureSource
3. MapDefinition, references multiple LayerDefinitions
4. WebLayout, references a MapDefinition
All these items must be in a repository (either Library or Session)
I know the procedure to create it in mapguide maestro.
1) Now my problem was i want to create ALL the above items
programmetically (my input is only a shape file) byusing maestro dll.
If u know this plz help me
Regards,
Padmini.
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I wrote a follow up, with corrected code.
You are using the initial one, and you are missing a "?" mark in the
redirect URL.
Try to use the updated version, and beware of the question mark in the
Response.Redirect call.
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
Thanks for u r reply.
I tried this code but i got an error that
Server Error in '/maestro' Application.
--------------------------------------------------------------------------------
HTTP Error 400 - Bad Request.
--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 8.0.0.0
my code was
Dim host As New
Uri(<a class="moz-txt-link-rfc2396E" href="http://localhost/mapguide/mapagent/mapagent.fcgi">"http://localhost/mapguide/mapagent/mapagent.fcgi"</a>)
Dim conn As New HttpServerConnection(host, "Administrator",
"admin",
"en", True)
'You have to change the string below to point at a valid
WebLayout
Dim weblayout As WebLayout =
conn.GetWebLayout("Library://Filebased
data/Layout/layout.WebLayout")
Dim mapdefinition As MapDefinition =
conn.GetMapDefinition(weblayout.Map.ResourceId)
weblayout.Map.InitialView = New MapViewType()
weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000
weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX
-
mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX
weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY
-
mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY
Dim tempid As ResourceIdentifier = New
ResourceIdentifier("layout",
OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, conn.SessionID)
Response.Redirect("/mapguide/ajaxviewer/WEBLAYOUT=" &
Server.UrlEncode(tempid)
joscsu wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> Or this:
System.Guid.NewGuid().ToString()
----- Ursprungligt meddelande ----
Från: Maksim Sestic <a class="moz-txt-link-rfc2396E" href="mailto:max@geoinova.com"><max@geoinova.com></a>
Till: MapGuide Users Mail List <a class="moz-txt-link-rfc2396E" href="mailto:mapguide-users@lists.osgeo.org"><mapguide-users@lists.osgeo.org></a>
Skickat: tisdag 2 december 2008 16:49:21
Ämne: RE: [mapguide-users] Runtime map problem
Try this:
System.Guid.NewGuid()
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a class="moz-txt-link-freetext" href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>] On Behalf Of padmini
godavarthi
Sent: Tuesday, December 02, 2008 15:35
To: <a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
Subject: Re: [mapguide-users] Runtime map problem
Hi,
Thanku very much for ur help
i tried this code
but i got an error in the line
Dim tempid as ResourceIdentifier = new
ResourceIdentifier(Guid.NewGuid(),
OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID)
because of this Guid.NewGuid()
1) Actually what is this?
2) Which paramater we have to pass in this place instead of
Guid.NewGuid()
Regards,
Padmini
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I forgot to save the weblayout in the code below :(
Updated version is:
'Setup connection
Dim host As New
Uri(<a class="moz-txt-link-rfc2396E" href="http://localhost/mapguide/mapagent/mapagent.fcgi">"http://localhost/mapguide/mapagent/mapagent.fcgi"</a>)
Dim conn As New HttpServerConnection(host, "Administrator", "admin",
"en", True)
'You have to change the string below to point at a valid WebLayout
Dim
weblayout as WebLayout =
con.GetWebLayout("Library://mylayout.WebLayout")
Dim mapdefinition as MapDefinition =
con.GetMapDefinition(weblayout.Map.ResourceId)
'Modify the initial view of the weblayout weblayout.Map.InitialView =
new MapViewType() weblayout.Map.InitialView.Scale = 2000 'Zoom to
1:2000 weblayout.Map.InitialView.CenterX =
(mapdefinition.Extents.MaxX
-
mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX
weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY -
mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY
'Obtain a unique session based id for the temporary weblayout (which
is a copy of an existing WebLayout) Dim tempid as ResourceIdentifier
=
new ResourceIdentifier(Guid.NewGuid(),
OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID)
'Save the layout, otherwise you can't reference it
con.SaveResourceAs(weblayout, tempid)
'Open the viewer, and use the temporary layout, since the map only
exists in the 'current session, we must use that session, and NOT
supply username/password
'BEWARE: The session belongs to the Administrator account, so the
user
gets full access to MapGuide (delete, modify, etc.)
Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" &
Server.UrlEncode(tempid) & "&SESSION=" &
Server.UrlEncode(con.SessionID))
Regards, Kenneth Skovhede, GEOGRAF A/S
Kenneth Skovhede, GEOGRAF A/S skrev:
</pre>
<blockquote type="cite">
<pre wrap="">To build a map, you must have all the components:
1. FeatureSource, references data
2. LayerDefinition, references a FeatureSource 3. MapDefinition,
references multiple LayerDefinitions 4. WebLayout, references a
MapDefinition
All these items must be in a repository (either Library or Session),
otherwise they can't be referenced.
When you write that you want to "create a WebLayout
programatically",
do you want to create ALL the above items, or do you have layers and
featuresources?
(1) If you want to generate a WebLayout ResourceID, you should use:
Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata",
ResourceTypes.WebLayout)
If you want to read the name of an existing MapDefinition from
another layout, you must do:
Dim weblayout as WebLayout =
con.GetWebLayout("Library://mylayout.WebLayout")
Dim res as String = webLayout.Map.ResourceId
(2) I don't understand the question.
(3) The MapDefinition is an Xml document. Inside, it references
layers, which references featuresources, as described above. It is
very slow to do this, so when you open a map in the browser, the xml
is transformed into a binary object. This object contains all the
info from the MapDefinition and some info from the layers and
featuresources.
You need to know this, because if you try to toggle layer visibility
in the MapDefinition, nothing happens. In short, the Runtime Map is
a
binary object that you can manipulate using the MapGuide (and
Maestro)-API, and it only works for a displayed map.
Upon startup, the Runtime Map is identical to the MapDefinition it
was created from.
A short example of using an existing WebLayout:
Dim host As New
Uri(<a class="moz-txt-link-rfc2396E" href="http://localhost/mapguide/mapagent/mapagent.fcgi">"http://localhost/mapguide/mapagent/mapagent.fcgi"</a>)
Dim conn As New HttpServerConnection(host, "Administrator", "admin",
"en", True)
'You have to change the string below to point at a valid WebLayout
Dim weblayout as WebLayout =
con.GetWebLayout("Library://mylayout.WebLayout")
Dim mapdefinition as MapDefinition =
con.GetMapDefinition(weblayout.Map.ResourceId)
weblayout.Map.InitialView = new MapViewType()
weblayout.Map.InitialView.Scale = 2000 'Zoom to 1:2000
weblayout.Map.InitialView.CenterX = (mapdefinition.Extents.MaxX -
mapdefinition.Extents.MinX) + mapdefinition.Extents.MinX
weblayout.Map.InitialView.CenterY = (mapdefinition.Extents.MaxY -
mapdefinition.Extents.MinX) + mapdefinition.Extents.MinY Dim tempid
as ResourceIdentifier = new ResourceIdentifier(Guid.NewGuid(),
OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, con.SessionID)
Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=" &
Server.UrlEncode(tempid) & "&USERNAME=Anonymous&PASSWORD=")
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
Thanks for u r reply
actually i wrote the code as
Dim host As New
Uri(<a class="moz-txt-link-rfc2396E" href="http://localhost/mapguide/mapagent/mapagent.fcgi">"http://localhost/mapguide/mapagent/mapagent.fcgi"</a>)
Dim conn As New HttpServerConnection(host, "Administrator",
"admin", "en", True)
Dim res As New ResourceIdentifier("Filebased
data/Maps/mapdata",
ResourceTypes.MapDefinition)
Dim mapId As String = res.ResourceId
with that i got the map resource id.
But actually to run the application the url in the browser must be
like
<a class="moz-txt-link-freetext" href="http://localhost/mapguide/mapviewerajax/?WEBLAYOUT=Library%3a%2f%2fF">http://localhost/mapguide/mapviewerajax/?WEBLAYOUT=Library%3a%2f%2fF</a>
ilebased+data%2fLayout%2flayout.WebLayout
1) How can i get this weblayout (like
Library%3a%2f%2fFilebased+data%2fLayout%2flayout.WebLayout)
programmetically
2) I want to redirect to the ajax viewer sample application through
asp.net (like given by u )
Response.Redirect("/mapguide/ajaxviewer/?WEBLAYOUT=...resourceId
for
your WebLayout...&USERNAME=Anonymous&PASSWORD=");
3) Can u plz tell me the purpose of runtime map (actualli iam in
configusing
state)
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Instead of re-posting the original question, could you try to
explain what parts of my previous reply that are unclear or wrong?
<a class="moz-txt-link-freetext" href="http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-to20">http://www.nabble.com/How-to-Load-Runtime-map-in-mapviewerajax-to20</a>
704038.html#a20769349
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap=""> Hi ,
iam using mapguide open source 2.0( with .Net 2.0 + IIS 5.1) Iam
using dotnet viewer sample while running the application i
observed that the layout path given in the application.
as
String webLayout =
"Library://Samples/Sheboygan/Layouts/SheboyganAspTiled.WebLayout";
it works but now i want to create this weblayout in run time
(by
code)
using mapguide maestro api
for this purpose i followed the link
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/Run">http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/Run</a>
timeMap
but i didnt get any out.
can u plz tell me
1) how to create this weblayout in run time
2) How it will works
If u know this plz tell me the procedure.
Regards,
Padmini.
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">---------------------------------------------------------------------
---
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">--
View this message in context:
<a class="moz-txt-link-freetext" href="http://www.nabble.com/Runtime-map-problem-tp20789983p20793385.html">http://www.nabble.com/Runtime-map-problem-tp20789983p20793385.html</a>
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
__________ Information from ESET NOD32 Antivirus, version of virus
signature
database 3658 (20081202) __________
The message was checked by ESET NOD32 Antivirus.
<a class="moz-txt-link-freetext" href="http://www.eset.com">http://www.eset.com</a>
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
__________________________________________________________
Låna pengar utan säkerhet. Jämför vilkor online hos Kelkoo.
<a class="moz-txt-link-freetext" href="http://www.kelkoo.se/c-100390123-lan-utan-sakerhet.html?partnerId=96915014">http://www.kelkoo.se/c-100390123-lan-utan-sakerhet.html?partnerId=96915014</a>
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>