ThinkGeo.com    |     Documentation    |     Premium Support

Error when serializing map that uses WorldStreetsLineStyles

Hi,

I came across an error when I tried to serialize a map that has a layer using WorldStreetsLineStyles.

Here is the code to apply the style:

private void ApplyRoadsStyle(FeatureLayer roadLayer)
{

        ValueStyle roadStyles = new ValueStyle();
        roadStyles.ColumnName = RoadsTypeAttribute;
        roadStyles.ValueItems.Add(new ValueItem(RoadsType.Main.ToString(), WorldStreetsLineStyles.RoadOutline(10)));
        roadStyles.ValueItems.Add(new ValueItem(RoadsType.Local.ToString(), WorldStreetsLineStyles.MinorRoadOutline(6)));
        //roadStyles.ValueItems.Add(new ValueItem(RoadsType.Main.ToString(), ThinkGeo.MapSuite.Styles.LineStyles.MajorRoad1));
        //roadStyles.ValueItems.Add(new ValueItem(RoadsType.Local.ToString(), ThinkGeo.MapSuite.Styles.LineStyles.LocalRoad1));

        roadLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(roadStyles);

        roadLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
    }

Here is the error that I received:
System.Exception: Error while saving project : Invalid name character in ‘8Rs=’. The ‘8’ character, hexadecimal value 0x38, cannot be included in a name. —> System.ArgumentException: Invalid name character in ‘8Rs=’. The ‘8’ character, hexadecimal value 0x38, cannot be included in a name.
at System.Xml.XmlWellFormedWriter.CheckNCName(String ncname)
at System.Xml.XmlWellFormedWriter.WriteStartElement(String prefix, String localName, String ns)
at System.Xml.XmlWriter.WriteElementString(String localName, String ns, String value)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.eSQ=(GeoObjectNode node, XmlWriter xmlWriter)
at ThinkGeo.MapSuite.Serialize.XmlGeoSerializationFormatter.SaveCore(GeoObjectModel model, Stream stream)
at ThinkGeo.MapSuite.Serialize.GeoSerializer.Serialize(Object objectToSerialize, Stream targetStream)

Hi Yohan,

Thanks for your report, please download the https://www.nuget.org/packages/ThinkGeo.MapSuite/11.0.0-beta073 when it get valid in NuGet and try it.

Please let us know whether it solved your problem.

Regards,

Ethan

Hi Ethan,

Thanks, the latest version solved the problem

Hi Yohan,

I am glad to hear that’s solved.

Regards,

Ethan