Can anyone help me figure out how to generate XYZ tiles with MapSuite beyond zoom level 20.
I’m overlaying a vector layer in an OpenLayers 3 client that allows zooming in very close - level 25 to 30. The vectors are being overlaid on hi-resolution geotagged photographs of plants, hence the need to zoom so far in.
Tiles are generated fine between zoom levels 0 - 19, but breaks whenever it hits zoom level 20 or above. The following webAPI method throws an index out of bounds exception trying to get the boundingBox on the following line (when z >= 20):
RectangleShape boundingBox = WebApiExtentHelper.GetBoundingBoxForXyz(x, y, z, GeographyUnit.Meter);
The code is pretty much taken directly from the ‘Draw and Edit Features’ webAPI demo:
[Route(
"{z}/{x}/{y}/{accessId}"
)]
public
HttpResponseMessage GetTile(
int
z,
int
x,
int
y,
string
accessId)
{
// Create the layerOverlay for displaying the map.
LayerOverlay layerOverlay =
new
LayerOverlay();
// Get the featureLayer including all drawn shapes by the access id for display.
InMemoryFeatureLayer drawnShapesFeatureLayer = GetDrawnShapesFeatureLayer(accessId);
if
(drawnShapesFeatureLayer !=
null
&& drawnShapesFeatureLayer.InternalFeatures.Count > 0)
{
layerOverlay.Layers.Add(drawnShapesFeatureLayer);
}
// Draw the map and return the image back to client in an HttpResponseMessage.
using
(Bitmap bitmap =
new
Bitmap(256, 256))
{
GdiPlusGeoCanvas geoCanvas =
new
GdiPlusGeoCanvas();
RectangleShape boundingBox = WebApiExtentHelper.GetBoundingBoxForXyz(x, y, z, GeographyUnit.Meter);
geoCanvas.BeginDrawing(bitmap, boundingBox, GeographyUnit.Meter);
layerOverlay.Draw(geoCanvas);
geoCanvas.EndDrawing();
MemoryStream memoryStream =
new
MemoryStream();
bitmap.Save(memoryStream, ImageFormat.Png);
HttpResponseMessage responseMessage =
new
HttpResponseMessage(HttpStatusCode.OK);
responseMessage.Content =
new
ByteArrayContent(memoryStream.ToArray());
responseMessage.Content.Headers.ContentType =
new
MediaTypeHeaderValue(
“image/png”
);
return
responseMessage;
}
}
The doc’s for WebApiExtentHelper.GetBoundingBoxForXyz don’t offer much insight. There are a few overloads, but it’s not clear how to use them.
Does anyone know how to solve or get the boundingBox some other way?
Thanks in advance.