2

I'm new to openlayers. I'd like to edit a feature layer of wms service in openlayers.

I created a wms service using ArcGIS server 10. I couldn't use the wms layers to edit using the openlayers editor. Is there any solution to set layers of the wms service (ex: layer 1 of wms service) to edit in openlayers? In other words, how can I set the wms layer to OpenLayers.Control.EditingToolbar()?

<!DOCTYPE html>
<html>
<head>
 <title>Creating a simple map</title>
 <meta http-equiv="Content-Type"
 content="text/html; charset=UTF-8">
 <!-- Include OpenLayers library -->
 <script type="text/javascript"
 src="http://openlayers.org/api/2.11/
OpenLayers.js"></script>
 <script
 src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.
ashx?v=6.2&mkt=en-us"></script>
 <style>
 html, body {
 width: 100%;
 height: 100%;
 margin: 0;
 padding: 0;
 }
 </style>
 <script type="text/javascript">
 function init() {
 var map = new OpenLayers.Map("rcp1_map");
 map.addControl(new OpenLayers.Control.LayerSwitcher());
 // Add a WMS layer
 var wms = new OpenLayers.Layer.WMS("test",
 "http://.../ArcGIS/services/test/MapServer/WMSServer",
 {
 layers: '0,1,2,3,4,5,6',
 transparent: "true",
 format: 'image/png'
 },
 {
 isBaseLayer: false
 }
 );
 var ve_shaded = new OpenLayers.Layer.VirtualEarth(
 "Shaded",
 {type: VEMapStyle.Shaded}
 );
 var ve_aerial = new OpenLayers.Layer.VirtualEarth(
 "Aerial",
 {type: VEMapStyle.Aerial}
 );
 var ve_road = new OpenLayers.Layer.VirtualEarth(
 "Road",
 {animationEnabled: false}
 );
 var vector_layer = new OpenLayers.Layer.Vector('VectorLayer')
 map.addLayers([vector_layer,wms,ve_shaded, ve_aerial, ve_road]);
 map.setCenter(new OpenLayers.LonLat(54, 32),4)
 map.addControl(new OpenLayers.Control.EditingToolbar(????));
 }
 </script>
</head>
<body onload="init()">
<div id="rcp1_map" style="width: 100%;
height: 100%;"></div>
</body>
</html>
Paul
11.7k1 gold badge31 silver badges48 bronze badges
asked Oct 11, 2013 at 16:20

1 Answer 1

4

AFAIK WMS is not editable in a web client and so with OpenLayers. Maybe you were thinking about the WFS-T protocol which is editable instead. Here's a WFS Transaction Example with OpenLayers.

answered Oct 11, 2013 at 16:31
5
  • 1
    Here is a WFT-T tutorial for ArcGIS Server v10.1, resources.arcgis.com/en/help/main/10.1/index.html#//…. Commented Oct 11, 2013 at 20:00
  • @afalciano so, I created WFS service using ArcGIS server 10 but i couldn't use it in openlayers . In fact i couldn't set some parameters such as featureNS . in detail i created a WFS from MXD. In my MXD I have a shapefile named "turkey_wgs". every samples in the internet uses geoservernot arcgis server . thanks for advance Commented Oct 12, 2013 at 16:05
  • 1
    Note that WFS-T is different from a WFS. Have you followed the tutorial provided by @artwork21 ? See also: gis.stackexchange.com/questions/20814/gis-web-api-wfs-t-edit Commented Oct 12, 2013 at 16:23
  • then i should change the arcgis version from 10 to 10.1 Commented Oct 12, 2013 at 16:32
  • No, you need to change the tutorial version from 10.1 to 10: help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/… Commented Oct 12, 2013 at 16:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.