[OpenLayers-Users] maxresolution and minresolution does not work as expected

maven apache apachemaven0 at gmail.com
Mon Jun 17 18:29:22 PDT 2013


@Phil:

I read the `getURL` method of the `WMTS`.

It seems that this method will return the wmts request url according to the
current tile bounds.

Then my first thought is override this method, and caculate the urls
accordingly.

But then I found that will cause some problems.

I am not sure if you remember my last post "wmts layer with different
server provider":

*We have a large scope of map data which are published by wmts. But they
> are deployed at the different server, Each server hold a part of the data.
> And we use the bbox to define the extent of the provided data.
>
> For example,
>
> 0,0,20,20 ==> http://server1/wmts.. (this means data inside the bbox of
> (0,0,20,20) should request the data from server1.
> *

*20,20,40,40 ==> http://server2/wmtsservice...*

And finally I decided to create each layer for a server and make them
> overlayed.


 Now, if I override the method `getURL` of `WMTS`, then I just need to
create one WMTS layer. However it have a potentialproblem:

  As I have said, each wmts server have a extent, let's take it as a
bounds.  Then two wmts server will have to bounds: bounda and boundb.

  Now if I add one wmts layer, the I tried to caculate the url of one tile
according to its tileBound,then how about if this tileBound cover across
both bounda and boundb? In this case, I can only choose one server to
requset.


 That's why I tried to create layer one for each server.

  Since the WMTS is out of our control, and is deployed in an local
network. So in this post, I use the OSM instead of wmts, and use the sub
domain to imitate different* *wmts servers.


And during my test, I found that it seems that the min/max resolution does
not work as expected. For example:

layera(minzoom=0,maxzoom=3) request data from `a.tile`
layerb(minzoom=4,maxzoom=5) request data from `b.tile`
layerc(minzoom=6,maxzoom=7) request data from `c.tile`


Now when map is zoomed to 3, layera is activated.

When map is zoomed to 5, layerb is actiaated, but layera is not deactivated.

when map is zoomed to 7, layerc is activated, and layerb is deactivated but
layera is still not deactivated.

Then I found that because layera is the first layer added to the map , so
it is set to be as the baselayer. And even this layer is outof range, it is
still activated. Any idea to fix it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130618/5aaf800b/attachment-0001.html>


More information about the Users mailing list