ThinkGeo.com    |     Documentation    |     Premium Support

Some changes in Zoom scale result in an "Image" zoom as opposed to full redraw

In our application we have found that smaller changes to zoom scale (less than zoom level steps) result in what appears to be just the image on the map being scaled up/down, and not a redraw.

This results in font sizes not matching the style set for the various level.

If we zoom out a bit, the 12 point fonts will look smaller. This is not what we need. If we zoom out to the next zoom level, the the redraw occurs, and we see the font in the expected size.

I have tried forcing a RefreshAsync after the zoom, but this now seems to block the zooms, and nothing changes scales.

Can you shed any light on the functionality as too zooming smallish amounts?

Hi Chris,

The MapView.ZoomScales is independent from a LayerOverlay ’s TileMatrixSet . For example, if your MapView.ZoomScales are [100, 110, 120, 130, 140, 150] , but your LayerOverlay.TileMatrixSet only has [100, 150] , then:

  • Zooming to 110 will actually render at 100 and scale the image up.
  • Zooming to 140 will snap to 150 , render, and then scale the image down.

This design gives you flexibility. The TileMatrixSet controls how the overlay renders and caches tiles. You can align it exactly with MapView.ZoomScales , but you don’t have to. Also, different TileOverlay can have different TileMatrixSet as well.

If you want labels to always render at their defined size, you can make the overlay.TileMatrixSet consistent with mapView.ZoomScales, but maybe a better option is to put them in a FeatureLayerWpfDrawingOverlay . This overlay renders directly on the canvas with hardware acceleration instead of through an image, so label sizes won’t be affected by intermediate zoom scaling. The rendering engine is different, so sizes may be slightly off, the panning performance would be lower as the features will be rendered on the fly, but anyway, it’s worth trying.

There’s a sample in HowDoI that shows points/lines/polygons/labels all in a FeatureLayerWpfDrawingOverlay (with the checkbox checked). In your case, you could keep the shapes in a LayerOverlay but only move the labels into the FeatureLayerWpfDrawingOverlay for better consistency and performance. (set layer.LabelDisplayMode to LabelsOnly or ShapesOnly)

Thanks,
Ben

Setting the DrawingLevel = DrawingLevel.LabelLevel in the TextStyle seems to have fixed this issue, the font is the same size on screen for all zooms, even those not on a ZoomLevel.

DrawingLevel.LabelLevel is higher than DrawingLevel1~4 , but it should not affect font size — only the drawing order. Could it be that some other changes fixed the issue? In any case, glad to hear it’s working now.

I suspect you are correct. I did make a change to the tiling to change it to single tile. I really suspect that is what fixed it.

That could be the reason, thanks for letting me know.