`
norain1988
  • 浏览: 57275 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

arcgis for flex 的编辑功能

阅读更多
提到arcgis 的web 编辑功能不得不说说 Editor component
Editor component 合并了其他组件的所有功能,并向你提供当编辑图层的时候所需要的所有的功能。 你可以选择组件中可以获取的工具的数量和种类。

Editor component 在你完成编辑工作后就立刻可以进行保存,比如:只要你完成了绘制一个polygon,Editor component 就会立刻将其保存。

如果你决定不使用编辑组件,你就必须为你自己决定,什么时间和多久你想应用编辑。

如果你没有使用编辑组件,你需要编码实现你的编辑体验。 尽管如此,你任然还是可以使用DrawTool, EditTool,TemplatePicker ,attributeInspector和AttachmentInspector来帮助你。

好了下面来讲讲 DrawTool, EditTool,TemplatePicker ,attributeInspector和AttachmentInspector
1)templatePicker
TemplatePicker组件展示了一套预先定的Feature的选择,用户也可以自己创建这些选择项。TemplatePicker是一个很好的方法展示预先定义的feature类型,用于轻松编辑和质量控件。TemplatePicker中的symbols直接来自于编辑模板,这些编辑模板是在你的feature 服务的地图文档中定义的。

一个TemplatePicker 包含在编辑组件里面。TemplatePicker 可以单独使用,作为一个简单的legend应用到你的地图中。

2)AttributeInspector component
当你让attributes在wen中处于可以编辑的状态,你需要为用户提供一个接口编辑属性,并且你还要保证你输入的数据是可以获取的。Attribute Inspector component组件可以在这两个任务中帮助你。Attribute Inspector阅读在你的FeatureLayer可以获取的fields,并提供一个用户接口,是使之很容易更新这些fields. 并使输入到Fields中的数据生效,并确保用户的输入匹配的期望的数据类型。 比如:如果一个编码值域应用到一个field、那些允许的值出现在一个下拉框。 限制其他可能输入的值。 如果一个字段值需要一个时间数值,出现一个日历,帮助用户提供一个可以使用的值。

Attribute Inspector 展示了图层中用于的可以获取的属性。使用FetrueLayer的outFields属性来设置那些可以获取的属性

4. AttachmentInspector component

In some situations, you may want to associate a downloadable file with a feature. For example, you might want users to be able to click a feature representing a piece of real estate and see a link to a PDF file of the title deed. In the ArcGIS Web APIs, an associated downloadable file like this is known as a feature attachment. See the FAQ on How do I upload large attachments.

The AttachmentInspector component helps users upload and view the list of feature attachments. The Attachment Editor includes a list of current attachments (with Remove buttons), as well as a Browse button that can be used to upload more attachments. The Attachment Editor works well inside an InfoWindow, but can be placed elsewhere on the page.

In order to use feature attachments, attachments must be enabled on the source feature class. You can enable attachments for a feature class in ArcCatalog or the Catalog window in ArcMap.

在某些情况下,你想把一个下面的文件和一个Feature关联起来。 比如:你想单击一个代表工业绿地的Feature,然后查看与之连接的一个PDF文件。在ArcGIS Web APIs 中和这个类似的下载文件我们称之为附属物。 在How do I upload large attachments 中查看FAQ。。

AttachmentInspector component帮助用户下载和查看feature所属物的列表。The Attachment Editor包含当前附属物的一个列表,和一个浏览器按钮一样,可以被用来下载更多的附属物。The Attachment Editor 在一个infowindow中可以很好的工作,但是也在可以在页面的任何位置被取代。

为了使用feature的附属物,在源Feature类上附属物是必须可以使用的。你可以在ArcCatalog或者ArcMap中的Catalog窗口中为Feature关联附属物。

How does editing work?

Editing 是如何工作的?

Editing with the ArcGIS Web APIs works through the feature service, a new type of service available with ArcGIS 10.0. Editing workflows can also take advantage of the geometry service.

和ArcGIS Web APIs一起进行编辑贯穿于Feature 服务, feature service  是一个新的服务类型,她在ArcGIS 10.0中是可以获取的。 Editing 流野可以利用Geometry 服务 。

The role of the feature service

Web editing requires a feature service to provide the symbology and feature geometry of your data. The feature service is just a map service with the Feature Access capability enabled. This capability allows the map service to expose feature geometries and their symbols in a way that is easy for Web applications to use and update.

Web 编辑 需要一个Feature 服务来提供symnbology和你的数据的Feature Geometry。 Feature 服务就是一个地图服务,这个服务拥有feature访问能力。 这个能力允许地图服务使用一个方式来暴露要素 geometries和他们的symbols ,使用这种方式,一个web 应用程序会很容易的使用和更新这些要素的Geometries和symbols。

Before you build a Web editing application, you need to do some work to create a feature service exposing the layers that you want to be edited. This involves setting up a map document and, optionally, defining some templates for editing. Templates allow you to pre-configure the symbology and attributes for some commonly-used feature types. For example, to prepare for editing roads, you might configure templates for "Controlled Access Freeway", "Other Divided Highway", "State Highway", and "Local Road". Templates are optional, but they make it easy for the end user of the application to create common features.

在你创建一个web 编辑应用程序之前,你需要做一些工作来创建一个Feature服务来发布你要进行编辑的图层。 这涉及到设置一个地图文档,也可以选择性的定义一些用于编辑的模板。 模板允许你提前定义一些通用feature类型的symbology和属性。 比如:为了编辑路,你可能为”Controlled  Access Freeway”,"Other Divided Highway", "State Highway", and "Local Road".的配置模板。 模板是可选的,但是她为应用程序的最终用户创建通用Features提供了很大的便利。

Once your map is finished, you need to publish it to ArcGIS Server with the Feature Access capability enabled. This creates REST URLs, or endpoints, to both a map service and a feature service. You will use these URLs to reference the services in your application.

Feature services are accessible in the Web APIs through a new type of layer called a feature layer. Feature layers can do a variety(品种、种类、变化、多样) of things and can reference a layer in either a map service or a feature service; however, when you use a feature layer for editing purposes you need to reference a layer in a feature service.

一旦你的地图完成,你就要将它发布为ArcGISServer地图服务,并且带有feature 的访问能力。 这就创建了REST URLs或者终点指向地图服务或者一个Feature 服务。  你将使用这些URL在你的应用程序中来引用这些服务。 通过一个称为Feature Layer的新图层类型在WEB APIs中,feature 服务是可以获取的。 Eature layers 可以多多种的事情,可以在一个地图服务或者feature 服务中引用一个图层,尽管如此,当你使用一个Feature图层用于编辑目的,你需要在feature服务中引用一个feature layer。

When you perform editing, your Web application tells the feature layer which attributes have changed and, if applicable, how the geometry changed. The feature layer also displays the updated features after editing. You can call the applyEdits() method on the feature layer to apply the edits, which then commits them to the database.

当你编辑的时侯,你的web 应用程序告诉Feature Layer那个属性已经改变,并且,如果合适的话,geometry是如何改变的。 Feature layer还要展示编辑后的新后的features。 你可以调用feature layer的applyEdits()方法来应用编辑,然后将他们提交到数据库。



The role of the geometry service

The ArcGIS Server geometry service helps perform common editing operations such as creating, cutting, and reshaping geographic features. Before you use the Editor component, you need to create a geometry service on your ArcGIS Server. Then when you create the Editor component, you must provide the URL to the geometry service. The component uses the service behind the scenes, and you won't have to call methods on the geometry service yourself unless you decide not to use the component.

Geometry 服务的角色。

ArcGIS Server Geometry服务帮助执行通用的编辑操作,比如:创建、剪切,reshaping  图形要素。在你使用编辑组件之前,你需呀创建一个Geometry服务在你的ArcGIS 服务器中。 然后,但你创建编辑组件,你必须提供一个执行geometry service 服务的URL.在场景的后面,这些组件使用服务,你也不用必须去调用Geometry上的服务,除非你已经决定不在使用组件。



If you decide not to use the Editor component, you can still use the geometry service to help you code your own editing tools. The geometry service can also help you validate data. For example, you can use the geometry service to perform checks on edits, such as "no edit may fall outside this box", or "a polygon boundary may not cross itself". The Editor component actually calls the simplify() method on the geometry service before it commits a geometry to your database. Although ArcGIS topology validation is not available through the Editor component or editing-related classes, the geometry service may help you achieve a similar result through these types of data integrity checks.

如果你决定不使用编辑组件,你任然可以使用Geometry服务来帮助你编码你自己的编辑工具。Geometry服务还可以帮助你使数据生效。 比如:

你可以使用Geometry服务在编辑中执行检查,比如:查询没有超出查询的范围,或者一个多边形的边界可能没有穿过它自己。 编辑组件在提交到数据库之前,实际上调用geometry 服务上面的simplify()方法。 尽管通过编辑组件或者和编辑相关的类,ArcGIS的拓扑关系不能生效,但是Geometry服务可能帮助你通过这些数据类型完整性的检查达到一个相似的结果。



The EditTool

The EditTool helps you move graphics or their individual vertices. This is helpful in scenarios(n.剧情说明书,剧本) where you are not using the Editor component and you need to write your own editing logic, especially the client display behavior.

编辑工具:

编辑工具帮组你移动Graphics或者他们的独立的顶点。 在不使用Editor组件的情况下,你需要写你自己的编辑逻辑,指明客户端展示动作。

The DrawTool

The DrawTool helps you create new features by drawing them. It is commonly used in combination with the TemplatePicker to create new features based on the selected feature template.

绘制工具、

绘制工具帮助你通过绘制他们来创建新的features。 非常常见她和TemplatePicker合并一起使创建基于选中的要素模板的新要素。

Designing your editing experience

When you build a Web editing application, it is important to think about who will use the application and what they will need to do. You should provide your users no more and no less than the tools they need. In most situations you can design an appropriate editing experience for your users through a combination of the editing components included with the API. Keep in mind that although the API includes a comprehensive Editor component to help you get started, this particular component may not be the best fit for your scenario.

设计你的编辑体验

当你创建一个web 编辑应用程序,考虑谁将会使用应用程序或者他们需要使用是非常重要的。你应该向用户提供刚好他们所需要的工具。在很多的情况下,你可以通过一个包含在API中的编辑工具的组合来为你的用户设计一个编辑体验属性。 你应该记住,尽管API包含一个综合的编辑组件来帮助你入门,但是,这个特定的组件对你的场景来说可能不是最合适的。



In some ways, the editing experience with the API has already been simplified for you. The components include no buttons for starting and stopping edit sessions, or for saving edits. You can provide these functions, but they're not necessary for most applications.

在一些方法中,和API相关的编辑体验已经为你简化过了。组件里面不含有用于开始编辑、停止编辑,或者保存编辑的按钮。你可以提供这些功能,但是在大多数的应用程序中他们不是必须的。

Consider the following approaches for designing a Web editing application. Each approach has its own merits and types applications for which it is most appropriate(恰当的 vt.侵吞;拨出...供专用).

考虑下面用于设计web编辑应用程序的方法。 每一个方法有她自己的优点和与他最合适的应用程序类型。

Feature sketching

In this type of application, field analysts need to sketch(.草图;梗概;素描 v.素描;概述) simple events on the map, such as bird sightings. The geographic precision of the edits is not as important as the event's attributes and the fact that the event happened. In this type of an application, you can use a Template Picker to limit the types of items users can sketch. The Attribute Inspector is also useful, either in a side panel or in an info window that appears when the feature is clicked. Options for splitting and merging features, adding a point at an X/Y location, snapping, or uploading feature attachments may clutter the application and should be avoided unless absolutely needed.

View a sample that shows how to build a feature sketching application.

在这种应用程序中,字段分析需要描述地图中的简单事件,比如,鸟视界。 精确的地理编辑没有事件的属性那么重要,事实是事件发生了。 在这种的应用程序中,你可以使用一个Template Picker 来限制用户可以描述的items的类型。Attribute Inspector也是有用的,不管是一个panel的内部还是一个infowindows,他们都是在feature上面单击的才出现的。用于分割和合并要素、添加一个点到一个X/Y位置或者下载feature的附属物的选项可能会扰乱你的应用程序,因为他应避免使用它,除非确实需要。

Attribute-only editing

Some editing applications include a mapping component, but don't require any changing of geographic features. For example, you might want to create a Web application allowing any office employee to edit the attributes of a parcel feature in your database. You want to prevent them from editing the geometry, leaving that task to your GIS analysts. In this scenario, you can include a map in your application, but expose editing only through the Attribute Inspector. A simple map click on a parcel displays the attributes to be edited. You don't need to include any buttons or components for creating, deleting, or reshaping features.

View a sample that shows how to build an attribute editing application.

一些编辑的应用程序需要一个地图组件,但是不需要geographic要素的任何改变。 比如:你可能想要创建一个web应用程序,它允许任何的办公室工作人员来编辑一个数据库中包数据的数据额属性。你想要阻止编辑geometry,将这个任务留给你的ArcGIS分析。 在这样的场景下,你可以在你的应用程序中包含一个地图,但是只能通过Attribute Inspector来暴露编辑。 在一个包上面的单击地图,出现将要被编辑的属性。你不需要包含任何按钮和组件用于创建、删除、reshaping feature。



Citizen(市民) participation(参与), or geo-wiki



In this type of application, citizens can be the editors and report problems to a government organization by placing points on the map and including ancillary(助手) information such as photographs or a brief description.

Users of this type of application do not even know that they are editing GIS data. They are only allowed to add point features to the database, using a carefully selected set of incident types that you predefined in a Template Picker. Attachments are allowed through the Attachment Inspector component so that citizens can upload images of the incident. Attribute editing may be allowed to a very limited degree so that citizens can describe the incidents.

In this type of application, you may have to code some security checks to ensure that users can only edit or delete their own incidents. You may also include logic to periodically(ad.偶然地,定期地) clean out the database, or allow a subset of authenticated users to close or delete incidents.

View a sample that shows how to build a citizen participation application.

在这种类型的应用程序中,市民可以是编辑者并向政府组织报告问题,它可以通过在地图放置一个点并包含辅助的信息,比如:图标、一个简短的描述。

这种应用程序的用户甚至还不知道他们正在编辑GIS数据。 他们只允许向数据库中添加点要素,使用一个仔细选择的事件类型,这些事件类型是你事先在Template Picker中定义的。通过Attachment Inspector组件是可以添加附件的,因此用户可以upload事件的图片。 属性编辑可能会允许一个有限程度,因此市民可以对事件进行描述。

在这种应用程序中,你可能必须编码一些安全的检查,保证用户只能编辑、删除他们自己的事件。 你可能也包含一些逻辑去定期的清空数据库或者允许管理员用户来关闭或者删除事件。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics