Re: [mapguide-users] Hyperlink not showing
A nice trick is to use an URL starting with javascript:, ea: javascript:alert('hello');. Then the javascript can call any function you have and display the options to the user. You wont get any links active without using the URL Activated for Feature. You can use the above javascript: trick for the URL. Tooltips can show embedded html, but disappear when the mouse moves, making it hard to use. Regards, Kenneth Skovhede, GEOGRAF A/S LLEUNDD skrev: I have an attribute in one of my point layers called 'hyperlink'. When I select a point in a flexible web layout (i.e., Slate) the selection widget shows the hyperlink address, but I can not click on the address to advance to the website. I know I can use the 'URL Activated for Feature' in the layer editor, however I may have points that would have multiple hyperlinks to chose from. I have tried the following in the attributes for the point layer with no success: 1. www.123.com 2. http://www.123.com 3. a href=http://www.123.com; 123/a I have MGOS version 2.0.0.2308 installed and am using Autodesk MapGuide Studio 2008. Any help would be appreciated. Cheers! ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Adding a temporary Layer in MapGuide
In the buffer.aspx, the AddFeatureToCollection(...) function adds the feature. The MgGeometry parameter can be created using the MgGeometryFactory: http://mapguide.osgeo.org/files/mapguide/docs/2.0/d4/d46/class_mg_geometry_factory.htm I don't know what happens with the exception, but it has something to do with selection, which you can hopefully ignore. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: As I said on my last post, I successfully linked the buffer code to the Task Panel item. But there is a problem, when the buffer code is executed I get this runtime error: Buffer Error An unclassified exception occurred. Exception occurred in method new_MgSelection__SWIG_1 at line 649 in file .\MgApi_wrap.cpp I followed these steps to link the buffer code to the Task Panel: - In DevGuideSamples\JAVASAMPLES\HELLO_MAP there are TASK_PANE.JSP and DISPLAY_SPATIAL_REFERENCE.JSP. TASK_PANE.JSP is linked to the Task Panel, and it calls DISPLAY_SPATIAL_REFERENCE.JSP - In mapviewerjava there is buffer.jsp - I copied the buffer.jsp code into the DISPLAY_SPATIAL_REFERENCE.JSP file How can I solve that problem? You said to insert points instead of the buffer feature. How? Points (or a line in a similar task) have coordinates stored on a MySql database... - Original Message - From: Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Wednesday, January 21, 2009 11:24 AM Subject: Re: [mapguide-users] Adding a temporary Layer in MapGuide Yes, just insert points instead of the buffer feature. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: Thank you for your reply Kenneth. Trying examples on DevGuideSamples I discovered how to work with the Task Pane... Now I need to draw dynamically on the map points of known x,y coordinates, after clicking on the appropriate Task item. I hope this can be done with the buffer script you suggested me. Isn't it? Cheers Carmelo - Original Message - From: Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Wednesday, January 21, 2009 9:04 AM Subject: Re: [mapguide-users] Adding a temporary Layer in MapGuide I have not used the AJAX viewer enough to know how to do this with tasks. The values can be read from the viewer through some property functions: http://mapguide.osgeo.org/files/mapguide/docs/2.0/viewerapi.html#mapframe_getsessionid http://mapguide.osgeo.org/files/mapguide/docs/2.0/viewerapi.html#mapframe_getmapname With those, you can manually pass them to the request, if you use the InvokeScript method, but there may be an easier way. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: Thank you for your help! I'm seeing that the code you posted is very similar to the buffer code, however I'm really new to MapGuide, so I hope you can help me understanding how to make it work. I created a Layout, using MapGuide Studio, on which I added a new custom command for the Task panel, named Route tracing. Therefore I created the route_tracing.jsp file, on which I'm trying to use your code (translating it from PHP to JSP) or the buffer.jsp code (which is already in JSP). On both your code and buffer.jsp there is this code: mapName = GetParameter(request, MAPNAME); sessionId = GetParameter(request, SESSION); - The question is: how can I pass the MAPNAME and SESSION values to the web page? The final result should be a web page, which opens when its Action Task item is clicked, on which I can select and digit some options. After clicking a button the page should get these values, and display the map with the calculated additional layer on it. I hope you can help me about that Cheers Carmelo - Original Message - From: Arnaud De Groof arnaud.degr...@spacebel.be To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Monday, January 12, 2009 4:18 PM Subject: RE: [mapguide-users] Adding a temporary Layer in MapGuide The first code : ?php // Vital includes. include ../../mapviewerphp/constants.php; include ../../mapviewerphp/common.php; $args = ($_SERVER['REQUEST_METHOD'] == POST) ? $_POST : $_GET; $sessionId = $args['SESSION']; $mapName = $args['MAPNAME']; $layerName1 = 'YYY'; $rlLayerResourceId = Library://XXX/$layerName1.LayerDefinition; InitializeWebTier(); $userInfo = new MgUserInformation($sessionId); $siteConnection = new MgSiteConnection(); $siteConnection-Open($userInfo); $resourceService = $siteConnection-CreateService(MgServiceType::ResourceService); // Read the MapDefinition into an XML DOM document object. $md = Library://XXX/$mapName.MapDefinition ; // TODO Constant! $mdResourceId = new MgResourceIdentifier($md); $mdReader = $resourceService-GetResourceContent($mdResourceId); $mdXml = $mdReader-ToString(); $mdDomDoc = DOMDocument::loadXML($mdXml); // Add a new MapLayer
Re: [ZS2] Re: [mapguide-users] [ZS2] Draw Point From Invoke Script n c# script
Try looking at the file: C:\Program Files\MapGuideOpenSource2.0\WebServerExtensions\www\mapviewernet\buffer.aspx It has a fair amount of comments in it. You should replace the calls to AddFeatureToCollection, so you insert a point, instead of a buffered feature. Regards, Kenneth Skovhede, GEOGRAF A/S Kenneth Skovhede, GEOGRAF A/S skrev: Nope. If you do manage to get it done, others would benefit from an example: http://trac.osgeo.org/mapguide/wiki/CodeSamples/AspDotNet/TemporaryMarkupsDotNet Try using the Buffer feature of the MapGuide AJAX viewer to see how it works. Alternatively, the Scribble application may have some usefull code: http://trac.osgeo.org/mapguide/wiki/CodeSamples/ASP.Net/ScribbleApp Regards, Kenneth Skovhede, GEOGRAF A/S ajid skrev: Ermm Can u give a example?? - ::: PublicVisitor ::: www.myguidepages.com ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Adding a temporary Layer in MapGuide
It would be the same basic approach, but you need to run through the records like: recordset = query_database(sql_filter) while(not recordset.eof) { AddFeatureToCollection() } Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: The buffer example doesn't read data from database, isn't it? I need to read data from a MySql database and, after executing a SQL query, display them on the map. How can I do that? Is there any example code about that? Thank you very much again Cheers Carmelo - Original Message - From: Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Wednesday, January 21, 2009 11:24 AM Subject: Re: [mapguide-users] Adding a temporary Layer in MapGuide Yes, just insert points instead of the buffer feature. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: Thank you for your reply Kenneth. Trying examples on DevGuideSamples I discovered how to work with the Task Pane... Now I need to draw dynamically on the map points of known x,y coordinates, after clicking on the appropriate Task item. I hope this can be done with the buffer script you suggested me. Isn't it? Cheers Carmelo - Original Message - From: Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Wednesday, January 21, 2009 9:04 AM Subject: Re: [mapguide-users] Adding a temporary Layer in MapGuide I have not used the AJAX viewer enough to know how to do this with tasks. The values can be read from the viewer through some property functions: http://mapguide.osgeo.org/files/mapguide/docs/2.0/viewerapi.html#mapframe_getsessionid http://mapguide.osgeo.org/files/mapguide/docs/2.0/viewerapi.html#mapframe_getmapname With those, you can manually pass them to the request, if you use the InvokeScript method, but there may be an easier way. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: Thank you for your help! I'm seeing that the code you posted is very similar to the buffer code, however I'm really new to MapGuide, so I hope you can help me understanding how to make it work. I created a Layout, using MapGuide Studio, on which I added a new custom command for the Task panel, named Route tracing. Therefore I created the route_tracing.jsp file, on which I'm trying to use your code (translating it from PHP to JSP) or the buffer.jsp code (which is already in JSP). On both your code and buffer.jsp there is this code: mapName = GetParameter(request, MAPNAME); sessionId = GetParameter(request, SESSION); - The question is: how can I pass the MAPNAME and SESSION values to the web page? The final result should be a web page, which opens when its Action Task item is clicked, on which I can select and digit some options. After clicking a button the page should get these values, and display the map with the calculated additional layer on it. I hope you can help me about that Cheers Carmelo - Original Message - From: Arnaud De Groof arnaud.degr...@spacebel.be To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Monday, January 12, 2009 4:18 PM Subject: RE: [mapguide-users] Adding a temporary Layer in MapGuide The first code : ?php // Vital includes. include ../../mapviewerphp/constants.php; include ../../mapviewerphp/common.php; $args = ($_SERVER['REQUEST_METHOD'] == POST) ? $_POST : $_GET; $sessionId = $args['SESSION']; $mapName = $args['MAPNAME']; $layerName1 = 'YYY'; $rlLayerResourceId = Library://XXX/$layerName1.LayerDefinition; InitializeWebTier(); $userInfo = new MgUserInformation($sessionId); $siteConnection = new MgSiteConnection(); $siteConnection-Open($userInfo); $resourceService = $siteConnection-CreateService(MgServiceType::ResourceService); // Read the MapDefinition into an XML DOM document object. $md = Library://XXX/$mapName.MapDefinition ; // TODO Constant! $mdResourceId = new MgResourceIdentifier($md); $mdReader = $resourceService-GetResourceContent($mdResourceId); $mdXml = $mdReader-ToString(); $mdDomDoc = DOMDocument::loadXML($mdXml); // Add a new MapLayer $targetNode = $mdDomDoc-getElementsByTagName(MapLayer)-item(0); $newNode = $targetNode-parentNode-insertBefore(new DOMElement(MapLayer), $targetNode); $newNode-appendChild($mdDomDoc-createElement(Name, $layerName1)); $newNode-appendChild($mdDomDoc-createElement(ResourceId, $rlLayerResourceId)); $newNode-appendChild($mdDomDoc-createElement(Selectable, false)); $newNode-appendChild($mdDomDoc-createElement(ShowInLegend, false)); $newNode-appendChild($mdDomDoc-createElement(LegendLabel)); $newNode-appendChild($mdDomDoc-createElement(ExpandInLegend, false)); $newNode-appendChild($mdDomDoc-createElement(Visible, true)); $newNode-appendChild($mdDomDoc-createElement(Group)); // Save the updated MapDefinition $updatedXml = $mdDomDoc-saveXML(); $byteSource = new
[mapguide-users] Convite pessoal de Rui Daniro Doutel Pinto
Olá, Em 1/8/2009 5:47:17 PM, Rui Daniro Doutel Pinto lhe pediu para fazer parte do seu caderno de endereços Unyk para ter sempre acesso aos seus dados, e para que você tenha sempre acesso aos dados dele(a). Para aceitar o pedido dele(a), clique aqui. http://www.unyk.com/ml/70/5/?i=c74107488dd34d96a1f226b77af3b2d0 Unyk é um sistema inteligente e simples que lhe permite gerenciar seus contatos e nunca perdê-los de vista. Agora você não precisa mais se preocupar com os dados dos seus contatos. Daqui pra frente, eles se encarregarão da gestão dos próprios dados deles em seu caderno de endereços. Quando os dados deles forem modificados no site Unyk.com, o seu caderno de endereços será atualizado automaticamente. Quando você modificar seus dados no site Unyk.com, o caderno de endereços deles no Unyk será atualizado automaticamente. É realmente simples e é gratuito... UNYK já tem 10 milhões de usuários. Caso você não queira mais receber convites para usar UNYK de Rui Daniro Doutel Pinto, clique aqui!! http://www.unyk.com/ml/250/74/unsubscribe.asp?mid=9E92A7A57A79899Demail=mapguide%2Dusers%40lists%2Eosgeo%2Eorgremove=2s=11511560 Caso você não queira mais receber convites para usar UNYK, clique aqui! http://www.unyk.com/ml/70/6/unsubscribe.asp?i=c74107488dd34d96a1f226b77af3b2d0 UNYK, o primeiro caderno de endereços inteligente que se atualiza sozinho! ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
[mapguide-users] SetSpatialFilter and MgFeatureSpatialOperations problem with search
Hi my problem is with SetSpatialFilter , in my application user click on PARCEL (on map) , and after click on get REGION name application should try to search in which REGION (biger surface) is the PARCEL. what i want to get is: help image :) http://img171.imageshack.us/img171/8450/51030812fq1.png so when user click on small parcel (in grey REGION), first pictures he should get ID of big grey REGION. i you see on second image if parcel is nearly yellow REGION user should get ID ONLY grey region I try use all method like: MgFeatureSpatialOperations::Intersects it is work but i get all REGION who Intersects my parcel (yellow and grey region ), after try another MgFeatureSpatialOperations like: MgFeatureSpatialOperations::Contains = 0 MgFeatureSpatialOperations::CoveredBy = 8 MgFeatureSpatialOperations::Crosses = 1 MgFeatureSpatialOperations::Disjoint = 2 MgFeatureSpatialOperations::EnvelopeIntersects = 10 MgFeatureSpatialOperations::Equals = 3 MgFeatureSpatialOperations::Inside = 9 MgFeatureSpatialOperations::Intersects = 4 MgFeatureSpatialOperations::Overlaps = 5 MgFeatureSpatialOperations::Touches = 6 MgFeatureSpatialOperations::Within = 7 but get wrong/or none results That is may procedure 1. user click on map 2. he press button REGION info 3. application use Getselection method to get selected parcel info: ID,NAME, and x,y Coordinates 4. I create new polygon (Coordinates come from selected parcel) 5. i use SetSpatialFilter and by iteration on all map layer i check what layer is in selected polygon range (REGION). //my code $selectedFeatures2=array(); //REGION ID,NAME etc. //$coords -- come from selected parcel (GetCoordinates()) //generate new polygon from selected parcel $linearRing = $geometryFactory-CreateLinearRing($coords); $parcel_polygon = $geometryFactory-CreatePolygon($linearRing, null); $resourceService=$siteConnection-CreateService(MgServiceType::ResourceService); ///BEGIN layer iteration...on all map layer $layer = $map-GetLayers()-GetItem($layer_name[$i]); $resId = new MgResourceIdentifier($layer-GetFeatureSourceId()); $featureGeometry = $layer-GetFeatureGeometryName(); $featureClass = $layer-GetFeatureClassName(); $schemaAndClass = explode(:, $featureClass); $featureService =$siteConnection-CreateService(MgServiceType::FeatureService); $queryOptions = new MgFeatureQueryOptions(); $queryOptions-SetSpatialFilter($featureGeometry, $polygon,MgFeatureSpatialOperations::Intersects); $featureReader = $featureService-SelectFeatures($resId, $layer-GetFeatureClassName(), $queryOptions); while ($featureReader-ReadNext()) { $selectedFeatures2[]=array(layer_name=$featureReader-GetString('Layer'),FeatureId=$featureReader-GetInt32('FeatureId')); } ///END layer iteration...on all map layer Can you pleas give me some sample code for this? macieksk ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
[mapguide-users] Looking for instances of MapGuide OS implementation?
Hi I'm looking for some information of using MapGuide OS in different applications. i mean sth like architecture they have designed, other tools they have used with MapGuide OS or anything else. any information would be apperciated Thanks in advance ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Precision problem viewing map
Hi Stefan, I just submitted a change to the trunk version of ajaxmappane.templ that should resolve this issue. Take a look at the submission: http://trac.osgeo.org/mapguide/changeset/3557 You should be able to make the same simple changes to your own version of this file (located in www/viewerfiles) to fix the problem without re-installing anything. Let me know if this works for you! Chris. -Original Message- From: Chris Claydon Sent: Monday, January 12, 2009 9:44 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Precision problem viewing map I tried digitizing a rectangle, and the result was that it was offset only in the y axis. I believe this corresponds to the small space that you have between the top of the map frame and the top of the map itself. I've seen bugs reported about this gap before, but I'm not sure if they've been resolved. Chris. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Stefan Dalakov Sent: Monday, January 12, 2009 4:12 AM To: MapGuide Users Mail List Subject: [mapguide-users] Precision problem viewing map Hi all, I am facing a strange and unexpected problem regarding precision of map and coordinates display. I see that my data is not displayed on the exact place - there is a shift in Y coordinate. I have a raster layer with bounding rectangle Xmin=..., Ymin=7070400, Xmax= Ymax=7071600. But when I move the mouse pointer at the lower left corner I see Y=7070320 (at scale 1:2000 let say) or similar value, and the difference depends on the scale. If I zoom down, the difference changes, and at scales close to 1:50 it is ok. The situation is similar at the upper right corner. I observe exactly the same effect with all other layers. I wouldn't care too much about this - even if there is a shift, all layers are shifted equally, but when I digitize a polygon it is also shifted. Imagine I digitize a polygon to follow a feature on the raster image, coordinates are recorded , the feature is added to data source, but when it is added, due to this shift it appears not where it has been digitized, but shifted. I guess you did not understand anything of this, but you can visit http://www.bgmapguide.com:8008/mapguide/rakvag/main.php click on draw a new suggestion and try to digitize 2 adjacent polygons - you will see them overlap Please be gentle to the server - it is an old tired horse. And to save some time - all layers and the map are in the same coordinate system. This effect is not depending on the browser (tested with FFox 2 3, Safari and IE) and is not depending on the screen resolution Best regards : Stefan Dalakov ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
[mapguide-users] SetSelectionXML 'Stack overflow at line 0' errow
Hi all, I work with MGOS 2.0.2 on windows XP. I develop with ASP.NET. When I try to select some feature with a code filter the SetSelectionXML function get me the follow error Stack overflow at line 0. The value of parameter that I send to the function is: ?xml version=1.0 encoding=UTF-8?FeatureSet xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=FeatureSet-1.0.0.xsd Layer id=4b540ce0--1000-8000-000475cae734 Class id=Default:Zona1_a7 IDAPmZuQjg2UI=/ID /Class /Layer/FeatureSet What is wrong? Thanks Matteo -- View this message in context: http://n2.nabble.com/SetSelectionXML-%27Stack-overflow-at-line-0%27-errow-tp2199620p2199620.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] SetSelectionXML 'Stack overflow at line 0' errow
I don't see any errors in the format of the XML. Are you retrieving the layer ID dynamically? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, January 22, 2009 12:28 PM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] SetSelectionXML 'Stack overflow at line 0' errow Hi all, I work with MGOS 2.0.2 on windows XP. I develop with ASP.NET. When I try to select some feature with a code filter the SetSelectionXML function get me the follow error Stack overflow at line 0. The value of parameter that I send to the function is: ?xml version=1.0 encoding=UTF-8?FeatureSet xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=FeatureSet-1.0.0.xsd Layer id=4b540ce0--1000-8000-000475cae734 Class id=Default:Zona1_a7 IDAPmZuQjg2UI=/ID /Class /Layer/FeatureSet What is wrong? Thanks Matteo -- View this message in context: http://n2.nabble.com/SetSelectionXML-%27Stack-overflow-at-line-0%27-errow-tp2199620p2199620.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Adding a temporary Layer in MapGuide
The tooltip uses a very narrow selection area, meaning that you have to be VERY precise to hit it. At high zoom levels, it is not possible to hit the correct pixel. You can modify the ajaxmappane.templ file to use a wider search area. I recommend calculating an area of 10x10 pixels, and then constructing a polygon that has that size in the current scale. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: I solved the problem creating a static layer using MapGuide Studio, which feature source reads data from a temporary MySql table. Everytime I need to filter these data, before using the layer I modify/update data on the temporary table... Now I'd like to show a tooltip when the cursor is on the displayed point. The tooltip works when I move the cursor on POLYGONS, but it is not working on POINTS. How can I do? Thank you again Cheers Carmelo - Original Message - From: Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Thursday, January 22, 2009 11:14 AM Subject: Re: [mapguide-users] Adding a temporary Layer in MapGuide It would be the same basic approach, but you need to run through the records like: recordset = query_database(sql_filter) while(not recordset.eof) { AddFeatureToCollection() } Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: The buffer example doesn't read data from database, isn't it? I need to read data from a MySql database and, after executing a SQL query, display them on the map. How can I do that? Is there any example code about that? Thank you very much again Cheers Carmelo - Original Message - From: Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Wednesday, January 21, 2009 11:24 AM Subject: Re: [mapguide-users] Adding a temporary Layer in MapGuide Yes, just insert points instead of the buffer feature. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: Thank you for your reply Kenneth. Trying examples on DevGuideSamples I discovered how to work with the Task Pane... Now I need to draw dynamically on the map points of known x,y coordinates, after clicking on the appropriate Task item. I hope this can be done with the buffer script you suggested me. Isn't it? Cheers Carmelo - Original Message - From: Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Wednesday, January 21, 2009 9:04 AM Subject: Re: [mapguide-users] Adding a temporary Layer in MapGuide I have not used the AJAX viewer enough to know how to do this with tasks. The values can be read from the viewer through some property functions: http://mapguide.osgeo.org/files/mapguide/docs/2.0/viewerapi.html#mapframe_getsessionid http://mapguide.osgeo.org/files/mapguide/docs/2.0/viewerapi.html#mapframe_getmapname With those, you can manually pass them to the request, if you use the InvokeScript method, but there may be an easier way. Regards, Kenneth Skovhede, GEOGRAF A/S Carmelo Saffioti skrev: Thank you for your help! I'm seeing that the code you posted is very similar to the buffer code, however I'm really new to MapGuide, so I hope you can help me understanding how to make it work. I created a Layout, using MapGuide Studio, on which I added a new custom command for the Task panel, named Route tracing. Therefore I created the route_tracing.jsp file, on which I'm trying to use your code (translating it from PHP to JSP) or the buffer.jsp code (which is already in JSP). On both your code and buffer.jsp there is this code: mapName = GetParameter(request, MAPNAME); sessionId = GetParameter(request, SESSION); - The question is: how can I pass the MAPNAME and SESSION values to the web page? The final result should be a web page, which opens when its Action Task item is clicked, on which I can select and digit some options. After clicking a button the page should get these values, and display the map with the calculated additional layer on it. I hope you can help me about that Cheers Carmelo - Original Message - From: Arnaud De Groof arnaud.degr...@spacebel.be To: MapGuide Users Mail List mapguide-users@lists.osgeo.org Sent: Monday, January 12, 2009 4:18 PM Subject: RE: [mapguide-users] Adding a temporary Layer in MapGuide The first code : ?php // Vital includes. include ../../mapviewerphp/constants.php; include ../../mapviewerphp/common.php; $args = ($_SERVER['REQUEST_METHOD'] == POST) ? $_POST : $_GET; $sessionId = $args['SESSION']; $mapName = $args['MAPNAME']; $layerName1 = 'YYY'; $rlLayerResourceId = Library://XXX/$layerName1.LayerDefinition; InitializeWebTier(); $userInfo = new MgUserInformation($sessionId); $siteConnection = new MgSiteConnection(); $siteConnection-Open($userInfo); $resourceService =
[mapguide-users] Load Layer Definition XML
Hey Everyone; Fairly new to MGOS. Here is what I am trying to do. I have a map with many Layers. One of my requirements is to allow users to be able to change the layer styles via a web wizard. The user will be able to adjust certain styles for line/point/polygon (surface). Ie font, symbol, line thickness, color etc. Already my site allows a user to select the layer they want to change, then change the styles for a point only. The changing doesn't seem to be a problem right now. The problem I have: Once a user selects the layer they want to load. How would I get the layer and use XML document or XPATH or something to allow the users edit XML nodes. Here is my code that checks to see what layer type I have when the user selects the layer. I have 3 different user controls (one for line, one for poly, one for line). What I really want, is to load the layer and populate the appropriate controls inside the user control. MgSiteConnection conn = InitializeGisWebTier(); string resource = Library://MUNICIPALITIES/ + Municipality + /2_DATA/ + LayerName + .FeatureSource; MgResourceService svc = (MgResourceService)conn.CreateService(MgServiceType.ResourceService ); // Populate some values that we will need. MgResourceIdentifier resourceId = new MgResourceIdentifier(resource); MgFeatureReader featureReader = LayerDefinitionFactory.MakeAFeatureReader(conn, resourceId); // Find out what type of Geometric property the FeatureSource we uploaded has. string geometricPropertyType = LayerDefinitionFactory.GetFeatureSourceGeometricPropertyType(featureReader); switch (geometricPropertyType) { case SURFACE: // We load the Polygon usercontrol this.phStylizeLayerControl.Controls.Add(new PolygonStyleBuilder()); break; case POINT: // we load the point usercontrol //this.phStylizeLayerControl.Controls.Add(new PointStyleBuilder()); PointStyleBuilder control = (PointStyleBuilder)LoadControl(~/Pages/Controls/PointStyleBuilder.ascx); this.phStylizeLayerControl.Controls.Add(control); txtSymbol.Enabled = true; txtSymbolSize.Enabled = true; break; case CURVE: // we load the line user control this.phStylizeLayerControl.Controls.Add(new LineStyleBuilder()); break; } Thanks for any help in advance. -- View this message in context: http://n2.nabble.com/Load-Layer-Definition-XML-tp2199703p2199703.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] SetSelectionXML 'Stack overflow at line 0' errow
Hi Chris, I use this code: objMap = New MgMap(objMGSite) objMap.Open(objMapId.GetName) objLayer = objMap.GetLayers.GetItem(strLayer) objQueryIdOptions = New MgFeatureQueryOptions() objQueryIdOptions.SetFilter(strFilter) Dim objFeatureR2 As MgFeatureReader = objLayer.SelectFeatures(objQueryIdOptions) Response.Write(br/ObjFeature) objSelection = New MgSelection(objMap) objSelection.AddFeatures(objLayer, objFeatureR2, 0) Dim strXML as String=objSelection.ToXML() At the end of ASP.NET function I put the strXML value into as html input box then I call the Javascript code ..mapFrame.SetSelectionXML(document.XMLinput.value) Thanks Matteo Chris Claydon wrote: I don't see any errors in the format of the XML. Are you retrieving the layer ID dynamically? -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Matteo Sent: Thursday, January 22, 2009 12:28 PM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] SetSelectionXML 'Stack overflow at line 0' errow Hi all, I work with MGOS 2.0.2 on windows XP. I develop with ASP.NET. When I try to select some feature with a code filter the SetSelectionXML function get me the follow error Stack overflow at line 0. The value of parameter that I send to the function is: ?xml version=1.0 encoding=UTF-8?FeatureSet xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=FeatureSet-1.0.0.xsd Layer id=4b540ce0--1000-8000-000475cae734 Class id=Default:Zona1_a7 IDAPmZuQjg2UI=/ID /Class /Layer/FeatureSet What is wrong? Thanks Matteo -- View this message in context: http://n2.nabble.com/SetSelectionXML-%27Stack-overflow-at-line-0%27-errow-tp2199620p2199620.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- View this message in context: http://n2.nabble.com/SetSelectionXML-%27Stack-overflow-at-line-0%27-errow-tp2199620p2199806.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
RE: [mapguide-users] Two maps in the same layout
Hi Mark, about your question: - Why would you need to modify any of the viewer files in order to have 2 pages in your map? I have modified viewer files because I want to set a themed layer dynamically in each map in the first time that my application to be loaded. My use case is: The theming is placed according to a preference to set by the user in previous session. Thus the applicacion could show two preferences on the same map(and the same layout). This is useful when you want to show comparisons, for example: To compare population 1980 vs 1990 (like a dashboard). Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? Thanks, Ivan Milicevic wrote: Hi, Frameset sucks, use iframe, it's more flexibile. In C# code create two mgSession's and define two differen weblayout's. MgUserInformation userInfo = new MgUserInformation(defaultUser, defaultPassword); MgSite site = new MgSite(); site.Open(userInfo); sessionId = site.CreateSession(); sessionId2 = site.CreateSession(); webLayout = Library://PROJEKTI/PRIKAZI/1.WebLayout; weblayout2 = Library://PROJEKTI/PRIKAZI/1mm.WebLayout; Here, after body.. diviframe id=viewerFrame width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId%WEBLAYOUT=% =webLayout% /iframediv diviframe id=viewerFrame2 width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT= %=webLayout2%/iframediv Put iframes into div's so you can place it absolutely, moving maps, ect... The point is that you must have two mgSessionId's and two weblayout's. Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 5:15 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Many people have their page in a frameset. Here is an example which has two frames, 1 for a title.html page and 1 for the mapguide viewer. Here is an example of what your frameset page might look like (in VB.NET) ** %@ Page Language=VB Debug=true % %@ Import Namespace=OSGeo.MapGuide % !-- #Include File=UtilityFunctions.aspx -- !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; script runat=server Private webLayout As String = Library://MGA/Layout/MGA Web Layout.WebLayout Private defaultUser As String = Anonymous Private defaultPassword As String = Private SessionId As String = Private addRequests As String = Private Parameters As String = /script % Try ' Initialize a session and register a variable to hold the ' session id, then initialize the Web Extensions, connect ' to the site, and create a session. InitializeWebTier() Dim userInfo As New MgUserInformation(defaultUser, defaultPassword) Dim site As New MgSite() site.Open(userInfo) SessionId = site.CreateSession() Catch ex As Exception Response.Write(ex.Message) End Try % frameset rows=50,* frame id=titleFrame frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=http://localhost/mapguide/mga/title.html; frame id=viewerFrame frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=http://localhost/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=%=s essionId%WEBLAYOUT=%=webLayout%LOCALE=en /frameset This page creates a horizontal split page with two pages in it. If you adjusted frameset rows=50,* to frameset cols=*,* you would get a page split in half vertically. Then change the src= element to the two pages you want shown. Hope that clears it up a bit. -Mark Pendergraft
RE: [mapguide-users] Two maps in the same layout
Only for completing my idea about the dynamic theming in the first time: frame id=viewer1Frame frameborder=no marginwidth=0 marginheight=0 scrolling=no src=/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId1%WEBLAYOUT=%=webLayout%THEMINGTYPE=1 In this sentence you can see a parameter added called THEMINGTYPE, which is why I have modified the viewer files. I have not found another way of doing theming dynamically in the first time. I would like to do it without modifying the viewer files and much better if it is possible to do in FUSION viewer. Thanks in advance, Rodolfo Moreno wrote: Hi Mark, about your question: - Why would you need to modify any of the viewer files in order to have 2 pages in your map? I have modified viewer files because I want to set a themed layer dynamically in each map in the first time that my application to be loaded. My use case is: The theming is placed according to a preference to set by the user in previous session. Thus the applicacion could show two preferences on the same map(and the same layout). This is useful when you want to show comparisons, for example: To compare population 1980 vs 1990 (like a dashboard). Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? Thanks, Ivan Milicevic wrote: Hi, Frameset sucks, use iframe, it's more flexibile. In C# code create two mgSession's and define two differen weblayout's. MgUserInformation userInfo = new MgUserInformation(defaultUser, defaultPassword); MgSite site = new MgSite(); site.Open(userInfo); sessionId = site.CreateSession(); sessionId2 = site.CreateSession(); webLayout = Library://PROJEKTI/PRIKAZI/1.WebLayout; weblayout2 = Library://PROJEKTI/PRIKAZI/1mm.WebLayout; Here, after body.. diviframe id=viewerFrame width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId%WEBLAYOUT=% =webLayout% /iframediv diviframe id=viewerFrame2 width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT= %=webLayout2%/iframediv Put iframes into div's so you can place it absolutely, moving maps, ect... The point is that you must have two mgSessionId's and two weblayout's. Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 5:15 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Many people have their page in a frameset. Here is an example which has two frames, 1 for a title.html page and 1 for the mapguide viewer. Here is an example of what your frameset page might look like (in VB.NET) ** %@ Page Language=VB Debug=true % %@ Import Namespace=OSGeo.MapGuide % !-- #Include File=UtilityFunctions.aspx -- !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; script runat=server Private webLayout As String = Library://MGA/Layout/MGA Web Layout.WebLayout Private defaultUser As String = Anonymous Private defaultPassword As String = Private SessionId As String = Private addRequests As String = Private Parameters As String = /script % Try ' Initialize a session and register a variable to hold the ' session id, then initialize the Web Extensions, connect ' to the site, and create a session. InitializeWebTier() Dim userInfo As New MgUserInformation(defaultUser, defaultPassword) Dim site As New MgSite() site.Open(userInfo) SessionId = site.CreateSession() Catch ex As Exception Response.Write(ex.Message) End Try % frameset rows=50,* frame id=titleFrame frameborder=0 marginwidth=0 marginheight=0 scrolling=no
RE: [mapguide-users] Two maps in the same layout
Sorry, I didn't thoroughly read your original question. So I'll try again. The main problem here is that you can't initially theme because you don't have access to the runtime map(s) as the viewer's haven't loaded yet. What you can do is hook on the viewer's loading process (like so: http://trac.osgeo.org/mapguide/wiki/CodeSamples/JavaScript/AJAXViewerEventHooking) and invoke a server-side script that does the theming passing in your map's name (which will now be available) and any other theming parameters. When the theming script has completed, refresh the affected viewer. Hope that helps. - Jackie Rodolfo Moreno wrote: Only for completing my idea about the dynamic theming in the first time: frame id=viewer1Frame frameborder=no marginwidth=0 marginheight=0 scrolling=no src=/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId1%WEBLAYOUT=%=webLayout%THEMINGTYPE=1 In this sentence you can see a parameter added called THEMINGTYPE, which is why I have modified the viewer files. I have not found another way of doing theming dynamically in the first time. I would like to do it without modifying the viewer files and much better if it is possible to do in FUSION viewer. Thanks in advance, Rodolfo Moreno wrote: Hi Mark, about your question: - Why would you need to modify any of the viewer files in order to have 2 pages in your map? I have modified viewer files because I want to set a themed layer dynamically in each map in the first time that my application to be loaded. My use case is: The theming is placed according to a preference to set by the user in previous session. Thus the applicacion could show two preferences on the same map(and the same layout). This is useful when you want to show comparisons, for example: To compare population 1980 vs 1990 (like a dashboard). Ivan good sugestion about the iframes, it's better than frameset. However I would like to do it using FUSION viewer. Is it possible? Thanks, Ivan Milicevic wrote: Hi, Frameset sucks, use iframe, it's more flexibile. In C# code create two mgSession's and define two differen weblayout's. MgUserInformation userInfo = new MgUserInformation(defaultUser, defaultPassword); MgSite site = new MgSite(); site.Open(userInfo); sessionId = site.CreateSession(); sessionId2 = site.CreateSession(); webLayout = Library://PROJEKTI/PRIKAZI/1.WebLayout; weblayout2 = Library://PROJEKTI/PRIKAZI/1mm.WebLayout; Here, after body.. diviframe id=viewerFrame width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId%WEBLAYOUT=% =webLayout% /iframediv diviframe id=viewerFrame2 width=100% height=100% frameborder=0 marginwidth=0 marginheight=0 scrolling=no src=../mapviewernet/ajaxviewer.aspx?SESSION=%=sessionId2%WEBLAYOUT= %=webLayout2%/iframediv Put iframes into div's so you can place it absolutely, moving maps, ect... The point is that you must have two mgSessionId's and two weblayout's. Hope this helps. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 5:15 PM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Roldolfo, Sorry I didn't look at your code. It's pretty much exactly the same as what I posted. Why would you need to modify any of the viewer files in order to have 2 pages in your map? I was able to create a 2 map page using framesets in the same manner that you did. -Mark -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Mark Pendergraft Sent: Wednesday, January 21, 2009 8:10 AM To: MapGuide Users Mail List Subject: RE: [mapguide-users] Two maps in the same layout Many people have their page in a frameset. Here is an example which has two frames, 1 for a title.html page and 1 for the mapguide viewer. Here is an example of what your frameset page might look like (in VB.NET) ** %@ Page Language=VB Debug=true % %@ Import Namespace=OSGeo.MapGuide % !-- #Include File=UtilityFunctions.aspx -- !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; script runat=server Private webLayout As String = Library://MGA/Layout/MGA Web Layout.WebLayout Private defaultUser As String = Anonymous Private defaultPassword As String = Private SessionId As String = Private addRequests As String = Private Parameters As String = /script %