Resources for developers using the Envitia MapLink Pro mapping SDK.
Introduced in MapLink Pro 11.2.1.
Wrap-around maps provide the capability to pan the map continuously eastwards or westwards and display a seamless map across the International Dateline.
So that data layer draw orders are unaffected, the main wrapping code changes are implemented at the Data Layer. The data layer draws the “main tile”, followed by “wrap tiles” either side of the main tile:
When drawing a wrap tile, MapLink creates the draw extent for the wrap tile, along with a query extent which is the normalised equivalent of the draw extent. This means that the query extent will intersect the existing data model, allowing the correct data and features to be selected and drawn into the wrap tile.
To enable wrap-around mode, all you need to do is tell the drawing surface to wrap longitudinally.
C++:
drawingSurface.wrapAroundMode(TSLDrawingSurface::WrapAroundLongitudinal);
.NET:
drawingSurface.wrapAroundMode(TSLN2DDrawingSurface.WrapAroundMode.WrapAroundLongitudinal);
Each data layer implements its own wrapping, so draw orders and all other layer functionality should work the same regardless of whether the drawing surface has wrap-around enabled or not.
If your application implements a custom data layer, you will need to make a small change in order to support wrap-around mode. You will need to implement a new overload of drawLayer in both TSLClientCustomDataLayer and TSLCustomDataLayerHandler, that takes two envelope arguments:
queryExtent is the normalised equivalent of drawExtent, so queryExtent should always intersect with the data model even when drawing wrap tiles, while drawExtent might not.
So, to find features, raster tiles and data to display, use queryExtent to query your data model. Use drawExtent to draw the features. The core MapLink code will shift the features, tiles and data into the draw extent for you.
As maps are now being drawn the maps over a potentially larger area of the drawing surface when zoomed out, there is an increased potential for the maths used in TMC coordinates to overflow. When MapLink detects this, it stops drawing tiles so that your application will not crash which results in the map containing blank tiles temporarily.
To mitigate this if you experience the issue, it is recommended to reduce the TMC Per Map Unit setting in MapLink Studio for each map you will use in wrap-around mode.