Unfortunately SourceForge dropps the E-Mail support for all project websites on June 26, 2017 (which includes this forum).

E-Mail is required for registration, password-reset and notifications - therefore after this date the creation of new accounts will no longer be possible.

Multilayer mapsource with different zoom levels for each layer?

For discussions, questions and problems that arise when developing new map sources for MOBAC
borealis2009
Posts: 30
Joined: 19 Oct 2012, 09:53

Multilayer mapsource with different zoom levels for each layer?

Postby borealis2009 » 31 Jan 2017, 19:59

Hi!

Is it possible to create a multilayer mapsource using different WMS mapsources for different zoom level ranges, like in this schematic sample?

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customMultiLayerMapSource>
<name>Name</name>
<tileType>png</tileType>
<layersAlpha></layersAlpha>
<layers>
<customWmsMapSource>
  .....
  <minZoom>7</minZoom>
  <maxZoom>10</maxZoom>
  .....
  <layers>layer_1</layers>
  .....
</customWmsMapSource>
<customWmsMapSource>
  .....
  <minZoom>11</minZoom>
  <maxZoom>12</maxZoom>
  .....
  <layers>layer_2</layers>
  .....
</customWmsMapSource>
<customWmsMapSource>
  .....
  <minZoom>12</minZoom>
  <maxZoom>13</maxZoom>
  .....
  <layers>layer_3</layers>
  .....
</customWmsMapSource>
</layers>
</customMultiLayerMapSource>

Any help would be appreciated, thanks in advance.
borealis2009

r_x
Site Admin
Posts: 668
Joined: 25 Jun 2011, 14:00

Re: Multilayer mapsource with different zoom levels for each layer?

Postby r_x » 01 Feb 2017, 20:31

If I understand your sample correctly you want to combine different maps for different zoom levels. The customMultiLayerMapSource requires all maps to be available in all zoom levels. Also it calculates minimum and maximum zoom based on the intersection of supported zoom levels among all used map sources. In your case there is no intersection...

Currently it is not possible to combine maps this way using custom XML map sources.
You can achieve what you want by writing a BeanShell map source (BSH) however you would have to do the WMS conversion on your own or use Tools.xTileToLon(..) and Tools.yTileToLat(..) (see Help dialog in MOBAC MapEvaluator).
Please read the MOBAC FAQ and MOBAC README before posting.

borealis2009
Posts: 30
Joined: 19 Oct 2012, 09:53

Re: Multilayer mapsource with different zoom levels for each layer?

Postby borealis2009 » 02 Feb 2017, 11:02

r_x wrote:If I understand your sample correctly you want to combine different maps for different zoom levels. The customMultiLayerMapSource requires all maps to be available in all zoom levels.
In this case all layers are from the same WMS source. The point is that all layers are available and displayed at all zoom levels, despite their native resolution not matching the zoom level. So MOBAC always renders all layers regardless of the chosen zoom level.

r_x wrote:Currently it is not possible to combine maps this way using custom XML map sources.
That would be a nice new feature. ;)

r_x wrote:You can achieve what you want by writing a BeanShell map source (BSH).
Seems I can't avoid that. I had to do that a while ago to access a map source that changed the tile scheme at a certain zoom level.
borealis2009


Return to “Map Source Development (English)”



Who is online

Users browsing this forum: No registered users and 1 guest