[OpenLayers-Users] Openlayers editing toolbar - Newbie question.

Lyes Mokraoui zest at gis.fm
Wed Mar 16 04:07:27 EDT 2011


Hello,

 

I am trying to remove all the editing button in the editing toolbar and
leave only the polygon tool. I have this code below, however I am not sure
what I am doing wrong. Thank you in advance.

 

   <script type="text/javascript">

        var lon = 5;

        var lat = 40;

        var zoom = 5;

        var map, layer;

 

        function init(){

            map = new OpenLayers.Map('map', {theme: null});

            layer = new OpenLayers.Layer.WMS(

                "OpenLayers WMS", 

                "http://vmap0.tiles.osgeo.org/wms/vmap0",

                {layers: "basic"}

            );

            map.addLayer(layer);

 

            vlayer = new OpenLayers.Layer.Vector( "Editable" );

            map.addLayer(vlayer);

            var container = document.getElementById("panel");

            var panel = new OpenLayers.Control.EditingToolbar(

               vlayer, {'tools':['Polygon']});

            map.addControl(panel);

            

            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

        }

    </script>

 

 

Thank you.

 

Best regards.

 

Lyes 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110316/3d41b42a/attachment-0001.html


More information about the Users mailing list