Analysis of the construction process of Silverlight map vector maps

Source: Internet
Author: User
Tags map vector silverlight

This paper mainly combines some characteristics of SQLSERVER2008 spatial database to explain some technical points of Silverlight in vector map drawing. The server side is responsible for providing data services, the client is responsible for drawing, of course, this process will encounter performance bottlenecks, but this article focuses on the map data Model transformation process, and Silverlight data binding and data model of the relationship between the understanding.

Server-side

Data Model layer:

1. Get the original data model

Gets the dataset from SQLSERVER2008, where the geometry data type geometry is mapped to the Sqlgeometry type in the. netclr, the type in the Assembly Microsoft.SqlServer.Types.dll The Microsoft.SqlServer.Types namespace (the assembly is taken from SQLSERVER2008).

2. Encapsulated into a serializable user data model: Geometryfeature class

Traversing the dataset, except for the Sqlgeometry type, the rest of the data is saved in a dictionary dictionary<string,object>, the key is the field name, and value is the values. The sqlgeometry data is converted to a byte[] type from the Stasbinary () function of the type.

 

Gometryfeature declares a known type of recognition that the Web service can use to specify serialization or deserialization.

Code

[DataContract(IsReference = true), ServiceKnownType(typeof (GeometryFeature))]
     public class GeometryFeature
     {
         public GeometryFeature()
         {
         }
         public GeometryFeature(byte[] bytes,  Dictionary<string,object> attributes)
         {
             this.BinaryGeometry = bytes;
             this.Attributes = attributes;
         }
         [DataMember]
         public Dictionary<string, object> Attributes
         {
             get;
             set;
         }
         [DataMember]
         public byte[] BinaryGeometry
         {
             get;
             set;
         }
     }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.