[Geoserver-users] Geoserver with Mapbuilder

Hi,

I am using Geoserver with Mapbuilder. How can I change the size of the map displayed? It appears with a predefined size and I have no idea how to change it.

In the source code the tag that displays the map is:

Thanks,

Daniel

Daniel,

In the html page (the one with the <td> tag you copied below) there is a reference to a config.xml file. Take a look inside that config.xml file.

Inside that config.xml file are a couple of lines that look like this (probably right near the top):

...
<Context id="mainMap">
   <defaultModelUrl>***SOME XML FILE HERE***</defaultModelUrl>
...

Open the reference xml file (the one that I called "***SOME XML FILE HERE***) and change the lines:

<Window width="570" height="435"/>

To whatever size you like.

Be warned, geoserver *will* stretch the map on the initial load...so if you don't want a "weird" looking map when you start, you'll need to make sure that the width-to-height ratio (from the <Window> tag) and the extent-width-to-extent-height (from the <BoundingBox> tag immediately after the <Window> tag) are exactly the same.

One easy way to do that is to just scale the window size up linearly.

For example:

570x435 = width-to-height ratio of appx 1.31

600x458 = width-to-height ratio of appx 1.31

450x344 = width-to-height ratio of appx 1.31

etc. etc.

--saul

Daniel Ferreira wrote:

Hi,

I am using Geoserver with Mapbuilder. How can I change the size of the map displayed? It appears with a predefined size and I have no idea how to change it.

In the source code the tag that displays the map is:

<td colspan="2" id="mainMapPane" style="background-color: white;" />

Thanks,

Daniel