MapGuide Open Source 2.6 RC1 available

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

MapGuide Open Source 2.6 RC1 available

Jackie Ng
We are pleased to announce that the MapGuide Open Source project team has made MapGuide Open Source 2.6 RC1 available

RC1 also includes the recently released security fix for Fusion

Documentation: Updated Developer's Guide, API reference documentation and sample code are now included with the installer. The release notes contain information on API changes for MapGuide 2.6

If you find a defect, please report it using http://trac.osgeo.org/mapguide

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: MapGuide Open Source 2.6 RC1 available

Jackie Ng
I got word that the linux install scripts have a bad download URL. I've uploaded fixed versions of these scripts.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: MapGuide Open Source 2.6 RC1 available

carls
In reply to this post by Jackie Ng
Thanks very much!

Does MG2.6 support display of GeometryCollection? I tested with MG2.5, which doesn't support GeometryCollection.

MSSQLServer 2008+ and some other databse support the storing of GeometryCollection data. I hope MG could support as well.

Thanks again!
Reply | Threaded
Open this post in threaded view
|

Re: MapGuide Open Source 2.6 RC1 available

Jackie Ng
Does a ticket exist for this issue? If there isn't, there is no opportunity to have this fixed.

- Jackie
Reply | Threaded
Open this post in threaded view
|

set filter on layer at runtime make selection tools not work

FrancoC
Hi all,
following the samples in Maestro SDK (ModifyParcelsFilter.cs), I'm setting a
filter on a layer at runtime.
The filter works and the features become filtered, but then when I try to
select the features on the filtered layer I got this error:

http://prntscr.com/3ycbja

"Internal server error" in GetSelectionProperties.php

This is what I do:
before the app starts I create "Session:" objects (layer, map &
FlexibleLayout)

------------------- startup    -----------------------
string cnfg = ConfigurationManager.AppSettings["mgwebinipath"].ToString();
MapGuideApi.MgInitializeWebTier(cnfg);
MgUserInformation userInfo = new MgUserInformation("theuser",
"thepassword");
MgSite site = new MgSite();
site.Open(userInfo);
var sessionId = site.CreateSession();

string agent = "http://localhost/mapguide/mapagent/mapagent.fcgi";

IServerConnection conn = ConnectionProviderRegistry.CreateConnection(
        "Maestro.Http",
        "Url", agent,
        "SessionId", sessionId.ToString());

var layoutMio = "Library://Demo/Layouts/L1.ApplicationDefinition";
var layerVerticale = "Library://Demo/Layers/Verticale.LayerDefinition";
var mappaMia = "Library://Demo/Mappe/MappaDemo.MapDefinition";
var featureClass = "Default:vimpianti";
var wrkmappa = mappaMia;
if (conn.ResourceService.ResourceExists(wrkmappa))
{
        // create a Session: Layer
        ILayerDefinition layerFiltrato =
(ILayerDefinition)conn.ResourceService.GetResource(layerVerticale);
        IVectorLayerDefinition vl =
(IVectorLayerDefinition)layerFiltrato.SubLayer;
        vl.FeatureName = featureClass;
        string ldfId = "Session:" + sessionId +
"//VerticaleRuntime.LayerDefinition";
        conn.ResourceService.SaveResourceAs(layerFiltrato, ldfId);


        // create a Session: Map
        MapDefinition rtmap =
(MapDefinition)conn.ResourceService.GetResource(mappaMia);
        IMapLayer layerold = rtmap.GetLayerByName("Verticale");
        rtmap.AddLayer(layerold, "", "VerticaleFiltrato", ldfId);
        rtmap.MapLayer.RemoveAt(2);
        string MapId = "Session:" + sessionId +
"//MappaRunTime.MapDefinition";

        rtmap.Name = "MappaF";
        conn.ResourceService.SaveResourceAs(rtmap, MapId);


        // create the Session Flexible Layout
        ApplicationDefinitionType layoutRes =
(ApplicationDefinitionType)conn.ResourceService.GetResource(layoutMio);
        layoutRes.MapSet[0].Map[0].Extension.Any[0].InnerText = MapId;
        layoutRes.MapSet[0].Map[0].Extension.Any[0].InnerXml = MapId;
        string resId = "Session:" + sessionId +
"//SessionLayout.ApplicationDefinition";
        conn.ResourceService.SaveResourceAs(layoutRes, resId);

        // go to the application page
        Response.Redirect("/cartografia.aspx?ApplicationDefinition=" + resId
+ "&SESSION=" + sessionId);
}
------------------- end of startup    -----------------------


To set the filter at runtime (in the Task pane):


string agent = "http://localhost/mapguide/mapagent/mapagent.fcgi";
string cnfg = ConfigurationManager.AppSettings["mgwebinipath"].ToString();
var session = Request.Params["SESSION"];
var mapName = Request.Params["MAPNAME"];

IServerConnection conn = ConnectionProviderRegistry.CreateConnection(
        "Maestro.Http",
        "Url", agent,
        "SessionId", session);

IMappingService mpSvc =
(IMappingService)conn.GetService((int)ServiceType.Mapping);
string rtMapId = "Session:" + conn.SessionID + "//" + mapName + ".Map";

RuntimeMap rtMap = mpSvc.OpenMap(rtMapId);
int layerIndex = rtMap.Layers.IndexOf("VerticaleFiltrato");
RuntimeMapLayer layer = rtMap.Layers[layerIndex];

ILayerDefinition ldf =
(ILayerDefinition)conn.ResourceService.GetResource(layer.LayerDefinitionID);
IVectorLayerDefinition vl = (IVectorLayerDefinition)ldf.SubLayer;

if (string.IsNullOrEmpty(vl.Filter))
        vl.Filter = "rid = 10265";
else
        vl.Filter = "";

string ldfId = "Session:" + conn.SessionID +
"//VerticaleFiltered.LayerDefinition";
conn.ResourceService.SaveResourceAs(ldf, ldfId);

ldf.ResourceID = ldfId;

RuntimeMapLayer replace = mpSvc.CreateMapLayer(rtMap, ldf);
replace.ExpandInLegend = layer.ExpandInLegend;
replace.Group = layer.Group;
replace.LegendLabel = layer.LegendLabel;
replace.Name = layer.Name;
replace.Selectable = layer.Selectable;
replace.ShowInLegend = layer.ShowInLegend;
replace.Visible = layer.Visible;

rtMap.Layers.RemoveAt(layerIndex);
rtMap.Layers.Insert(layerIndex, replace);
replace.ForceRefresh();

rtMap.Save();


Selecting features on other layers give no error, so I suppose the problem
is in the runtime filtered layer, but don't know what I'm doing wrong here

Thanks for your help,

Franco


_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: set filter on layer at runtime make selection tools not work

Jackie Ng
What does the raw response body of that failed GetSelectionProperties.php call look like?

- Jackie
Reply | Threaded
Open this post in threaded view
|

R: set filter on layer at runtime make selection tools not work

FrancoC
I see:

PHP Notice:  Undefined index: 3bdd5c9c-48e5-4a00-8bab-1698549c8c12 in
D:\franco\MG\OSGeo\Mapguide\Web\www\fusion\layers\MapGuide\php\Utilities.php
on line 792

Using RtMapInspector.exe I see that "3bdd5c9c-48e5-4a00-8bab-1698549c8c12"
is the ObjectID of the filtered layer created at runtime



> -----Messaggio originale-----
> Da: [hidden email] [mailto:mapguide-users-
> [hidden email]] Per conto di Jackie Ng
> Inviato: martedì 1 luglio 2014 18:15
> A: [hidden email]
> Oggetto: Re: [mapguide-users] set filter on layer at runtime make
> selection tools not work
>
> What does the raw response body of that failed
> GetSelectionProperties.php call look like?
>
> - Jackie
>
>
>
> --
> View this message in context: http://osgeo-
> org.1560.x6.nabble.com/MapGuide-Open-Source-2-6-RC1-available-
> tp5148135p5149047.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
> _______________________________________________
> mapguide-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-users


_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: R: set filter on layer at runtime make selection tools not work

Jackie Ng
Have you triggered a viewer refresh from the Fusion side so that it knows about the new layer?

You can look at the buffer widget for an example of how that's done.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: R: set filter on layer at runtime make selection tools not work

FrancoC
Thanks Jackie, that solved!
In the page that set the filter I call (after saved the runtime map):


if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(),
"setfilterrefresh"))
        Page.ClientScript.RegisterStartupScript(this.GetType(),
"setfilterrefresh", "top.reloadmappa();", true);


And on the "main" page I create a routine:


function reloadmappa() {
        var mapWidget = Fusion.getWidgetById('Map');
        if (mapWidget && mapWidget.isMapLoaded()) {
                mapWidget.reloadMap();
                mapWidget.redraw();
        }
}

Doing this the widgets work

Franco


> -----Messaggio originale-----
> Da: [hidden email] [mailto:mapguide-users-
> [hidden email]] Per conto di Jackie Ng
> Inviato: martedì 1 luglio 2014 18:55
> A: [hidden email]
> Oggetto: Re: [mapguide-users] R: set filter on layer at runtime make
> selection tools not work
>
> Have you triggered a viewer refresh from the Fusion side so that it
> knows about the new layer?
>
> You can look at the buffer widget for an example of how that's done.
>
> - Jackie




_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users