Version 7 (modified by crschmidt, 7 years ago)

--

Frequently Asked Questions about the OpenLayers project


Table of Contents:



General

What is MetaCarta's relationship to the OpenLayers project?

OpenLayers is an independent project sponsored by  MetaCarta. MetaCarta uses the OpenLayers library in some of its products.

How can I add a question to this FAQ?

Please feel free to add OpenLayers questions to this page--we'll try to answer them for you.

Where do I find more info?

Here on this wiki. Click on the [TitleIndex] to see a list of available pages.

Back to Top



TRAC

How do I edit the wiki or a ticket?

You will need a wiki account. If you want an account to enable you to edit the wiki, add a ticket or modify an existing ticket please send an email to the Developer Mailing List.

Back to Top



Map

How do I get a specific bounds to load just right into my Map Div?

You have to specify a maxExtent and set the maxResolution to "auto":

         layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
                                            "http://labs.metacarta.com/wms/vmap0?", 
                                            {'layers': 'basic'},
                                            {'maxExtent': new OpenLayers.Bounds(-180,-90,180,90), 
                                             'maxResolution': "auto"});
         map.addLayer(layer);
         map.zoomToMaxExtent();


Back to Top



Controls

How do I make an OpenLayers map without any controls?

Pass an empty array as the 'controls' property when initializing the map.

            map = new OpenLayers.Map( $('map'), {controls: [] } );


Back to Top



ProxyHost

Why isn't WFS/GeoRSS working on my local checkout of OpenLayers?

This is probably because you do not have a proxy host set up.

Due to security restrictions in Javascript, it is not possible to retrieve information from remote domains via XMLHttpRequest. The way to work around this is to set up a local script which can 'proxy' information from the remote host. An example script to do this is available from the examples directory as proxy.cgi:

 http://svn.openlayers.org/trunk/openlayers/examples/proxy.cgi

To use WFS results from a remote host on your machine, you must install a proxy script somewhere web accessible from the domain you plan to use to host your page. You must then edit ProxyHost to match that URL: an example URL for most Apache configurations might be:

OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";

If the ProxyHost is not set, requests are sent directly. In most cases, the result will be a security exception, although this exception often occurs silently.

Back to Top