[Geoserver-users] Connecting with OpenLayers

Hey there Phil,

Yep, thanks for the advice on running the production server version of OL separately from the default install shipped with GeoServer...that's exactly what we're doing. We don't have trouble with finding the OL libraries in our external applications...that's all fine.

I probably wasn't clear earlier: the only thing I'm trying to do is get the GeoServer's OL preview to work.

As a GeoServer Admin, I simply want to use the Preview>OpenLayers option. That's where we get the error as our GeoServer is looking for the OL library at http://127.0.0.1/ etc

I manually scanned every xml config file I could find last night and still can't work out why GeoServer is trying to find the OL library via a localhost IP address.

Just to be clear:

1. Login to GeoServer as Admin

2. Go to Layer Preview, choose any layer (even the pre-installed examples)

3. Choose to Preview via OpenLayers

4. Get an error in the image display (ie, there is no map shown...the surrounding frame is shown)

5. Look at the page source or use Firebug>Console. Reported error is "undefined element openlayers"

6. Note that the preview page is trying to load OpenLayers javascript from 127.0.0.1

7. Be confused...ask for help!

Thanks again for your patience: can't wait to find out where I've gone wrong.

Kind regards,
JB

On 7/08/2014 11:15 AM, geoserver-users-request@lists.sourceforge.net wrote:
> The OL that comes with Geoserver is really just there to support Layer
> preview. It isnt used for anything else. For your own applications, you
> would point to your own version of OL on your application server (which
> would typically be a completely different server to the one geoserver is
> running on). In my opinion, you want your own version of OL, where you
> use the OL custom build tools to bring in only what you need and where
> you can patch as required.
--
John Brisbin
Managing Director, BoaB interactive Pty Ltd
POB 248, MT Molloy QLD 4871

E: john@anonymised.com
M: 0407 471 565 | P: 07 4094 2172
Skype: boabjohn | Twitter: @boabjohn

well a few experiments here suggest the OL preview is using the httprequest to generate the url in the preview.
eg.
if I log into my geoserver as maps/geoserver, then the OL link in the preview is

http://maps:80/geoserver/openlayers/OpenLayers.js

and if I log into geoserver as maps.mydomain.com/geoserver, then the source link is
http://maps.mydomain.com:80/geoserver/openlayers/OpenLayers.js

Is that a hint?

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.

That does sound odd? I am jumping into this conversation late - in order to ask you to check the base url setting, you need to use it when deploying GeoServer behind a proxy server.

http://docs.geoserver.org/latest/en/user/webadmin/server/globalsettings.html

That said, if the layer preview is not respecting this setting we have a bug to report.

···

Jody Garnett

On Wed, Aug 6, 2014 at 7:50 PM, John Brisbin <john@anonymised.com> wrote:

Hey there Phil,

Yep, thanks for the advice on running the production server version of
OL separately from the default install shipped with GeoServer…that’s
exactly what we’re doing. We don’t have trouble with finding the OL
libraries in our external applications…that’s all fine.

I probably wasn’t clear earlier: the only thing I’m trying to do is get
the GeoServer’s OL preview to work.

As a GeoServer Admin, I simply want to use the Preview>OpenLayers
option. That’s where we get the error as our GeoServer is looking for
the OL library at http://127.0.0.1/ etc

I manually scanned every xml config file I could find last night and
still can’t work out why GeoServer is trying to find the OL library via
a localhost IP address.

Just to be clear:

  1. Login to GeoServer as Admin

  2. Go to Layer Preview, choose any layer (even the pre-installed examples)

  3. Choose to Preview via OpenLayers

  4. Get an error in the image display (ie, there is no map shown…the
    surrounding frame is shown)

  5. Look at the page source or use Firebug>Console. Reported error is
    “undefined element openlayers”

  6. Note that the preview page is trying to load OpenLayers javascript
    from 127.0.0.1

  7. Be confused…ask for help!

Thanks again for your patience: can’t wait to find out where I’ve gone
wrong.

Kind regards,
JB

On 7/08/2014 11:15 AM, geoserver-users-request@lists.sourceforge.net wrote:

The OL that comes with Geoserver is really just there to support Layer
preview. It isnt used for anything else. For your own applications, you
would point to your own version of OL on your application server (which
would typically be a completely different server to the one geoserver is
running on). In my opinion, you want your own version of OL, where you
use the OL custom build tools to bring in only what you need and where
you can patch as required.


John Brisbin
Managing Director, BoaB interactive Pty Ltd
POB 248, MT Molloy QLD 4871

E: john@anonymised.com
M: 0407 471 565 | P: 07 4094 2172
Skype: boabjohn | Twitter: @boabjohn


Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi there Jody and list colleagues,
We do not have a proxy server set up. The base is set to:
http://74.50.59.149/geoserver

At some point we’ll get a domain name assigned…but in the meantime what should I be doing here?
Just ran a fresh install and have the same problem with openlayers preview trying to come from 127.0.0.1. I am logged in as admin.

Thanks in advance for your assistance.
Kind regards,
JB

···

On 7/08/2014 14:58 PM, Jody Garnett wrote:

That does sound odd? I am jumping into this conversation late - in order to ask you to check the base url setting, you need to use it when deploying GeoServer behind a proxy server.

http://docs.geoserver.org/latest/en/user/webadmin/server/globalsettings.html

That said, if the layer preview is not respecting this setting we have a bug to report.

Jody Garnett

On Wed, Aug 6, 2014 at 7:50 PM, John Brisbin <john@anonymised.com> wrote:

Hey there Phil,

Yep, thanks for the advice on running the production server version of
OL separately from the default install shipped with GeoServer…that’s
exactly what we’re doing. We don’t have trouble with finding the OL
libraries in our external applications…that’s all fine.

I probably wasn’t clear earlier: the only thing I’m trying to do is get
the GeoServer’s OL preview to work.

As a GeoServer Admin, I simply want to use the Preview>OpenLayers
option. That’s where we get the error as our GeoServer is looking for
the OL library at http://127.0.0.1/ etc

I manually scanned every xml config file I could find last night and
still can’t work out why GeoServer is trying to find the OL library via
a localhost IP address.

Just to be clear:

  1. Login to GeoServer as Admin

  2. Go to Layer Preview, choose any layer (even the pre-installed examples)

  3. Choose to Preview via OpenLayers

  4. Get an error in the image display (ie, there is no map shown…the
    surrounding frame is shown)

  5. Look at the page source or use Firebug>Console. Reported error is
    “undefined element openlayers”

  6. Note that the preview page is trying to load OpenLayers javascript
    from 127.0.0.1

  7. Be confused…ask for help!

Thanks again for your patience: can’t wait to find out where I’ve gone
wrong.

Kind regards,
JB

-- 
John Brisbin
Managing Director, BoaB interactive Pty Ltd
POB 248, MT Molloy QLD 4871

E: [john@anonymised.com](mailto:john@anonymised.com)
M: 0407 471 565 | P: 07 4094 2172
Skype: boabjohn | Twitter: @boabjohn