About ArcGIS for javascrept Featurelayer class and Graphicslayer class

Source: Internet
Author: User

Featurelayer: A feature service published by ArcGIS for server or a layer in a map service

Construction Method:

1Myfeaturelayer =NewEsri.layers.FeatureLayer (' http://... '), {//The first parameter is the address of the ArcGIS Server service2Mode:esri.layers.FeatureLayer.MODE_ONDEMAND,//The second parameter is how the layer created is loaded3ID: ' Myfeaturelayer ',//The third parameter is the ID of the layer in map4Outfields: [' * '],//The fourth parameter shows those field information in the map for that layer5 });6Map.addlayels ([Myfeaturelayer]);//How map loads the Myfeaturelayer
Constants of the Esri.layers.FeatureLayer
1 Mode_auto for caching, reducing server load
2 Mode_ondemand This mode, feature layers can retrieve the features we need in the service
3 mode_selection in select mode, the feature is selected only for the retrieval service. This feature is only selected when the client is available
4 mode_snapshot This mode, the feature layer retrieves all the related layer resources from the feature to display it on the client
5 Popup_html_text displaying HTML or text information in a pop-up menu
6 Popup_url Popup Displays the URL's class capacity
7 Selection_add Adding functionality to the current selection set
8 Selection_new Create a new selection
9Selection_subtract removing features from a selection set
Properties of Esri.layers.FeatureLayer
1 advancedquerycapabilities An object that contains whether the service level layer metadata supports usage statistics, query command fields, hierarchical, paged, query with distance, and return query extension
2 Allowgeometryupdates Returns True if the Geometry feature layer can be edited, otherwise false
3 Attributiondataurl layer properties are saved when the URL is available
4 capabilities supports this layer's information function
5 ClassName class properties for layer nodes
6 Copyright Information Layer
7Dataattributes string/string[] Type. Attribute list fields are added as custom data attributes to the graphics node
8 defaultvisibility Show the visibility of the default layer
9 Displayfield Display the property name of the Layer field
Ten editfieldsinfo display field names for edit fields
One field array in the fields layer
A Fullextent Layer Full Range
- gdbversion version of Geodatabase
- Geometrytype collection types for layer features
the array of features in the graphics layer
- Layerid ID feature layer
-Loaded layer properties can be accessed when the layer is loaded with a value of true
The method of Esri.layers.FeatureLayer
1AddAttachment (objestid,formnode,callback?,errback?Adds a feature specified by an attachment objectid.
2Applyedits (adds?,updates?,deferred deletes?,callback?,errback?edit apply to the functional layer
3 attr (name,value) adds a new property or changes the value of an existing property on the node of the layer.
4 Clear () clears multiple graphics
5 clearselection () clears the current selection
6 disablemouseevents () disables all mouse events on the graphics layer
7 mouse events on the enablemouseevents () layer are available
8 Getattributiondata () returns data for a custom layer
9 getdefintionexpression () returns the currently-defined expression
TenGetDomain (fieldname,option?) returns the domain value associated with the given field
OneGeteditcapabilities (options?)) Returns an object that describes the editing function layer
AGeteditinfo (feature,options?Returns an object that describes the most recent edit operation performed on the given attribute, if available
- GetField (fieldName) returns the name of the given field
- Getmap () The returned reference is added to the layer's control layer
the Getorderbyfields () Returns the list field order function using
- Getselectionsynbol () Gets the currently selected feature
- getType (feature) returns a description describing the type of feature Featuretype
-Querycount (query,callback?,errback?) Gets a count of the number of functions that satisfies the input query.
+Queryfeatures (query,callback?,errback?) query features in the feature layer
-Queryids (query,callback?,errback?) Query Object ID
+Queryrelatedfeatures (relquery,callback?,errback?query functions or records, from another layer or table, related functions in this layer.
A Redraw () re-drawing layers with more graphics
at Refresh () refreshes features in the feature layer
- Remove (graphic) image removal
-Resume () Redraw layer

Hide () Hidden layers

Show () display layer

graphicslayer: Client layer does not correspond to services published by ArcGIS for server

Construction Method:

1 New Esri.layers.GraphicsLayer ({2     ID: ' Mygraphicslayer ',3     outfields: [' * ') ],4 });
Esri.layers.GraphicsLayer Property
1 Graphics           Get all the graphics
2 renderer sets the renderer for the layer.
Esri.layers.GraphicsLayer method
1                  Add graphic
2 Clear Clears all graphics
3 Hide hides the layer
4 Show shows the layer
5 disablemouseevents Prevent mouse events from responding
6 enablemouseevents Enabling mouse events
7 Remove Deletes a graphic
8 setinfotemplate Setting infotemplate
9 setrenderer Setting the renderer for a layer

About ArcGIS for javascrept Featurelayer class and Graphicslayer class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.