Ticket T309724
Visible to All Users

If Custom MapDataProvider with a custom tile size is used, tiny white lines appear around the tile at certain zoom levels

created 9 years ago

[DevExpress Support Team: CLONED FROM T302395: Custom MapDataProvider does not work correctly with custom tile size]
Hello!

We are using MapControl   for displaying raster and vector non-cartographical images. Our data has specific features:
 - We don't have an infinite map. Our image has finite sizes and it can be not square
 - Tiles can be not square

We have created a sample illustrating our questions (attachement). The sample works with 3 kinds ot input data:
  Input Data 1.  Tiles of size 256x256
  Input Data 2.  Tiles 100x100
 Input Data 3.  Tiles 70x70
All data has 2 levels of zoom (1,2).
Our real image that we have is of orange color . We fill emty space with white color while generating tiles to adjust tile sizes.

Here is the list of issues we'd like to clarify:

Issue3.  If the tile size is less than 256x256 (for example 100x100 - input data 2) some artifacts - white lines - appear between the tiles. Is there a way to avoid these artifacts?

Answers approved by DevExpress Support

created 9 years ago

With the provided sample project it is possible to replicate two kinds of artifacts:
1 - wide vertical lines on the right side of tiles. This issue is caused by an incorrect tile size. If the tile size less then the size specified in the provider, an empty white space will be shown.
2 - tiny lines around the tile that appear at certain zoom levels. This lines appears because our data rendering engine is optimized to display tiles whose size is a fraction of 2 (by default 256). At present, we do not want to change this functionality because it will likely cause performance issues for built in data providers. To resolve the issue, it is necessary to provide tiles which size increase the size specified in the provider by 1 pixel. So, if the tile size is 100x100 the tile size should be 101x101.
Please try this workaround and let us know your results.

    Show previous comments (1)
    DevExpress Support Team 9 years ago

      To convert the provided sample to version 15.1, do the following:

      1. In the LocalDataProvider class, replace the "IProjection Projection" property with a new "ProjectionBase Projection" property.
      2. In the LocalDataProvider class, define the BaseSizeInPixels property as shown below:
      C#
      protected override Size BaseSizeInPixels {     get { return new Size(_tileWidth * 2, _tileHeight * 2); } }
      1. On changing ImageTilesLayer in the map control, also define the MapControl.InitialMapSize Property.
      C#
      mapControl.InitialMapSize = new System.Drawing.Size(tileWidth * 2, tileHeight * 2);

      I have created a sample project that demonstrates this approach. You will find it in the attachment.

      DG DG
      Dmitry Gilyaev 9 years ago

        Thank you very much. This solution works.

        DevExpress Support Team 9 years ago

          You are welcome, Dmitry.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.