FeatureSet not handled the same in HTML 5 view vs Silverlight viewer
Hello,
We have a CodeActivity within a workflow that generates a dynamic FeatureSet.
Here is the code:
protected override void Execute(CodeActivityContext context)
{
try
{
string nomLieu = context.GetValue(this.NomLieu);
string url = string.Format(UrlTemplate, nomLieu);
WebRequest webRequest = WebRequest.Create(url);
WebResponse webResponse = webRequest.GetResponse();
XmlSerializer xmlSerializer = new XmlSerializer(typeof(toponymes));
toponymes resultats = (toponymes)xmlSerializer.Deserialize(webResponse.GetResponseStream());
List<Graphic> graphics = new List<Graphic>();
SpatialReference spatialReference = new SpatialReference(4326);
foreach (toponymesToponyme resultat in resultats.toponyme.AsEnumerable())
{
Graphic graphic = new Graphic();
string nomComplet = resultat.nom.specifique;
if (string.IsNullOrEmpty(nomComplet) == false)
{
nomComplet = resultat.nom.generique + " " + nomComplet;
}
graphic.Attributes.Add(new KeyValuePair<string, object>("Nom", nomComplet));
graphic.Attributes.Add(new KeyValuePair<string, object>("Nom Entite", resultat.nom.entite));
graphic.Attributes.Add(new KeyValuePair<string, object>("Nom Générique", resultat.nom.generique));
graphic.Attributes.Add(new KeyValuePair<string, object>("Nom Spécifique", resultat.nom.specifique));
graphic.Attributes.Add(new KeyValuePair<string, object>("Région Administrative", resultat.localisation.region_administrative));
graphic.Attributes.Add(new KeyValuePair<string, object>("MRC", resultat.localisation.mrc));
graphic.Attributes.Add(new KeyValuePair<string, object>("Municipalité", resultat.localisation.municipalite));
graphic.Attributes.Add(new KeyValuePair<string, object>("Longitude", resultat.localisation.coordonnees.longitude_affichee));
graphic.Attributes.Add(new KeyValuePair<string, object>("Latitude", resultat.localisation.coordonnees.longitude_affichee));
graphic.Attributes.Add(new KeyValuePair<string, object>("Feuillet", resultat.localisation.feuillet));
graphic.Attributes.Add(new KeyValuePair<string, object>("Toponyme ID", resultat.id));
Geometry geometry = new MapPoint(Convert.ToDouble(resultat.localisation.coordonnees.longitude), Convert.ToDouble(resultat.localisation.coordonnees.latitude), spatialReference);
graphic.Geometry = geometry;
graphics.Add(graphic);
}
FeatureSet featureSet = new FeatureSet(graphics);
context.SetValue(this.Resultat, featureSet);
}
catch (Exception exception)
{
throw new InvalidOperationException(exception.Message + "==>" + exception.StackTrace);
}
}
We used the Graphics object to create a dynamic FeatureSet. Hence, that feature set does not have values in the .Fields or .FieldAliase, Its a plain FeatureSet. (better way to do this???)
Thus a valid object, we send that object to the SelectFeature code activity, to display it in the viewer application.
Knowing the data is dynamic, the Layer Id and Map Service Id properties of the SelectFeature code activity are blank. So, the viewer does not have a reference to a Feature Description or a Feature Long Description to know how to render the information on the client side.
That is where we have a different behavior between the Silverlight and HTML 5 viewer.
In Silverlight, the viewer detects it has no knowledge on how to render the simple list view, and decides to use the first field in the FeatureSet to render the view.
In HTML 5 the viewer does not use the first field in the FeatureSet to render the view, all we get a the Earth icon, and nothing next to it. Just blank. Big bupkis.
Is there anything we can do to tell the browser how to render the list view of dynamic FeatureSet data ?
Can the HTML 5 viewer be fixed so that it has the same behavior as the Silverlight viewer?
Note here, when switching to the table view, both Silverlight and HTML view display all the fields contained in the dynamic FeatureSet.
So, its a bug in the HTML 5 viewer in the sense that, it does not have the same behavior as the Silverlight viewer.
Any help as to how we can either configure the list view dynamicaly or go around that but would be appreciated.
Thank you.
Jeff
-
Well,
I'll take a second a reply to myself.
This issue was resolved in the version 1.3.1 of the HTML viewer.
Now, both viewer, that is Silverlight and HTML 5, behaves the same. On dynamic data display, theyr will take the first field and display on the left result pane.
Jeff
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar