This project is read-only.

Request: Can I get LESS Detail?

Feb 3, 2009 at 9:06 PM
For some applications it is great that DeepEarth provides such great detail. But for other applications, more detail is just more clutter as it distracts from what I want to display on the map.

So when I display the USA at level 5 (map.SetViewCenter(new Point(-95.5, 40.5), 5);) I first see tiles with a blurry image, then I see tiles that show the states clearly but with little detail, and finally I see tiles with lots of detail. In my application I'd like to NOT get the third kind of tiles, primarily because in my case less is more and also (a bit) because it's faster.

Does that make sense?
Feb 3, 2009 at 10:53 PM

The following pattern should also work for the other tile sources, just adjust the constructors as needed.

public class ZoomLimitedVeTileSource : VeTileSource
{
    public ZoomLimitedVeTileSource(): base() {}
    public ZoomLimitedVeTileSource(VeMapModes mode) : base(mode) { }
    public ZoomLimitedVeTileSource(int? zoomLimit) : base()
    {
        this.ZoomLimit = zoomLimit;
    }
    public ZoomLimitedVeTileSource(int? zoomLimit, VeMapModes mode) : base(mode)
    {
        this.ZoomLimit = zoomLimit;
    }

    public int? ZoomLimit { get; set; }
    public override Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY)
    {
        if (!ZoomLimit.HasValue || TileToZoom(tileLevel) <= ZoomLimit.Value)
        {
            return base.GetTile(tileLevel, tilePositionX, tilePositionY);
        }
        else
        {
            return null;
        }
    }
}

Feb 4, 2009 at 3:49 AM
Indeed, with

map.BaseLayer.Source =

new ZoomLimitedVeTileSource(4, VeMapModes.VeRoad);

 

I get exactly what I want. Great!

Thank you!

(I'll need to figure out how to adjust the ZoomLimit dynamically while the user is browsing, but that's for another day.)
Feb 4, 2009 at 4:20 AM
Can you not achive the same result as above with this?

//Choose your startup provider
map.BaseLayer.Source = new VeTileSource(VeMapModes.VeHybrid) { MinZoomLevel = 5 };
Feb 4, 2009 at 4:32 AM
MinZoomLevel stops the map itself from zooming, the scroll wheel just stops working after you hit the limit. This code stops providing new tiles after you hit the ZoomLimit but still lets you keep zooming into the tiles that were already provided.

As for changing the ZoomLimit dynamically, either keep a reference to the ZoomLimitedVeTileSource or cast the map.BaseLayer.Source back to a ZoomLimitedVeTileSource. The ZoomLimit is a public property so you can change it at any time.
Feb 4, 2009 at 4:48 AM
OK thanks, I understand what you want to achive now