[OpenLayers-Users] Bing zoom levels in 2.11
Andreas Hocevar
ahocevar at opengeo.org
Wed Jun 1 17:59:28 EDT 2011
Nevermind. Ticket created, patch with tests and example attached:
http://trac.osgeo.org/openlayers/ticket/3338
Andreas.
On Wed, Jun 1, 2011 at 8:02 PM, Andreas Hocevar <ahocevar at opengeo.org> wrote:
> You're right. The values from the Bing metadata take precedence, so
> user provided restrictedMinZoom and numZoomLevels are ignored. Can you
> please create a ticket?
>
> Thanks,
> Andreas.
>
> On Wed, Jun 1, 2011 at 6:55 PM, Andy Harrison <andyh at alh.me.uk> wrote:
>> On 01/06/2011 16:24, Andreas Hocevar wrote:
>>>
>>> Hi,
>>>
>>> use restrictedMinZoom and numZoomLevels. The latter starts counting at
>>> zoom level 0, regardless of the restrictedMinZoom setting.
>>
>> Hi Andreas,
>>
>> I always get Bing layers with 21 zoom levels no matter what. I've stripped
>> down the "Basic Bing Tiles Example" and added these properties to the layer
>> but still no success. I can restrict Google layers, but a Bing layer always
>> gives 21 zoom levels. Maybe I missed something elementary, not sure? I
>> usually pass "numZoomLevels" and "minZoomLevel" into the map object but this
>> has had no effect either.
>>
>> Andy.
>>
>> // API key for http://openlayers.org. Please get your own at
>> // http://bingmapsportal.com/ and use that instead.
>> var apiKey =
>> "Ag4F_HsaaZKANsHgsJdOHk1o2yM_IoPZ8jX0cY5aYXADpGxZKuPN2DNL6At3SnEK";
>> var map = new OpenLayers.Map('map');
>> var road = new OpenLayers.Layer.Bing({
>> key: apiKey,
>> type: "Road",
>> numZoomLevels:14,
>> restrictedMinZoom:12,
>> metadataParams: {mapVersion: "v1"}
>> });
>>
>> map.addLayers([road]);
>> map.addControl(new OpenLayers.Control.LayerSwitcher());
>> map.setCenter(new OpenLayers.LonLat(-71.147, 42.472).transform(
>> new OpenLayers.Projection("EPSG:4326"),
>> map.getProjectionObject()
>> ),11);
>>
>> map.events.on({"zoomend":function(){
>> console.log(map.getZoom());
>> }});
>> _______________________________________________
>> 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.
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list