Create Tile Layers


  • I show more than 5000 polylines on a Bing Map (Silverlight - C#). I want to us Tile layers. How can I create this layers from my current polylines?



    Monday, January 23, 2012 2:47 PM


All replies

  • You will need to create the tile layers on the server side. Here are two good places to start:
    Monday, January 23, 2012 3:11 PM
  • Thanks. When I open your first suggestion in VS2010 (And SQL server 2008R2 on same machine) and run, I get folllowing error when I check a radio button;

    System.Data.SqlClient.SqlException was unhandled by user code
      Message=A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry":
    System.FormatException: 24141: A number is expected at position 25 of the input. The input has ,.
       bij Microsoft.SqlServer.Types.OpenGisWktReader.RecognizeDouble()
       bij Microsoft.SqlServer.Types.OpenGisWktReader.ParseLineStringText()
       bij Microsoft.SqlServer.Types.OpenGisWktReader.ParsePolygonText()
       bij Microsoft.SqlServer.Types.OpenGisWktReader.ParseTaggedText(OpenGisType type)
       bij Microsoft.SqlServer.Types.OpenGisWktReader.Read(OpenGisType type, Int32 srid)
       bij Microsoft.SqlServer.Types.SqlGeometry.GeometryFromText(OpenGisType type, SqlChars text, Int32 srid)
      Source=.Net SqlClient Data Provider

    • Edited by nijs9 Monday, January 23, 2012 8:39 PM
    Monday, January 23, 2012 6:31 PM
  • Ensure that the database is properly deployed and that the connection string has been updated in the application. Also ensure that there are no missing dll's.
    Tuesday, January 24, 2012 9:41 AM
  • Connection string is updated, database is succesfully deployed, and there are no missing dll's. (I think otherwise the application do not start up). Is it possible there is a problem with my locat setting? I'm from Belgium...
    Tuesday, January 24, 2012 9:53 AM
  • When I run the project at I get the same error...

    Is it possible it don't work in .NET FRAMEWORK 4, or VS 2010?

    Tuesday, January 24, 2012 12:01 PM
  • It runs! The problem was my local settings...

    This program is fantastic. Is there a way to support linestrings? In this configuration only polygons are supported...

    Tuesday, January 24, 2012 1:07 PM
  • Linestrings should be supported. They work in the demo app.
    Tuesday, January 24, 2012 6:38 PM
  • I don't think so... Only polygons and multipolygons work. For example in TilerenderEngine.cs you can see there is no support for polylines:


    case Constants.ShapeType.Polygon:
                            Polygon polygon = shapes[i].SimpleBoundary;
                            points = GeospatialTools.CoordinateArrayToRelativePointFArray(polygon.ExteriorRing, _topLeftPixel, zoomMapWidth);
                            gr.FillPolygon(shapes[i].FillColor, points);
                        case Constants.ShapeType.Multipolygon:
                            MultiPolygon multiPolygon = shapes[i].ComplexBoundary;
                            for (int j = 0; j < multiPolygon.Count; j++)
                                points = GeospatialTools.CoordinateArrayToRelativePointFArray(multiPolygon[j].ExteriorRing, _topLeftPixel, zoomMapWidth);
                                gr.FillPolygon(shapes[i].FillColor, points);
                        //Do not render Points, MultiPoints, Polylines, Multilines or shapes with a null type for this demo
                        case Constants.ShapeType.Point:
                        case Constants.ShapeType.Multipoint:
                        case Constants.ShapeType.Polyline:

    Thursday, January 26, 2012 6:41 PM
  • I've updated the code sample to support linestring and multilinestring.
    Thursday, January 26, 2012 9:22 PM
  • Here is a simple Bing map dynamic layer module

    • Edited by gissc Thursday, April 05, 2012 1:48 PM
    Thursday, February 23, 2012 9:24 PM