tags:

views:

250

answers:

2

Actually I need only the full functionality of the map but with no tiles and no requests to the server for them. Can I somehow skip them on the initial load? Is there any default parameter I can set? If not I'll make the patch myself but I'm not sure it's not done yet.

A: 

The code I pasted here gives you the openlayers interface with a dummy layer that cannot be loaded. Although I do not see why you would want this, this does show up an empty OpenLayers mapwindow.

<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
    <title>OpenLayers Standalone</title>
    <script src="http://www.openlayers.org/api/OpenLayers.js"&gt;&lt;/script&gt;
    <script type="text/javascript">
        var map, layer;
        function init(){
            map = new OpenLayers.Map( 'map' );
            layer = new OpenLayers.Layer.WMS( "dummy",
                    "",
                    {layers: 'basic'} );
            map.addLayer(layer);
            //map.zoomToMaxExtent();
        }
    </script>
  </head>

  <body onload="init()">
    <h1 id="title">Basic Single WMS Example</h1>
    <div id="map" style="width:250px;height:250px"></div>
    <div id="docs">
    </div>
  </body>
</html>
milovanderlinden
You can copy the code into an empty test.html doc and even run it straight from a desktop. When you zoom and pan, you will see the pink empty tiles appear.
milovanderlinden
Yes, but the problem is that this produces 404 responses and I don't need those. Can I somehow make the exact same thing but with no 404s?
stoimen
stoimen, please be more specific. Why do you want an openlayers without any map layers at all?
milovanderlinden
A: 

Just use vector layers.

http://openlayers.org/dev/examples/snapping.html

Do you actually even have to give the map a layer? I haven't tried doing that.

Conley Owens