[OpenLayers-Users] Bing zoom levels in 2.11

Andreas Hocevar ahocevar at opengeo.org
Fri Jun 3 14:19:18 EDT 2011


This required some deep digging, but what I came up with is very
pleasing. See http://trac.osgeo.org/openlayers/ticket/3338 again. With
this patch applied (and to be safe, also the one for
http://trac.osgeo.org/openlayers/ticket/3342), you can configure a
subset of zoom levels just by setting maxResolution and numZoomLevels,
e.g.

var road = new OpenLayers.Layer.Bing({
    key: apiKey,
    type: "Road",
    maxResolution: 76.43702827453613,
    numZoomLevels: 3
});

Please test and report back if this works for you or if you're seeing
any issues.

Andreas.

On Fri, Jun 3, 2011 at 1:52 AM, Andy Harrison <andyh at alh.me.uk> wrote:
> On 02/06/2011 22:49, Andreas Hocevar wrote:
>>
>> Hey,
>>
>> looking again, and playing with the bing-tiles-restrictedzoom.html
>> example from my patch, I don't see any issues with restrictedMinZoom.
>> What exactly makes you think that this is a solution inferior to
>> minZoomLevel?
>
> It's probably because I'm using the PanZoomBar control. restrictedMinZoom is
> having an inconsistent effect on the zoom slider. The slider doesn't always
> stop at restrictedMinZoom and you still have the additional levels showing
> on the slider that you cannot access. I'd like to be able to make the switch
> between google and bing seamless. In the old VirtualEarth layers I could
> achieve that. I'm just trying to recreate what I already have, but make it
> smoother and faster with the new features.
>
> Does it make sense to have a numZoomLevels parameter without minZoomLevel?
> To me it makes sense to be able to restrict zooms to a range and have the
> zoom slider show only that range. The slider is not responding well to the
> restrictedMinZoom parameter. I can drag the slider below the
> restrictedMinZoom. I think that might confuse people using the map. I have
> no need for the first six zooms, don't want to show those levels, but I do
> need detail, right down to zoom 21. The slider is rather large with all 21
> zooms.
>
> Maybe I'm being pedantic :-) Maybe I will just hide the slider.
>
> andy
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list