Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Development Environment Setup

Here we will guide you through the process of setting up a development environment so you can access our geoserver that is serving data.

OpenLayers

For development, get the latest version of OpenLayers here. You will want to point at the lib/OpenLayers.js file so you can set breakpoints inside all .js files used by OpenLayers.

Apache Web Server

Before we can run any examples, we must set up a proxy so that requests from your domain match our WFS. Setting up a proxy is very simple and the details can be found here.

Running Examples

Google Maps API

Code Block
xml
xml

KeyABQIAAAA3sclGimJDe4XWV2KhXgBERTAU3EnfWooxGToqZ5cP0B0YIIRiRSZxTprXfuC6Hq0EJ0f7Yfi3SGWbg
Code Block
JavaScript
JavaScript

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true_or_false&amp;key=ABQIAAAA3sclGimJDe4XWV2KhXgBERTAU3EnfWooxGToqZ5cP0B0YIIRiRSZxTprXfuC6Hq0EJ0f7Yfi3SGWbg" type="text/javascript"></script>

Running Jetty with Connection Pool

Add the following line at VM arguments under Run Configurations

Code Block

-Djava.naming.factory.initial=org.mortbay.naming.InitialContextFactory

Projection in OpenLayers

In order to have projection transformation, the openlayers needs external js library called proj4js (http://proj4js.org/).

Solving Same Origin Policy Problem (or cross-site script)

"Same Origin Policy" is a security restriction for client (browser)-side scripting. (Read: http://en.wikipedia.org/wiki/Same_origin_policyImage Removed). This policy make JS development tricky in developer's local machine. Here is how to solve the problem.  Helpful links are:

How to

...

  1. CGI script is in python. You may need to install python and change the header of the CGI script

...

  1. If proxy.cgi shows openlayers home page, it's working.

...

  1. Add your geoserver host name to allowedHosts list

...