Hello Richard,
 
if you put the bounds and the maxresolution into the map initalization it
works. I have changed your script for testing. Put the layerswitcher control
in your original script and you can see that the editable layer is inactive.
If you zoom in, the layer gets activated. What the cause of this I don't
know. I'm using 2.4 RC5.
 
I hope that helps. Perhaps next week I can put my own example online.
 
Mit freundlichen GrĂ¼ssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/



 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head><title>
 Editing Tool Example
</title>
<link href="../../App_Themes/CloudAmber/Stylesheet.css" type="text/css"
rel="stylesheet" />
 
    <style type="text/css">
        #map {
            width: 800px;
            height: 475px;
            border: 1px solid black;
        }
    </style>
 
    <script language="javascript" type="text/javascript" src="
<http://www.openlayers.org/api/OpenLayers.js>
http://www.openlayers.org/api/OpenLayers.js";></script>
    <!--
    <script src="../OpenLayers2.4RC5full.js"></script>    -->

    <script language="javascript" type="text/javascript">
    <!--
        var lon = 430000;
        var lat = 426000;
        var zoom = 3;
        var map, layer;
 
        function init(){
            map = new OpenLayers.Map( 'map', {maxExtent: new
OpenLayers.Bounds(0,0,700000,1100000), 'maxResolution': 1000, controls: [] }
);
 
            layer = new OpenLayers.Layer.WMS("Map",
                "http://models.itoworld.com/map/wms";, {
                'layers': 'vwa,vpa,via,r,rw,vlb',
                'srs': 'EPSG:27700',
                'format': 'image/png',
                'transparent': 'false'});
 
                /*, {
                'isBaseLayer': true,
                'maxExtent': new OpenLayers.Bounds(0,0,700000,1100000),
                'maxResolution': 1000,
                'projection': 'EPSG:27700'}
                );
                */
 
            map.addLayer(layer);
 
            vlayer = new OpenLayers.Layer.Vector( "Editable" );
 
            map.addLayer(vlayer);
            map.addControl(new OpenLayers.Control.EditingToolbar(vlayer));
            map.addControl(new OpenLayers.Control.PanZoomBar());
            map.addControl(new OpenLayers.Control.LayerSwitcher());
 
            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
        }
 
        //-->
    </script>
 
</head>
<body onload="init()">
    <div id="panel" />
    <div id="map" />
</body>
</html>


  _____  

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 30. Mai 2007 01:28
An: [EMAIL PROTECTED]
Betreff: RE: [OpenLayers-Users] Drawing polygons


Thanks Arnd. The next two lines in the code are exactly as the example:
 
 vlayer = new OpenLayers.Layer.Vector( "Editable" );
 map.addLayer(vlayer);
 map.addControl(new OpenLayers.Control.EditingToolbar(vlayer));
 
but no joy... any chance of a link to your version to compare and contrast?
TIA

  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 29 May 2007 23:11
To: 'Richard Thurbin'
Subject: AW: [OpenLayers-Users] Drawing polygons


Hello Richard,
 
i would think, you need an editable vector layer, where to draw the
features. I have used the same example to build an own test for drawing and
then saving features in an ODBC DB and it works fine.
 
Mit freundlichen GrĂ¼ssen

Arnd Wippermann
 <http://gis.ibbeck.de/ginfo/> http://gis.ibbeck.de/ginfo/




  _____  

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im
Auftrag von Richard Thurbin
Gesendet: Dienstag, 29. Mai 2007 18:13
An: [email protected]
Betreff: Re: [OpenLayers-Users] Drawing polygons



Well done all on the v2.4 release.

Regarding the EditingToolbar, I have implemented the openlayers example:
<http://dev.openlayers.org/sandbox/vector-2.4/examples/editingtoolbar.html>
http://dev.openlayers.org/sandbox/vector-2.4/examples/editingtoolbar.html

Here:  <http://83.104.224.181/test/pages/admin/webform1.aspx>
http://83.104.224.181/test/pages/admin/webform1.aspx. After some
investigation, it seems the red bit below of the new layer code is making
the toolbar not work (except pan).

layer = new OpenLayers.Layer.WMS("Map",
    " <http://models.itoworld.com/map/wms>
http://models.itoworld.com/map/wms";,
    {
        'layers': 'vwa,vpa,via,r,rw,vlb',
        'srs': 'EPSG:27700',                   
        'format': 'image/png',
        'transparent': 'off'
    },
    {
        'isBaseLayer': true,
        'maxExtent': new OpenLayers.Bounds(0,0,700000,1100000),
        'maxResolution': 1000,
        'projection': 'EPSG:27700'
    } 

);

If I take the red out it works (but the layer is useless). Any ideas?

Regards,
Richard Thurbin   
Mobile: +44 7917 704 145
VOIP:   +44 8458 905 299
Fax:    +44 8700 518 913
Email:  [EMAIL PROTECTED]

Cloud Amber Research and Development
Amber House
Brockley Road
Elsworth
Cambridge
CB23 4JS
United Kingdom

http://www.cloudamber.com <http://www.cloudamber.com/> 
http://www.carboncalculator.info <http://www.carboncalculator.info/> 
http://www.qbust.info <http://www.qbust.info/>  

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to