A FeatureLayer is a single layer that can be created from a Map Service or Feature Service; ArcGIS Online or ArcGIS Enterprise portal items; or from an array of ...
ArcGISAPIforJavaScriptAPIReferenceOverviewSampleCodeAPIReferenceShowcaseBlogMenuesriesri/analysisesri/coreesri/formesri/geometryesri/identityesri/layersBaseDynamicLayerBaseElevationLayerBaseTileLayerBingMapsLayerBuildingSceneLayerCSVLayerElevationLayerFeatureLayerGeoJSONLayerGeoRSSLayerGraphicsLayerGroupLayerImageryLayerImageryTileLayerIntegratedMeshLayerKMLLayerLayerLineOfSightLayerMapImageLayerMapNotesLayerMediaLayerOGCFeatureLayerOpenStreetMapLayerPointCloudLayerRouteLayerSceneLayerStreamLayerSubtypeGroupLayerTileLayerUnknownLayerUnsupportedLayerVectorTileLayerVoxelLayerWCSLayerWebTileLayerWFSLayerWMSLayerWMTSLayerbuildingSublayersogcpointCloudFilterssupportesri/networksesri/popupesri/portalesri/renderersesri/restesri/smartMappingesri/supportesri/symbolsesri/viewsesri/webdocesri/webmapesri/websceneesri/widgetsReferenceNavigationMenuFeatureLayer
Overview
CreatingaFeatureLayer
Querying
DataVisualization
Overview
AFeatureLayerisasinglelayerthatcanbecreatedfroma
MapService
orFeatureService;
ArcGISOnlineorArcGISEnterpriseportalitems;orfromanarrayofclient-sidefeatures.Thelayercanbeeithera
spatial(hasgeographicfeatures)ornon-spatial(table).
Spatiallayeriscomposedofdiscretefeatures,eachofwhichhasaGeometry
thatallowsittoberenderedineithera2DMapViewor
3DSceneViewasa
graphicwithspatialcontext.Featuresalsocontaindata
attributesthatprovideadditionalinformationabout
thereal-worldfeatureitrepresents;attributesmaybeviewedinpopupwindows
andusedforrenderingthelayer.
FeatureLayersmaybequeried,analyzed,
andrenderedtovisualizedatainaspatialcontext.
Non-spatiallayerisatablewhichdoesnothaveaspatialcolumnrepresentinggeographicfeatures.
CreatingaFeatureLayer
FeatureLayersmaybecreatedinoneofthreeways:fromaserviceURL,anArcGISportalitemID,
orfromanarrayofclient-sidefeatures.
ReferenceaserviceURL
TocreateaFeatureLayerinstancefromaservice,youmustsettheurlproperty
totheRESTendpointofalayerineitheraFeatureService
oraMapService.Foralayertobevisibleinaview,itmustbeaddedtotheMap
referencedbytheview.SeeMap.add()forinformationaboutaddinglayerstoamap.
require(["esri/layers/FeatureLayer"],function(FeatureLayer){
//pointstothestateslayerinaservicestoringU.S.censusdata
constfl=newFeatureLayer({
url:"https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3"
});
map.add(fl);//addsthelayertothemap
});
Non-spatialtableinstancecanbecreatedfromthetableurlinaserviceandthetablemustbeloadedbycallingload()
method.
//Addanon-spatialtable.
require(["esri/layers/FeatureLayer"],function(FeatureLayer){
//pointstothenon-spatialtableinaservicestoringSanFranciscocrimeincidents.
consttable=newFeatureLayer({
url:"https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/1"
});
table.load().then(function(){
//tableisloaded.readytobequeriedontheserver.
});
});
Iftheserviceisrequestedfromadifferentdomain,aCORSenabledserveroraproxyis
required.
ReferenceanArcGISportalItemID
YoucanalsocreateaFeatureLayerfromitsIDifitexistsasaniteminArcGISOnlineorArcGISEnterprise.
Forexample,thefollowingsnippetshowshowtoaddanewFeatureLayerinstancetoamapusingthe
portalItemproperty.
//pointstoahostedFeatureLayerinArcGISOnline
constfl=newFeatureLayer({
portalItem:{//autocastsasesri/portal/PortalItem
id:"8444e275037549c1acab02d2626daaee"
}
});
map.add(fl);//addsthelayertothemap
ThefollowingsnippetshowshowtocreateaFeatureLayerreferencingatableusingthe
portalItemproperty.
//pointstoahostedtableinArcGISOnline
consttable=newFeatureLayer({
portalItem:{//autocastsasesri/portal/PortalItem
id:"123f4410054b43d7a0bacc1533ceb8dc"
}
});
//Beforeaddingthetabletothemap,itmustfirstbeloadedandconfirmitistherighttype.
table.load().then(function(){
if(table.isTable){
map.tables.add(table);
}
});
Addanarrayofclient-sidefeatures
Beginningwithversion4.17,non-spatial,client-sidefeaturescanbeusedtocreatea
featurelayertable.
Client-sidefeaturesmayalsobeusedtocreateaFeatureLayer.SincetheFeatureLayerrequiresaschema,several
propertiesneedtobesetwhencreatingalayerfromanarrayoffeatures.Ifworkingwith
spatiallayers,thegeometrytypeofthefeaturesmustbeindicated(sinceonlyonegeometrytypeisallowedperlayer)using
thegeometryTypepropertyalongwithavalidspatialreference.Bothspatialandnon-spatial
featurecollectionsrequireanobjectIdfield,thismustbeindicatedalongwithan
arrayoffieldobjects,providingtheschemaofeachfield.Oncethosepropertiesarespecified,the
arrayoffeaturesmustbesettothesourceproperty.Checkout
createaFeatureLayerwithclient-sidegraphicssampletosee
thisinaction.
Ifanyoftherequiredparametersaremissingatthetimeoflayerinitialization,theAPIwillattempttodeterminetherequiredparameters
fromtheprovidedparameters.Forexample,thespatialReference,geometryType,hasZ
andhasMpropertiescanbedeterminedbasedonthefeaturesprovidedtothesourceproperty.
However,ifthesourcepropertyisanemptyarrayatthetimeofinitialization,thengeometryTypecannotbedeterminedandthe
layerwillberejected.
FeatureLayer'ssourceisnotupdatedaftertheFeatureLayerisinitialized.Iffeaturesareadded,removedorupdatedatruntime,thenuse
applyEdits()toupdatethefeaturesthenusequeryFeatures()toreturnupdatedfeatures.Checkout
addorremovegraphicsfromaFeatureLayersample
toseethisinaction.Attributevaluesusedinattributequeriesexecutedagainstclient-sidefeaturelayer,andlayerviewsarecasesensitive.
constlayer=newFeatureLayer({
//createaninstanceofesri/layers/support/Fieldforeachfieldobject
fields:[
{
name:"ObjectID",
alias:"ObjectID",
type:"oid"
},{
name:"type",
alias:"Type",
type:"string"
},{
name:"place",
alias:"Place",
type:"string"
}],
objectIdField:"ObjectID",//inferredfromfieldsarrayifnotspecified
geometryType:"point",//geometryTypeandspatialReferenceareinferredfromthefirstfeature
//inthesourcearrayiftheyarenotspecified.
spatialReference:{wkid:4326},
source:graphics,//anarrayofgraphicswithgeometryandattributes
//popupTemplateandsymbolarenotrequiredineachfeature
//sincethosearehandledwiththepopupTemplateand
//rendererpropertiesofthelayer
popupTemplate:pTemplate,
//adefaultsimplerendererwillbeappliedifnotset.
renderer:uvRenderer//UniqueValueRendererbasedon`type`attribute
});
map.add(layer);
Querying
FeatureswithinaFeatureLayerarerenderedasgraphicsinsidea
LayerView.Thereforethefeaturesvisibleinaviewareaccessed
viatheLayerView,nottheFeatureLayer.Toaccessfeaturesvisibleintheview,usethequerymethods
intheFeatureLayerView.
//returnsallthegraphicsfromthelayerview
view.whenLayerView(layer).then(function(layerView){
layerView.watch("updating",function(val){
if(!val){//waitforthelayerviewtofinishupdating
layerView.queryFeatures().then(function(results){
console.log(results);//printsalltheclient-sidefeaturestotheconsole
});
}
});
});
WhenaccessingfeaturesfromaqueryontheFeatureLayerView,notethat
featuresarereturnedastheyaredisplayedintheview,includinganygeneralizationthatmayhavebeen
appliedtothefeaturestoenhanceperformance.Toobtainfeaturegeometriesatfullresolution,use
thequeryFeatures()methodontheFeatureLayer.
ThequerymethodsintheFeatureLayerclassqueryfeaturesdirectlyfromtheservice.
Forexample,thefollowingsnippetreturnsallfeaturesfromtheservice,notjustthefeaturesdrawninthe
FeatureLayerView.
//Queriesforallthefeaturesintheservice(notthegraphicsintheview)
layer.queryFeatures().then(function(results){
//printsanarrayofallthefeaturesintheservicetotheconsole
console.log(results.features);
});
ForinformationregardinghowtocreateaLayerView
foraparticularlayer,seeView.whenLayerView().
DataVisualization
FeaturesinaFeatureLayerarevisualizedbysettingaRenderertothe
rendererpropertyofthelayer.Featuresmaybevisualizedwiththesamesymbolusing
SimpleRenderer,bytypewithUniqueValueRenderer,
withclassbreaksusingClassBreaksRenderer,orwithcontinuouscolor,size,or
opacityschemesusingvisualvariablesin
anyoftherenderers.Symbolscanonlybesetthrougharendererandnotindividuallyoneachgraphicinthelayer.
SeethedocumentationforRendererandthe
Creatingvisualizationsmanuallyguideformoreinformation
aboutthevariousvisualizationoptionsforFeatureLayers.
UsingtheFeatureLayerrenderersandquerycapabilitiesmentionedabove,youcancreatedynamic,interactivedataexplorationapps.
FeatureLayersalsosupporthighlight.
Thisisenabledbydefaultwhenusersclickortapfeaturestoviewthepopup.Youcanalsocallthe
highlight()methodonthe
FeatureLayerViewtohighlightfeaturesinotherworkflows,suchasfordisplayingquery/selection
resultsandhighlightingfeaturesonpointer-moveevents.
KnownLimitations
Locationswithaveryhighdensityoffeaturesmaynotdisplayallavailablefeaturesatsmallscales.
Verylargedatasetsmayrequirepotentiallylonginitialloadtimes,particularlyatsmallscales.
Server-sideandclient-sidefeaturetilecachingallowfeaturestoloadmuchfasteraftertheinitialdatadownload.
Wearecontinuouslyimprovingourfeaturefetchingstrategyandloadtimeefficiencyineachrelease.
Seealso:
Sample-AddFeatureLayertoyourMap
Sample-CreateaFeatureLayerwithclient-sidegraphics
Sample-QueryfeaturesfromaFeatureLayer
FeatureLayerView
Constructors
newFeatureLayer(properties)
Parameter:
properties
Object
optional
Seethepropertiesforalistofalltheproperties
thatmaybepassedintotheconstructor.
Seealso:
Client-sideFeatureLayer
Example:
//Typicalusage
//Createfeaturelayerfromfeatureservice
constlayer=newFeatureLayer({
//URLtotheservice
url:"https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0"
});
//Typicalusage
//Createfeaturelayerfromclient-sidegraphics
constlayer=newFeatureLayer({
source:graphics,
fields:[{
name:"ObjectID",
alias:"ObjectID",
type:"oid"
},{
name:"place",
alias:"Place",
type:"string"
}],
objectIdField:"ObjectID",
geometryType:"point"
});
PropertyOverview
Anypropertiescanbeset,retrievedorlistenedto.SeetheWorkingwithPropertiestopic.
Showinheritedproperties
Hideinheritedproperties
Name
Type
Summary
Class
apiKeyStringmoredetailsAnauthorizationstringusedtoaccessaresourceorservice.moredetailsFeatureLayer
blendModeStringmoredetailsBlendmodesareusedtoblendlayerstogethertocreateaninterestingeffectinalayer,oreventoproducewhatseemslikeanewlayer.moredetailsFeatureLayer
capabilitiesObjectmoredetailsDescribesthelayer'ssupportedcapabilities.moredetailsFeatureLayer
copyrightStringmoredetailsCopyrightinformationforthelayer.moredetailsFeatureLayer
customParametersObjectmoredetailsAlistofcustomparametersappendedtotheURLofallresourcesfetchedbythelayer.moredetailsFeatureLayer
datesInUnknownTimezoneBooleanmoredetailsThispropertyissetbytheservicepublisherandindicatesthatdatesshouldbeconsideredwithoutthelocaltimezone.moredetailsFeatureLayer
declaredClassStringmoredetailsThenameoftheclass.moredetailsAccessor
definitionExpressionStringmoredetailsTheSQLwhereclauseusedtofilterfeaturesontheclient.moredetailsFeatureLayer
displayFieldStringmoredetailsThenameofthelayer'sprimarydisplayfield.moredetailsFeatureLayer
dynamicDataSourceDynamicMapLayer|DynamicDataLayermoredetailsAnobjectthatallowsyoutocreateadynamiclayerwithdataeitherfrommapservicesublayersordatafromaregisteredworkspace.moredetailsFeatureLayer
editFieldsInfoEditFieldsInfomoredetailsTheeditortrackingfields,whichrecordwhoaddsoreditsthedatathroughthefeatureserviceandwheneditsaremade.moredetailsFeatureLayer
editingEnabledBooleanmoredetailsDeterminesifthelayeriseditable.moredetailsFeatureLayer
editingInfoEditingInfomoredetailsIfpresent,thisvaluespecifiesinformationaboutediting.moredetailsFeatureLayer
effectEffectmoredetailsEffectprovidesvariousfilterfunctionsthatcanbeperformedonthelayertoachievedifferentvisualeffectssimilartohowimagefilterswork.moredetailsFeatureLayer
elevationInfoObjectmoredetailsSpecifieshowfeaturesareplacedontheverticalaxis(z).moredetailsFeatureLayer
featureEffectFeatureEffectmoredetailsThefeatureEffectcanbeusedtodrawattentionfeaturesofinterest.moredetailsFeatureLayer
featureReductionFeatureReductionBinning|FeatureReductionCluster|FeatureReductionSelectionmoredetailsConfiguresthemethodforreducingthenumberofpointfeaturesintheview.moredetailsFeatureLayer
fieldsField[]moredetailsAnarrayoffieldsinthelayer.moredetailsFeatureLayer
fieldsIndexFieldsIndexmoredetailsAconvenientpropertythatcanbeusedtomakecase-insensitivelookupsforafieldbyname.moredetailsFeatureLayer
floorInfoLayerFloorInfomoredetailsWhenafeaturelayerisconfiguredasfloor-aware,ithasafloorInfopropertydefined.moredetailsFeatureLayer
formTemplateFormTemplatemoredetailsThetemplateusedinanassociatedlayer'sFeatureForm.moredetailsFeatureLayer
fullExtentExtentmoredetailsThefullextentofthelayer.moredetailsLayer
gdbVersionStringmoredetailsTheversionofthegeodatabaseofthefeatureservicedata.moredetailsFeatureLayer
geometryFieldsInfoGeometryFieldsInfomoredetailsProvidesinformationonthesystemmaintainedareaandlengthfieldsalongwiththeirrespectiveunits.moredetailsFeatureLayer
geometryTypeStringmoredetailsThegeometrytypeoffeaturesinthelayer.moredetailsFeatureLayer
hasMBooleanmoredetailsIndicateswhethertheclient-sidefeaturesinthelayerhaveM(measurement)values.moredetailsFeatureLayer
hasZBooleanmoredetailsIndicateswhethertheclient-sidefeaturesinthelayerhaveZ(elevation)values.moredetailsFeatureLayer
historicMomentDatemoredetailsThehistoricmomenttoquery.moredetailsFeatureLayer
idStringmoredetailsTheuniqueIDassignedtothelayer.moredetailsLayer
isTableBooleanmoredetailsReturnstrueifthelayerisloadedfromanon-spatialtableinaservice.moredetailsFeatureLayer
labelingInfoLabelClass[]moredetailsThelabeldefinitionforthislayer,specifiedasanarrayofLabelClass.moredetailsFeatureLayer
labelsVisibleBooleanmoredetailsIndicateswhethertodisplaylabelsforthislayer.moredetailsFeatureLayer
layerIdNumbermoredetailsThelayerID,orlayerindex,ofaFeatureServicelayer.moredetailsFeatureLayer
legendEnabledBooleanmoredetailsIndicateswhetherthelayerwillbeincludedinthelegend.moredetailsFeatureLayer
listModeStringmoredetailsIndicateshowthelayershoulddisplayintheLayerListwidget.moredetailsLayer
loadedBooleanmoredetailsIndicateswhetherthelayer'sresourceshaveloaded.moredetailsLayer
loadErrorErrormoredetailsTheErrorobjectreturnedifanerroroccurredwhileloading.moredetailsLayer
loadStatusStringmoredetailsRepresentsthestatusofaloadoperation.moredetailsLayer
loadWarningsObject[]moredetailsAlistofwarningswhichoccurredwhileloading.moredetailsLayer
maxScaleNumbermoredetailsThemaximumscale(mostzoomedin)atwhichthelayerisvisibleintheview.moredetailsFeatureLayer
minScaleNumbermoredetailsTheminimumscale(mostzoomedout)atwhichthelayerisvisibleintheview.moredetailsFeatureLayer
objectIdFieldStringmoredetailsThenameofanoidfieldcontainingauniquevalueoridentifierforeachfeatureinthelayer.moredetailsFeatureLayer
opacityNumbermoredetailsTheopacityofthelayer.moredetailsLayer
orderByObject[]moredetailsDeterminestheorderinwhichfeaturesaredrawnintheview.moredetailsFeatureLayer
outFieldsString[]moredetailsAnarrayoffieldnamesfromtheservicetoincludewitheachfeature.moredetailsFeatureLayer
popupEnabledBooleanmoredetailsIndicateswhethertodisplaypopupswhenfeaturesinthelayerareclicked.moredetailsFeatureLayer
popupTemplatePopupTemplatemoredetailsThepopuptemplateforthelayer.moredetailsFeatureLayer
portalItemPortalItemmoredetailsTheportalitemfromwhichthelayerisloaded.moredetailsFeatureLayer
refreshIntervalNumbermoredetailsRefreshintervalofthelayerinminutes.moredetailsFeatureLayer
relationshipsRelationship[]moredetailsArrayofrelationshipssetupforthelayer.moredetailsFeatureLayer
rendererRenderermoredetailsTherendererassignedtothelayer.moredetailsFeatureLayer
returnMBooleanmoredetailsWhentrue,indicatesthatMvalueswillbereturned.moredetailsFeatureLayer
returnZBooleanmoredetailsWhentrue,indicatesthatz-valueswillalwaysbereturned.moredetailsFeatureLayer
screenSizePerspectiveEnabledBooleanmoredetailsApplyperspectivescalingtoscreen-sizepointsymbolsinaSceneView.moredetailsFeatureLayer
serviceDefinitionExpressionStringmoredetailsTheservicedefinitionexpressionlimitsthefeaturesavailablefordisplayandquery.moredetailsFeatureLayer
sourceCollectionmoredetailsAcollectionofGraphicobjectsusedtocreateaFeatureLayer.moredetailsFeatureLayer
sourceJSONObjectmoredetailsThefeatureservice'smetadataJSONexposedbytheArcGISRESTAPI.moredetailsFeatureLayer
spatialReferenceSpatialReferencemoredetailsThespatialreferenceofthelayer.moredetailsFeatureLayer
templatesFeatureTemplate[]moredetailsAnarrayoffeaturetemplatesdefinedinthefeaturelayer.moredetailsFeatureLayer
timeExtentTimeExtentmoredetailsThelayer'stimeextent.moredetailsFeatureLayer
timeInfoTimeInfomoredetailsTimeInfoprovidesinformationsuchasdatefieldsthatstorestartandendtimeforeachfeatureandthefullTimeExtentforthelayer.moredetailsFeatureLayer
timeOffsetTimeIntervalmoredetailsAtemporaryoffsetofthetimedatabasedonacertainTimeInterval.moredetailsFeatureLayer
titleStringmoredetailsThetitleofthelayerusedtoidentifyitinplacessuchastheLegendandLayerListwidgets.moredetailsFeatureLayer
typeStringmoredetails
ForFeatureLayerthetypeisalways"feature".
moredetailsFeatureLayer
typeIdFieldStringmoredetailsThenameofthefieldholdingthetypeIDorsubtypesforthefeatures.moredetailsFeatureLayer
typesFeatureType[]moredetailsAnarrayofsubtypesdefinedinthefeatureserviceexposedbyArcGISRESTAPI.moredetailsFeatureLayer
urlStringmoredetailsTheabsoluteURLoftheRESTendpointofthelayer,non-spatialtableorservice.moredetailsFeatureLayer
useViewTimeBooleanmoredetailsDeterminesifthelayerwillupdateitstemporaldatabasedontheview'stimeExtent.moredetailsFeatureLayer
versionNumbermoredetailsTheversionofArcGISServerinwhichthelayerispublished.moredetailsFeatureLayer
visibleBooleanmoredetailsIndicatesifthelayerisvisibleintheView.moredetailsLayer
PropertyDetails
apiKeyString
Since:ArcGISAPIforJavaScript4.20
Anauthorizationstringusedtoaccessaresourceorservice.
APIkeysaregeneratedandmanagedintheArcGISDeveloperdashboard.
AnAPIkeyistiedexplicitlytoanArcGISaccount;itisalsousedtomonitorserviceusage.
Settingafine-grainedAPIkeyonaspecificclassoverridestheglobalAPIkey.
Example:
//settheapikeytoaccessaprotectedservice
constlayer=newFeatureLayer({
url:serviceUrl,
apiKey:"YOUR_API_KEY"
});
blendModeString
Since:ArcGISAPIforJavaScript4.16
Blendmodesareusedtoblendlayerstogethertocreateaninterestingeffectinalayer,oreventoproducewhatseemslikeanewlayer.
Unlikethemethodofusingtransparencywhichcanresultinawashed-outtoplayer,blendmodescancreateavarietyofveryvibrantandintriguing
resultsbyblendingalayerwiththelayer(s)belowit.
Whenblendinglayers,atoplayerisalayerthathasablendmodeapplied.Alllayersunderneaththetoplayerarebackgroundlayers.
Thedefaultblendingmodeisnormalwherethetoplayerissimplydisplayedoverthebackgroundlayer.Whilethisdefaultbehaviorisperfectlyacceptable,
theuseofblendmodesonlayersopenupaworldofendlesspossibilitiestogeneratecreativemaps.
ThelayersinaGroupLayerareblendedtogetherinisolationfromtherestofthemap.
Inthefollowingscreenshots,thevintageshadedrelief
layerisdisplayedoverafireflyworldimagerylayer.Thecolorblendmode
isappliedtothevintageshadedreliefandtheresultlookslikeanewlayer.
KnownLimitations
TheblendModein3DSceneViewsissupportedonBaseTileLayer,ImageryTileLayer,
OpenStreetMapLayer,TileLayer,VectorTileLayer,WCSLayer,
WebTileLayerandWMTSLayer.
TheblendModein3DSceneViewwillbeignoredifthelayerisinsideaGroupLayer.
TheblendModeisnotsupportedintheLegend.
Seeprintforknownprintinglimitations.
The followingfactorswillaffecttheblendresult:
Orderofalllayers
Layeropacity
Opacityoffeaturesinlayers
Visibilityoflayers
Bydefault,theverybottomlayerinamapisdrawnonatransparentbackground.YoucanchangetheMapView'sbackgroundcolor.
Blendmode
Description
normal
Thetoplayerisdisplayedoverthebackgroundlayer.Thedataofthetoplayerblockthedataofbackgroundlayerwheretheyoverlap.
average
Takesthemathematicalaverageoftopandbackgroundlayers.Resultofaverageblendmodeisoftensimilartotheeffectofsettingthelayer'sopacityto50%.
Lightenblendmodes:
Thefollowingblendmodescreatelighterresultsthanalllayers.Inlightenblendmodes,pureblackcolorsinthetoplayerbecometransparentallowingthebackgroundlayertoshowthrough.
Whiteinthetoplayerwillstayunchanged.Anycolorthatislighterthanpureblackisgoingtolightencolorsinthetoplayertovaryingdegreesallwaytopurewhite.
Lightenblendmodescanbeusefulwhenlighteningdarkcolorsofthetoplayerorremovingblackcolorsfromtheresult.
Theplus,lightenandscreenmodescanbeusedtobrightenlayersthathavefadedordarkcolorsonadarkbackground.
Blendmode
Description
lighten
Comparestopandbackgroundlayersandretainsthelightercolor.Colorsinthetoplayerbecometransparentiftheyaredarkerthantheoverlappingcolorsinthebackgroundlayerallowingthebackgroundlayertoshowthroughcompletely.Canbethoughtofastheoppositeofdarkenblendmode.
lighter
Colorsintopandbackgroundlayersaremultipliedbytheiralphas(layeropacityandlayer'sdataopacity.Thentheresultingcolorsareaddedtogether.Alloverlappingmidrangecolorsarelightenedinthetoplayer.Theopacityoflayerandlayer'sdatawillaffecttheblendresult.
plus
Colorsintopandbackgroundlayersareaddedtogether.Alloverlappingmidrangecolorsarelightenedinthetoplayer.Thismodeisalsoknownasaddorlinear-dodge.
screen
Multipliesinvertedcolorsintopandbackgroundlayerstheninvertsthecolorsagain.Theresultingcolorswillbelighterthantheoriginalcolorwithlesscontrast.Screencanproducemanydifferentlevelsofbrighteningdependingontheluminosityvaluesofthetoplayer.Canbethoughtofastheoppositeofthemultiplymode.
color-dodge
Dividescolorsinbackgroundlayerbytheinvertedtoplayer.Thislightensthebackgroundlayerdependingonthevalueofthetoplayer.Thebrighterthetoplayer,themoreitscoloraffectsthebackgroundlayer.Decreasesthecontrastbetweentopandbackgroundlayersresultinginsaturatedmid-tonesandblownhighlights.
Darkenblendmodes:
Thefollowingblendmodescreatedarkerresultsthanalllayers.Indarkenblendmodes,purewhiteinthetoplayerwillbecometransparentallowingthebackgroundlayertoshowthrough.
Blackinthetoplayerwillstayunchanged.Anycolorthatisdarkerthanpurewhiteisgoingtodarkenatoplayertovaryingdegreesallthewaytopureblack.
Themultiplyblendmodeisoftenusedtohighlightshadows,showcontrast,oraccentuateanaspectofamap.Forexample,youcanusemultiplyblendmodeonatopographicmap
displayedoverhillshadewhenyouwanttohaveyourelevationshowthroughthetopographiclayer.Seetheintrotolayerblendingsample.
Themultiplyanddarkenmodescanbeusedtohavedarklabelsofthebasemaptoshowthroughtoplayers.Seethedarkenblendingsample.
Thecolor-burnmodeworkswellwithcolorfultopandbackgroundlayerssinceitincreasessaturationinmid-tones.Itincreasesthecontrastbytintingpixelsinoverlappingareasin
topandbottomlayersmoretowardsthetoplayercolor.Usethisblendmode,whenyouwantaneffectwithmorecontrastthanmultiplyordarken.
Thefollowingscreenshotsshowhowthemultiplyblendmodeusedforcreatingaphysicalmapoftheworldthatshowsbothboundariesandelevation.
Blendmode
Description
darken
Emphasizesthedarkestpartsofoverlappinglayers.Colorsinthetoplayerbecometransparentiftheyarelighterthantheoverlappingcolorsinthebackgroundlayer,allowingthebackgroundlayertoshowthroughcompletely.
multiply
Emphasizesthedarkestpartsofoverlappinglayersbymultiplyingcolorsofthetoplayerandthebackgroundlayer.Midrangecolorsfromtopandbackgroundlayersaremixedtogethermoreevenly.
color-burn
Intensifiesthedarkareasinalllayers.Itincreasesthecontrastbetweentopandbackgroundlayers,bytintingcolorsinoverlappingareatowardsthetopcolor.Todothisitinvertscolorsofthebackgroundlayer,dividestheresultbycolorsofthetoplayer,theninvertstheresults.
Contrastblendmodes:
Thefollowingblendmodescreatecontrastbybothlighteningthelighterareasanddarkeningthedarkerareasinthetoplayerbyusinglighteningordarkeningblendmodestocreatetheblend.
Thecontrastblendmodeswilllightenthecolorslighterthan50%gray([128,128,128]),anddarkenthecolorsdarkerthan50%gray.50%graywillbetransparentinthetoplayer.
Eachmodecancreateavarietyofresultsdependingonthecolorsoftopandbackgroundlayersbeingblendedtogether.
Theoverlayblendmodemakesitscalculationsbasedonthebrightnessofthecolorsinthebackgroundlayerwhilealloftheothercontrastblendmodesmaketheircalculationsbasedonthebrightnessofthetoplayer.
Someofthesemodesaredesignedtosimulatetheeffectofshiningalightthroughthetoplayer,effectivelyprojectinguponthelayersbeneathit.
Contrastblendmodescanbeusedtoincreasethecontrastandsaturationtohavemorevibrantcolorsandgiveapunchtoyourlayers.
Forexample,youcanduplicatealayerandsetoverlayblendmodeonthetoplayertoincreasethecontrastandtonesofyourlayer.
Youcanalsoaddapolygonlayerwithawhitefillsymboloveradarkimagerylayerandapplysoft-lightblendmodetoincreasethebrightnessintheimagerylayer.
ThefollowingscreenshotsshowaneffectoftheoverlayblendmodeonaGraphicsLayer.Theleftimageshowswhenthebuffergraphicslayerhasthenormalblendmode.
Asyoucansee,thegraycolorforthebufferpolygonisblockingtheintersectingcensustracts.Therightimageshowswhentheoverlayblendmodeisappliedtothebuffergraphicslayer.
Theoverlayblendmodedarkensorlightensthegraybufferpolygondependingonthecolorsofthebackgroundlayerwhilethecensustractslayerisshiningthrough.
Seethisinaction.
Normalblendmode
Overlayblendmode
Blendmode
Description
overlay
Usesacombinationofmultiplyandscreenmodestodarkenandlightencolorsinthetoplayerwiththebackgroundlayeralwaysshiningthrough.Theresultisdarkercolorvaluesinthebackgroundlayerintensifythetoplayer,whilelightercolorsinthebackgroundlayerwashoutoverlappingareasinthetoplayer.
soft-light
Appliesahalfstrengthscreenmodetolighterareasandhalfstrengthmultiplymodetodarkenareasofthetoplayer.Youcanthinkofthesoft-lightasasofterversionoftheoverlaymode.
hard-light
Multipliesorscreensthecolors,dependingoncolorsofthetoplayer.Theeffectissimilartoshiningaharshspotlightonthetoplayer.
vivid-light
Usesacombinationofcolor-burnorcolor-dodgebyincreasingordecreasingthecontrast,dependingoncolorsinthetoplayer.
Componentblendmodes:
Thefollowingblendmodesuseprimarycolorcomponents,whicharehue,saturationandluminositytoblendtopandbackgroundlayers.
Youcanaddafeaturelayerwithasimplerendereroveranylayerandsethue,saturation,colororluminosityblendmodeonthislayer.Withthistechnique,youcreateabrandnewlookingmap.
Thefollowingscreenshotsshowwherethetopolayerisblendedwith
worldhillshadelayerwithluminosityblendmode.
Theresultisadrasticallydifferentlookingmapwhichpreservesthebrightnessofthetopolayerwhileadaptingthehueandsaturationofthehillshadelayer.
Blendmode
Description
hue
Createsaneffectwiththehueofthetoplayerandtheluminosityandsaturationofthebackgroundlayer.
saturation
Createsaneffectwiththesaturationofthetoplayerandthehueandluminosityofthebackgroundlayer.50%graywithnosaturationinthebackgroundlayerwillnotproduceanychange.
luminosity
Createseffectwiththeluminosityofthetoplayerandthehueandsaturationofthebackgroundlayer.Canbethoughtofastheoppositeofcolorblendmode.
color
Createsaneffectwiththehueandsaturationofthetoplayerandtheluminosityofthebackgroundlayer.Canbethoughtofastheoppositeofluminosityblendmode.
Compositeblendmodes:
Thefollowingblendmodescanbeusedtomaskthecontentsoftop,backgroundorbothlayers.
Destinationmodesareusedtomaskthedataofthetoplayerwiththedataofthebackgroundlayer.
Sourcemodesareusedtomaskthedataofthebackgroundlayerwiththedataofthetoplayer.
Thedestination-inblendmodecanbeusedtoshowareasoffocussuchasearthquakes,animalmigration,orpoint-sourcepollutionbyrevealingtheunderlyingmap,
providingabird’seyeviewofthephenomenon.CheckoutmultipleblendingandgroupLayerblending
samplestoseecompositeblendmodesinaction.
Thefollowingscreenshotsshowfeatureandimagerylayersontheleftsideontheirownintheordertheyaredrawnintheview.Theimagerylayerthatcontainslandcoverclassificationrasters.
Thefeaturelayercontains2007countycropsdata.Therightimageshowstheresultoflayerblendingwheredestination-inblendModeissetontheimagerylayer.Asyoucansee,theeffectis
verydifferentfromtheoriginallayers.Theblendedresultshowsareasofcultivatedcropsonly(wherebothimageryandfeaturelayersoverlap).
Blendmode
Description
destination-over
Destination/backgroundlayercoversthetoplayer.Thetoplayerisdrawnunderneaththedestinationlayer. You'llseethetoplayerpeekthroughwhereverthebackgroundlayeristransparentorhasnodata.
destination-atop
Destination/backgroundlayerisdrawnonlywhereitoverlapsthetoplayer.Thetoplayerisdrawnunderneaththebackgroundlayer.You'llseethetoplayerpeekthroughwhereverthebackgroundlayeristransparentorhasnodata.
destination-in
Destination/backgroundlayerisdrawnonlywhereitoverlapswiththetoplayer.Everythingelseismadetransparent.
destination-out
Destination/backgroundlayerisdrawnwhereitdoesn'toverlapthetoplayer.Everythingelseismadetransparent.
source-atop
Source/toplayerisdrawnonlywhereitoverlapsthebackgroundlayer.Youwillseethebackgroundlayerpeekthroughwherethesourcelayeristransparentorhasnodata.
source-in
Source/toplayerisdrawnonlywhereitoverlapswiththebackgroundlayer.Everythingelseismadetransparent.
source-out
Source/toplayerisdrawnwhereitdoesn'toverlapthebackgroundlayer.Everythingelseismadetransparent.
xor
Topandbackgroundlayersaremadetransparentwheretheyoverlap.Bothlayersaredrawnnormaleverywhereelse.
Invertblendmodes:
Thefollowingblendmodeseitherinvertorcanceloutcolorsdependingoncolorsofthebackgroundlayer.
Theseblendmodeslookforvariationsbetweentopandbackgroundlayers.
Forexample,youcanusedifferenceorexclusionblendmodesontwoimagerylayersofforestcoverstovisualizehowforestcoverschangedfromoneyeartoanother.
Theinvertblendmodecanbeusedtoturnanylightbasemapintoadarkbasemaptoaccommodatethosewhoworkinlow-lightconditions.Thefollowingscreenshotsshow
howsettingtheinvertblendmodesetonafeaturelayerwithasimplerendererturnstheworldterrainbasemap
intoadarkthemedbasemapinnotime.
Blendmode
Description
difference
Subtracts thedarkeroftheoverlappingcolorsfromthelightercolor.Whentwopixelswiththesamevaluearesubtracted,theresultisblack. Blendingwithblackproducesnochange.Blendingwithwhiteinvertsthecolors.Thisblendingmodeisusefulforaligninglayerswithsimilarcontent.
exclusion
Similartothedifferenceblendmode,exceptthattheresultingimageislighteroverall.Overlappingareaswithlightercolorvaluesarelightened,whiledarkeroverlappingcolorvaluesbecometransparent.
minus
Subtractscolorsofthetoplayerfromcolorsofthebackgroundlayermakingtheblendresultdarker.Inthecaseofnegativevalues,blackisdisplayed.
invert
Invertsthebackgroundcolorswhereverthetopandbackgroundlayersoverlap.Theinvertblendmodeinvertsthelayersimilartoaphotographicnegative.
reflect
Thisblendmodecreateseffectsasifyouaddedshinyobjectsorareasoflightinthelayer.Blackpixelsinthebackgroundlayerareignoredasiftheyweretransparent.
PossibleValues:"average"|"color-burn"|"color-dodge"|"color"|"darken"|"destination-atop"|"destination-in"|"destination-out"|"destination-over"|"difference"|"exclusion"|"hard-light"|"hue"|"invert"|"lighten"|"lighter"|"luminosity"|"minus"|"multiply"|"normal"|"overlay"|"plus"|"reflect"|"saturation"|"screen"|"soft-light"|"source-atop"|"source-in"|"source-out"|"vivid-light"|"xor"
DefaultValue:normal
Seealso:
Layerblendingsamples
capabilitiesObjectreadonly
Describesthelayer'ssupportedcapabilities.
Properties:
attachment
Object
Describeswhatattachmentcapabilitiesareenabledonthelayer.
Specification:
supportsCacheHint
Boolean
Indicatesiftheattachmentoperationssupportacachehint.Thisisvalidonlyfor
hostedfeatureservices.
supportsContentType
Boolean
Indicatesiftheattachmentscanbequeriedbytheircontenttypes.
supportsExifInfo
Boolean
IndicatesiftheattachmentqueriessupportexifInfo.
supportsKeywords
Boolean
Indicatesiftheattachmentscanbequeriedbytheirkeywords.
supportsName
Boolean
Indicatesiftheattachmentscanbequeriedbytheirnames.
supportsSize
Boolean
Indicatesiftheattachmentscanbequeriedbytheirsizes.
supportsResize
Boolean
Indicatesifresizedattachmentsaresupportedinthefeaturelayer.
ThisisusefulforshowingthumbnailsinPopups.
data
Object
Describescharacteristicsofthedatainthelayer.
Specification:
isVersioned
Boolean
Indicatesifthefeatureserviceisversioned.
supportsAttachment
Boolean
Indicatesiftheattachmentisenabledonthelayer.
supportsM
Boolean
Indicatesifthefeaturesinthelayersupportm-values.
supportsZ
Boolean
Indicatesifthefeaturesinthelayersupportz-values.
SeeelevationInfofordetailsregardingplacementandrenderingoffeatureswithz-valuesin3DSceneViews.
editing
Object
DescribeseditingcapabilitiesthatcanbeperformedonthefeaturesinthelayerviaapplyEdits().
Specification:
supportsDeleteByAnonymous
Boolean
Indicatesifanonymoususerscandeletefeaturescreatedbyothers.
supportsDeleteByOthers
Boolean
Indicatesifloggedinuserscandeletefeaturescreatedbyothers.
supportsGeometryUpdate
Boolean
Indicatesifthegeometryofthefeaturesinthelayercanbeedited.
supportsGlobalId
Boolean
IndicatesiftheglobalIdvaluesprovidedbytheclientareusedinapplyEdits.
supportsRollbackOnFailure
Boolean
IndicatesiftherollbackOnFailureEnabledparametercanbesettotrueorfalsewheneditingfeatures.
supportsUpdateByAnonymous
Boolean
Indicatesifanonymoususerscanupdatefeaturescreatedbyothers.
supportsUpdateByOthers
Boolean
Indicatesifloggedinuserscanupdatefeaturescreatedbyothers.
supportsUploadWithItemId
Boolean
IndicatesifthelayersupportsuploadingattachmentsbyUploadId.
supportsUpdateWithoutM
Boolean
Indicatesifm-valuesmustbeprovidedwhenupdatingfeatures.
metadata
Object
Describesthemetadatacontainedonfeaturesinthelayer.
Specification:
supportsAdvancedFieldProperties
Boolean
Indicateswhethertoprovideauser-definedfielddescription.
SeeDescribeattributefieldsforadditionalinformation.
operations
Object
Describesoperationsthatcanbeperformedonfeaturesinthelayer.
Specification:
supportsAdd
Boolean
Indicatesifnewfeaturescanbeaddedtothelayer.
supportsCalculate
Boolean
Indicatesifvaluesofoneormorefieldvaluesinthelayercanbeupdated.
SeetheCalculateRESToperationdocumentformoreinformation.
supportsDelete
Boolean
Indicatesiffeaturescanbedeletedfromthelayer.
supportsEditing
Boolean
Indicatesiffeaturesinthelayercanbeedited.
UsesupportsAdd,supportsUpdateandsupportsDeletetodeterminewhicheditingoperationsaresupported.
supportsQuery
Boolean
Indicatesiffeaturesinthelayercanbequeried.
supportsQueryAttachments
Boolean
Indicatesifthelayersupports
RESTAPIqueryAttachmentsoperation.
Iffalse,queryAttachments()methodcanonlyreturnattachmentsforonefeatureatatime.
Iftrue,queryAttachments()canreturnattachmentsforarrayofobjectIds.
supportsResizeAttachments
Boolean
Deprecatedsince4.24.Useattachment.supportsResizeinstead.Indicatesifresizedattachmentsaresupportedinthefeaturelayer.
ThisisusefulforshowingthumbnailsinPopups.
supportsQueryTopFeatures
Boolean
Indicatesifthelayersupports
RESTAPIqueryTopFeaturesoperation.
supportsUpdate
Boolean
Indicatesiffeaturesinthelayercanbeupdated.
supportsValidateSql
Boolean
IndicatesifthelayersupportsaSQL-92expressionorwhereclause.
query
Object
Describesquery
operationsthatcanbeperformedonfeaturesinthelayer.
Properties:
maxRecordCount
Number
Themaximumnumberofrecordsthatwillbereturnedforagivenquery.
supportsCacheHint
Boolean
Indicatesifthequeryoperationsupportsacachehint.Thisisvalidonlyfor
hostedfeatureservices.
supportsCentroid
Boolean
Indicatesifthegeometrycentroidassociatedwitheachpolygonfeaturecanbereturned.Thisoperationis
onlysupportedinArcGISOnlinehostedfeatureservices.
supportsDisjointSpatialRelationship
Boolean
Indicatesifthequeryoperationsupportsdisjointspatialrelationship.Thisisvalidonlyfor
hostedfeatureservices.
supportsDistance
Boolean
Indicatesifthelayer'squeryoperationsupportsabufferdistanceforinputgeometries.
supportsDistinct
Boolean
IndicatesifthelayersupportsqueriesfordistinctvaluesbasedonfieldsspecifiedintheoutFields.
supportsExtent
Boolean
Indicatesifthelayer'squeryresponseincludestheextentoffeatures.
supportsGeometryProperties
Boolean
Indicatesifthelayer'squeryresponsecontainsgeometryattributes,includingshapeareaandlengthattributes.
supportsHavingClause
Boolean
Indicatesifthelayersupportsthehavingclauseontheservice.
supportsHistoricMoment
Boolean
Indicatesifthelayersupportshistoricmomentquery.
supportsOrderBy
Boolean
Indicatesiffeaturesreturnedinthequeryresponsecanbeorderedbyoneormorefields.
supportsPagination
Boolean
Indicatesifthequeryresponsesupportspagination.
supportsPercentileStatistics
Boolean
IndicatesifthelayersupportspercentilestatisticType.
supportsQuantization
Boolean
Indicatesifthequeryoperationsupportstheprojectionofgeometriesontoavirtualgrid.
supportsQuantizationEditMode
Boolean
Indicatesifthequeryoperationsupportsquantizationdesignedtobeusedineditmode(highestresolutionatthegivenspatialreference).
supportsQueryGeometry
Boolean
Indicatesifthequeryresponseincludesthequerygeometry.
supportsResultType
Boolean
Indicatesifthenumberoffeaturesreturnedbythequeryoperationcanbecontrolled.
supportsStandardizedQueriesOnly
Boolean
Indicatesifthelayersupportsusingstandardizedqueries.
Learnmoreaboutstandardizedquerieshere.
supportsStatistics
Boolean
Indicatesifthelayersupportsfield-basedstatisticalfunctions.
supportsSqlExpression
Boolean
IndicatesifthelayersupportsSQLexpressions.
supportsSpatialAggregationStatistics
Boolean
Indicatesifthelayersupportsspatialextent,centerorconvexhulltobereturnedforeachdistinctgroupwhen
groupByFieldsForStatisticsisused.SupportedwithArcGISOnlinehostedfeaturesservicesonly.
supportedSpatialStatisticAggregations
Object
ListofsupportedaggregatedgeometriesreturnedforeachdistinctgroupwhengroupByFieldsForStatisticsisused.
Specification:
centroid
Boolean
IndicatesifthelayercanreturncentroidforeachdistinctgroupforgroupByFieldsForStatistics.
envelope
Boolean
IndicatesifthelayercanreturnextentforeachdistinctgroupforgroupByFieldsForStatistics.
convexHull
Boolean
IndicatesifthelayercanreturnconvexhullforeachdistinctgroupforgroupByFieldsForStatistics.
queryRelated
Object
Indicatesifthelayer'squeryoperationsupportsqueryingfeaturesorrecordsrelatedtofeaturesinthelayer.
Specification:
supportsCacheHint
Boolean
Indicatesiftherelationshipqueryoperationsupportsacachehint.Thisisvalidonlyfor
hostedfeatureservices.
supportsCount
Boolean
Indicatesifthelayer'squeryresponseincludesthenumberoffeaturesorrecordsrelatedtofeaturesinthelayer.
supportsOrderBy
Boolean
Indicatesiftherelatedfeaturesorrecordsreturnedinthequeryresponsecanbeorderedbyoneormorefields.
supportsPagination
Boolean
Indicatesifthequeryresponsesupportspaginationforrelatedfeaturesorrecords.
queryTopFeatures
Object
Describestopfeaturesqueryoperationsthatcanbeperformedonfeaturesinthelayer.
Specification:
supportsCacheHint
Boolean
Indicatesifthetopqueryoperationsupportsacachehint.Thisisvalidonlyfor
hostedfeatureservices.
Example:
//Oncethelayerloads,checkifthe
//supportsAddoperationsisenabledonthelayer
featureLayer.when(function(){
if(featureLayer.capabilities.operations.supportsAdd){
//ifnewfeaturescanbecreatedinthelayer
//setuptheUIforediting
setupEditing();
}
});
copyrightString
Copyrightinformationforthelayer.
customParametersObject
Since:ArcGISAPIforJavaScript4.18
AlistofcustomparametersappendedtotheURLofallresourcesfetchedbythelayer.
It'sanobjectwithkey-valuepairswherevalueisastring.
Example:
//sendacustomparametertoyourspecialservice
letlayer=newMapImageLayer({
url:serviceUrl,
customParameters:{
"key":"my-special-key"
}
});
datesInUnknownTimezoneBooleanreadonly
Since:ArcGISAPIforJavaScript4.21
Thispropertyissetbytheservicepublisherandindicatesthatdatesshouldbeconsideredwithoutthelocaltimezone.
Thisappliestobothrequestsandresponses.
KnownLimitations
ThiscapabilityisonlyavailablewithservicespublishedwithArcGISEnterprise10.9orgreater.
EditingisnotsupportedforFeatureLayersifdatesInUnknownTimezoneistrue.TheeditingEnabledpropertywillbesettofalse.
ThispropertyisnothonoredbylabelsandArcade-basedpopupTemplates.Dateswillbedisplayedinthelocaltimezone.
WhensettingtimeExtentinaquery,filterorlayer,datesmustbedefined
intermsofUTCasillustratedinthecodebelow.
Whenusinglayer.timeInfo.fullTimeExtentinconjunctionwithTimeSlider,thelocaltimezoneoffsetmustberemoved.Seethecodesnippetbelow.
DefaultValue:false
Seealso:
ArcGISRESTAPI-Newin10.9
What'snewinArcGISServer10.9
Editmapservicesettings
Examples:
//Onlydownloaddatafortheyear2020.
//ifthelayersupportsunknowntimezonethencreate
//thedatesinUTC
if(layer.datesInUnknownTimezone){
layer.timeExtent=newTimeExtent({
start:newDate(Date.UTC(2020,0,1)),
end:newDate(Date.UTC(2021,0,1))
});
}
else{
layer.timeExtent=newTimeExtent({
start:newDate(2020,0,1),
end:newDate(2021,0,1)
});
}
//setupthetimesliderforaservicewithanunknowntimezone
if(layer.datesInUnknownTimezone){
consttimeSlider=newTimeSlider({
view:view,
container:"timeSliderDiv",
timeVisible:true,
});
view.ui.add(timeSlider,"bottom-left");
view.whenLayerView(layer).then((layerView)=>{
//getthelayer'sfullTimeExtentandremovethelocal
//timezoneoffset
consttimExtent=newTimeExtent({
start:removeLocalOffset(layer.timeInfo.fullTimeExtent.start),
end:removeLocalOffset(layer.timeInfo.fullTimeExtent.end)
});
timeSlider.fullTimeExtent=timExtent;
timeSlider.stops={
interval:layer.timeInfo.interval;
};
});
}
//Removethelocaltimezoneoffsetfromdates
functionremoveLocalOffset(localTime){
returnnewDate(
localTime.getUTCFullYear(),
localTime.getUTCMonth(),
localTime.getUTCDate(),
localTime.getUTCHours(),
localTime.getUTCMinutes(),
localTime.getUTCSeconds(),
localTime.getUTCMilliseconds()
);
}
declaredClassStringreadonly
inherited
Since:ArcGISAPIforJavaScript4.7
Thenameoftheclass.Thedeclaredclassnameisformattedasesri.folder.className.
definitionExpressionString
TheSQLwhereclauseusedtofilterfeaturesontheclient.Onlythefeaturesthatsatisfythedefinition
expressionaredisplayedintheView.Settingadefinitionexpressionisuseful
whenthedatasetislargeandyoudon'twanttobringallfeaturestotheclientforanalysis.
Definitionexpressionsmaybesetwhenalayerisconstructedpriortoitloadingintheviewor
afterithasbeenaddedtothemap.Ifthedefinitionexpressionissetafterthelayerhasbeenaddedtothemap,theviewwill
automaticallyrefreshitselftodisplaythefeaturesthatsatisfythenewdefinitionexpression.
Examples:
//SetdefinitionexpressioninconstructortoonlydisplaytreeswithscientificnameUlmuspumila
constlayer=newFeatureLayer({
url:"https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0",
definitionExpression:"Sci_Name='Ulmuspumila'"
});
//Setthedefinitionexpressiondirectlyonlayerinstancetoonlydisplaytreestallerthan50ft
layer.definitionExpression="HEIGHT>50";
displayFieldString
Since:ArcGISAPIforJavaScript4.4
Thenameofthelayer'sprimarydisplayfield.Thevalueofthispropertymatchesthenameofoneofthefieldsofthelayer.
dynamicDataSourceDynamicMapLayer|DynamicDataLayer
Since:ArcGISAPIforJavaScript4.7
Anobjectthatallowsyoutocreateadynamiclayerwithdata
eitherfrommapservicesublayersordatafromaregisteredworkspace.
SeeDynamicMapLayer
forcreatingdynamiclayersfrommapservicelayersforonthefly
rendering,labeling,andfiltering(definitionexpressions).Tocreate
dynamiclayersfromothersourcesinregisteredworkspacessuchastablesandtablejoins,
seeDynamicDataLayer.
IfyoualreadyhaveaSublayerinstance,you
cancallthecreateFeatureLayer()
methodontheSublayertoconstructthelayerforyou.
Thisonlyappliestomapserviceswith
dynamiclayersenabled.
KnownLimitations
FeatureLayerswithadynamicDataSourcecannotbepersistedtowebmaps,webscenes,andportalitems.
Seealso:
Sublayer.source
Sublayer.createFeatureLayer()
Example:
constlayer=newFeatureLayer({
url:"https://sampleserver6.arcgisonline.com/arcgis/rest/services/AGP/Census/MapServer",
title:"UnitedStatesPopulation",
popupTemplate:{
title:"{states.STATE_NAME}",
content:"{expression/per_ancestry}%ofthe{states.POP2007}peoplein{states.STATE_NAME}have"
+"Norwegianancestry.",
expressionInfos:[{
name:"per_ancestry",
expression:"Round(($feature['ancestry.norwegian']/$feature['states.POP2007'])*100,1)"
}],
fieldInfos:[{
fieldName:"states.POP2007",
format:{
digitSeparator:true,
places:0
}
}]
},
dynamicDataSource:{
type:"data-layer",
dataSource:{
type:"join-table",
leftTableSource:{
type:"map-layer",
mapLayerId:3
},
rightTableSource:{
type:"data-layer",
dataSource:{
type:"table",
workspaceId:"CensusFileGDBWorkspaceID",
dataSourceName:"ancestry"
}
},
leftTableKey:"STATE_NAME",
rightTableKey:"State",
joinType:"left-outer-join"
}
}
});
editFieldsInfoEditFieldsInforeadonly
Since:ArcGISAPIforJavaScript4.11
Theeditortrackingfields,whichrecordwhoaddsoreditsthedatathroughthefeatureservice
andwheneditsaremade.
editingEnabledBoolean
Since:ArcGISAPIforJavaScript4.18
Determinesifthelayeriseditable.
DefaultValue:true
Seealso:
applyEdits
editingInfoEditingInforeadonly
Since:ArcGISAPIforJavaScript4.12
Ifpresent,thisvaluespecifiesinformationaboutediting.
effectEffectautocast
Since:ArcGISAPIforJavaScript4.18
Effectprovidesvariousfilterfunctionsthatcanbeperformedonthelayertoachievedifferentvisualeffectssimilarto
howimagefilterswork.Thispowerfulcapabilityallowsyoutoapplycssfilter-like
functionstolayerstocreatecustomvisualeffectstoenhancethecartographicqualityofyourmaps.Thisisdonebyapplyingthedesired
effecttothelayer'seffectpropertyasastringoranarrayofobjectstosetscaledependenteffects.
Notes
SetfeatureEffectpropertyifdifferenteffectsneedtobeappliedfeaturesthatmeetorfaila
specifiedfilter.
Ifallofthefollowingfourpropertiesareapplied,thentheywillbeappliedinthisorder:featureEffect,effect,opacityandblendMode.
KnownLimitations
Theeffectisnotsupportedin3DSceneViews.
Theeffectcannotbeappliedtoalayerwithaheatmaprenderer.
TheeffectisnotsupportedinlayerswithfeatureReductionoftypeclusterenabled.
Seeprintforknownprintinglimitations.
DefaultValue:null
Seealso:
featureEffect
Moreinformationonhowtoseteffect
Layerandlayervieweffectsamples
Examples:
//thefollowingeffectwillbeappliedtothelayeratallscales
//brightnesswillbeappliedfirst,thenhue-rotatefollowedbycontrast
//changingorderoftheeffectswillchangethefinalresult
layer.effect="brightness(5)hue-rotate(270deg)contrast(200%)";
//setascaledependentbloomeffectonthelayer
layer.effect=[
{
scale:36978595,
value:"drop-shadow(3px,3px,4px)"
},
{
scale:18489297,
value:"drop-shadow(2px,2px,3px)"
},
{
scale:4622324,
value:"drop-shadow(1px,1px,2px)"
}
];
elevationInfoObject
Specifieshowfeaturesareplacedontheverticalaxis(z).Thispropertymayonlybeused
inaSceneView.SeetheElevationInfosample
foranexampleofhowthispropertymaybeused.
Properties:
mode
String
Defineshowthefeature
isplacedwithrespecttotheterrainsurfaceor3Dobjectsinthescene.Ifthegeometryconsistsofmultiplepoints
(e.g.linesorpolygons),theelevationisevaluatedseparatelyforeachpoint.Seethetablebelowforalistofpossiblevalues.
Mode
Description
on-the-ground
FeaturesarealignedtotheGround.IfthescenecontainsanIntegratedMeshLayer,thenfeaturesarealignedtotheIntegratedMeshLayer.Iffeatureshavez-values,thenthez-valuesareignoredinthismode.Featureswith2DsymbolsaredrapedontheGroundorIntegratedMeshLayer.Thisisthedefaultmodeforlayerswithoutz-valuescontainingPolyline,PolygonfeaturesorPointfeaturesrenderedwithObjectSymbol3DLayer.
absolute-height
Featuresareplacedatanabsoluteelevation(z-value)abovesealevel.Thisz-valueisdeterminedbythegeometry'sz-value(ifpresent).IffeatureExpressionInfoisdefined,theresultoftheexpressionisusedinsteadofthegeometry’sz-value.Thismodedoesn'ttaketheelevationoftheGroundoranyotherlayersintoaccount.ThisisthedefaultvalueoffeatureswithanygeometrytypewherehasZistrue.
relative-to-ground
FeaturesareplacedatanelevationrelativetotheGroundorIntegratedMeshLayer.Thefeature'selevationisdeterminedbysumminguptheelevationoftheGroundorIntegratedMeshLayerandthegeometry'sz-value(ifpresent).IffeatureExpressionInfoisdefined,theresultoftheexpressionisusedinsteadofthegeometry’sz-value.Ifthegeometriesdon'thavez-values,relative-to-groundisthedefaultvalueforPointgeometriesrenderedwithIconSymbol3DLayers.
relative-to-scene
Featuresarealignedtoextrudedpolygons,3DObjectSceneLayersorBuildingSceneLayers,dependingonwhichonehashigherelevation.Ifthefeatureisnotdirectlyaboveabuildingoranyotherfeature,itisalignedtotheelevationoftheGroundortheIntegratedMeshLayer.Ifpresent,thegeometry'sz-valueisaddedtotheelevation.IffeatureExpressionInfoisdefined,theresultoftheexpressionisusedinsteadofthegeometry’sz-value.
PossibleValues:"on-the-ground"|"relative-to-ground"|"absolute-height"|"relative-to-scene"
offset
Number
optional
Anelevationoffset,whichisaddedtotheverticalpositionofthefeature.Ifunitisnotdefined,theoffset
isinmeters.
Whenmode="on-the-ground",thispropertyhasnoeffect.
featureExpressionInfo
Object
optional
Defineshowtooverrideafeature'sZ-valuebasedonitsattributes.
Specification:
expression
String
optional
AnArcadeexpression
followingthespecification
definedbytheArcadeFeatureZProfile.Expressions
mayreferencefieldvaluesusingthe$featureglobalvariableandmustreturnanumberrepresentingthez-value
ofthefeature.Whenmode="on-the-ground",thispropertyhasnoeffect.Forlineandpolygongeometries
theresultoftheexpressionisthesameforallverticesofafeature.
unit
String
optional
TheunitforfeatureExpressionInfoandoffsetvalues.
PossibleValues:"feet"|"meters"|"kilometers"|"miles"|"us-feet"|"yards"
Seealso:
ArcadeFeatureZProfile
featureEffectFeatureEffectautocast
Since:ArcGISAPIforJavaScript4.22
ThefeatureEffectcanbeusedtodrawattentionfeaturesofinterest.
Itallowsfortheselectionoffeaturesviaa
filter,andan
includedEffectand
excludedEffect
areappliedtothosefeaturesthatrespectivelypassorfailthefilterrequirements.
Notes
Settheeffectpropertyiftheeffectneedstobeappliedtotheentirelayer.
IfthefeatureEffectissetonthelayer,itwillbeinheritedbylayerView.featureEffectunlessthedeveloperoverridesitonthelayerview.ThelayerView.featureEffect
willtakeprecedenceoverlayer.featureEffectifbothpropertiesareset.
Ifallofthefollowingfourpropertiesareapplied,thentheywillbeappliedinthisorder:featureEffect,effect,opacityandblendMode.
KnownLimitations
FeatureEffectisnotsupportedinthefollowingscenarios:
In3DSceneViews
InalayerrenderedwithaHeatmapRenderer
WhenFeatureReductionClusterisenabled
Seeprintforknownprintinglimitations.
Seealso:
Sample-Applyeffectstofeatures
Sample-Applydrop-shadoweffecttoalayerView
effect
Examples:
//grayoutfeaturesthatfalloutsideofthe3milebufferofthemouse'slocation
//bysettingfeatureeffectonexcludedfeatures
layer.featureEffect=newFeatureEffect({
filter:newFeatureFilter({
geometry:filterGeometry,
spatialRelationship:"intersects",
distance:3,
units:"miles"
}),
excludedEffect:"grayscale(100%)opacity(30%)"
});
//Applyadrop-shadowfeatureeffecttothefeaturesthatintersecttheboroughboundaries,
//whileapplyingblurandbrightnesseffectstothefeaturesthatareexcludedfromfiltercriteria.
//Theresultingmapwillmakeiteasiertospotiftheresidentsaremorelikelytoexperiencedeprivation
//iftheyliveonaboroughboundary.
constfeatureFilter=newFeatureFilter({
where:"BoroughEdge='true'"
});
layer.featureEffect=newFeatureEffect({
filter:featureFilter,
includedEffect:"drop-shadow(3px,3px,3px,black)",
excludedEffect:"blur(1px)brightness(65%)"
});
featureReductionFeatureReductionBinning|FeatureReductionCluster|FeatureReductionSelectionautocast
Since:ArcGISAPIforJavaScript4.4
Configuresthemethodforreducingthenumberofpointfeaturesintheview.
Bydefaultthispropertyisnull,whichindicatesthelayerviewshoulddraweveryfeature.
Therearethreetypesoffeaturereduction:selection,cluster,andbinning.
SelectiononlyappliestopointsinaSceneView
andinvolvesthinningoverlappingfeaturessonofeatures
intersectonscreen.Thishasbeenavailablesinceversion4.4.
ClustergroupspointsinaMapView
intoclustersdefinedinscreenspace.Eachclusterisapointwhosesizeisproportionaltothenumberoffeatureswithinthecluster.Thishasbeenavailablesinceversion4.14.
BinningspatiallygroupspointsinaMapView
intobinsclearlydefiningtheareaaggregatingfeaturesinmapspace.Thishasbeenavailablesinceversion4.24.
Seealso:
Sample-Pointclustering
Sample-Pointclusteringwithvisualvariables
Sample-Filterclusteredpoints
Sample-Pointstylesforcities
Examples:
//clusterspointsbasedontheirspatialproximitytootherpoints
layer.featureReduction={
type:"cluster",
clusterRadius:100
};
//thinsfeaturesintheview
layer.featureReduction={
type:"selection"
};
//Aggregatesfeaturestobins
layer.featureReduction={
type:"binning",
renderer:{
type:"simple",//autocastsasnewSimpleRenderer()
symbol:{
type:"simple-fill",//autocastsasnewSimpleFillSymbol()
outline:{//autocastsasnewSimpleLineSymbol()
width:0.5,
color:"white"
}
},
visualVariables:[{
type:"color",
field:"aggregateCount",
stops:[
{value:1,color:"white"},
{value:1000,color:"blue"}
]
}]
},
popupTemplate:{
content:"Thisbincontains{aggregateCount}features.",
fieldInfos:[{
fieldName:"aggregateCount",
format:{
digitSeparator:true,
places:0
}
}]
}
};
fieldsField[]autocast
Autocastsfrom
Object[]
Anarrayoffieldsinthelayer.Eachfieldrepresentsanattribute
thatmaycontainavalueforeachfeatureinthelayer.Forexample,
afieldnamedPOP_2015,storesinformationabouttotalpopulationasa
numericvalueforeachfeature;thisvaluerepresentsthetotalnumber
ofpeoplelivingwithinthegeographicboundsofthefeature.
WhencreatingaFeatureLayerfromclient-sidefeatures,thisproperty
shouldbesetintheconstructoralongwiththesourceproperty.TheobjectId
fieldalsomustbeseteitherinthisarrayorintheobjectIdFieldproperty.
Seealso:
source
objectIdField
Addanarrayofclient-sidefeatures
Example:
//defineeachfield'sschema
constfields=[
newField({
name:"ObjectID",
alias:"ObjectID",
type:"oid"
}),newField({
name:"description",
alias:"Description",
type:"string"
}),newField({
name:"title",
alias:"Title",
type:"string"
})
];
//Seethesamplesnippetforthesourceandrendererproperties
constlayer=newFeatureLayer({
//geometryTypeandspatialReferenceareinferred
//fromtheinputsourcefeatures
source:features,
//ObjectIDfieldisinferredfromthefieldsarray
fields:fields,
renderer:renderer
});
fieldsIndexFieldsIndexreadonly
Since:ArcGISAPIforJavaScript4.12
Aconvenientpropertythatcanbeusedtomakecase-insensitivelookupsforafieldbyname.
Itcanalsoprovidealistofthedatefieldsinalayer.
Example:
//lookupafieldbyname.nameiscase-insensitive
constfield=layer.fieldsIndex.get("SoMeFiEld");
if(field){
console.log(field.name);//SomeField
}
floorInfoLayerFloorInfoautocast
Since:ArcGISAPIforJavaScript4.19
Whenafeaturelayerisconfiguredasfloor-aware,ithasafloorInfopropertydefined.
Afloor-awarelayerisalayerthatcontainsindoorGISdatarepresentingfeaturesthat
canbelocatedonaspecificfloorofabuilding.
formTemplateFormTemplateautocast
Since:ArcGISAPIforJavaScript4.16
Thetemplateusedinanassociatedlayer'sFeatureForm.Allofthepropertiesandfieldconfigurationssetonthelayer'sFeatureFormarehandledviatheFormTemplate.
Seealso:
Sample-UpdateFeatureAttributes
Example:
//CreatetheFieldElementstopassintothetemplate
constfieldElement1=newFieldElement({
fieldName:"firstname",
label:"Firstname",
description:"Firstnameofemergencycontact"
});
constfieldElement2=newFieldElement({
fieldName:"lastname",
label:"Lastname",
description:"Lastnameofemergencycontact"
});
//Createtheform'stemplate
constformTemplate=newFormTemplate({
title:"Emergencyinformation",
description:"Incaseofemergency,updateanyadditionalinformationneeded",
elements:[fieldElement1,fieldElement2]//passinarrayoffieldelementsfromabove
});
//Passthetemplatetothelayer
featureLayer.formTemplate=formTemplate;
//PassthelayertotheFeatureForm
constform=newFeatureForm({
container:"form",//htmldivreferencingtheform
layer:featureLayer
});
fullExtentExtentautocast
inherited
Thefullextentofthelayer.Bydefault,thisisworldwide.Thispropertymaybeused
tosettheextentoftheviewtomatchalayer'sextentsothatitsfeatures
appeartofilltheview.Seethesamplesnippetbelow.
Example:
//Oncethelayerloads,settheview'sextenttothelayer'sfullextent
layer.when(function(){
view.extent=layer.fullExtent;
});
gdbVersionString
Theversionofthegeodatabaseofthefeatureservicedata.Read
theOverviewofversioningtopicformoredetails
aboutthiscapability.
geometryFieldsInfoGeometryFieldsInforeadonly
Since:ArcGISAPIforJavaScript4.19
Providesinformationonthesystemmaintainedareaandlengthfieldsalongwiththeirrespectiveunits.
Seealso:
ArcGISRESTAPIdocumentation
geometryTypeString
Thegeometrytypeoffeaturesinthelayer.Allfeaturesmustbeofthesametype.
Thispropertyisread-onlywhenthelayeriscreatedfromaurl.
WhencreatingaFeatureLayerfromclient-sidefeatures,thispropertyis
inferredbythegeometryTypeofthefeaturesprovidedinthelayer'ssource
property.Ifthelayer'ssourceisanemptyarrayatthetimeofinitialization,
thispropertymustbeset.
PossibleValues:"point"|"multipoint"|"polyline"|"polygon"|"multipatch"|"mesh"
Seealso:
Addanarrayofclient-sidefeatures
hasMBoolean
Indicateswhethertheclient-sidefeaturesinthelayerhaveM(measurement)values.
UsethesupportsMpropertyintheFeatureLayer'scapabilities.data
objecttoverifyifMvaluesaresupportedonfeatureservicefeatures.
DefaultValue:undefined
hasZBoolean
Indicateswhethertheclient-sidefeaturesinthelayerhaveZ(elevation)values.
RefertoelevationInfofordetailsregardingplacementandrendering
offeatureswithz-valuesin3DSceneViews.
UsethesupportsZpropertyintheFeatureLayer'scapabilities.data
objecttoverifyifZvaluesaresupportedonfeatureservicefeatures.
DefaultValue:undefined
historicMomentDateautocast
Since:ArcGISAPIforJavaScript4.7
Thehistoricmomenttoquery.IfhistoricMomentisnotspecified,thequery
willapplytothecurrentfeatures.
idString
inherited
TheuniqueIDassignedtothelayer.Ifnotsetbythedeveloper,itisautomatically
generatedwhenthelayerisloaded.
isTableBooleanreadonly
Since:ArcGISAPIforJavaScript4.11
Returnstrueifthelayerisloadedfromanon-spatialtableinaservice.Non-spatialtablesdonothave
aspatialcolumnthatrepresentgeographicfeatures.
DefaultValue:false
Seealso:
Map.tables
WebMap.tables
Map.allTables
WebMap.allTables
labelingInfoLabelClass[]autocast
Autocastsfrom
Object[]
Thelabeldefinitionforthislayer,specifiedasanarrayof
LabelClass.Usethispropertytospecify
labelingpropertiesforthelayersuchaslabelexpression,placement,andsize.
MultipleLabelclasseswithdifferentwhereclausescanbeusedtodefineseveral
labelswithvaryingstylesonthesamefeature.Likewise,multiplelabelclasses
maybeusedtolabeldifferenttypesoffeatures(forexamplebluelabels
forlakesandgreenlabelsforparks).
SeetheLabelingguidepageformoreinformationandknownlimitations.
KnownLimitations
3DSceneViewsonlysupportdisplayingoneLabelClassperfeature.
Seealso:
Sample:Addmultiplelabelclassestoalayer
Sample:Multi-linelabels
Sample:Flatvs.volumetric3Dsymbollayers
Example:
conststatesLabelClass=newLabelClass({
labelExpressionInfo:{expression:"$feature.NAME"},
symbol:{
type:"text",//autocastsasnewTextSymbol()
color:"black",
haloSize:1,
haloColor:"white"
}
});
featureLayer.labelingInfo=[statesLabelClass];
labelsVisibleBoolean
Indicateswhethertodisplaylabelsforthislayer.Iftrue,labelswill
appearasdefinedinthelabelingInfoproperty.
KnownLimitations
3DSceneViewsonlysupportdisplayingoneLabelClassperfeature.
DefaultValue:true
layerIdNumber
ThelayerID,orlayerindex,ofaFeatureServicelayer.Thisisparticularlyusefulwhen
loadingasingleFeatureLayerwiththeportalItempropertyfromaservicecontaining
multiplelayers.Youcanspecifythisvalueinoneoftwoscenarios:
WhenloadingthelayerviatheportalItemproperty.
WhenpointingthelayerurldirectlytotheFeatureService.
IfalayerIdisnotspecifiedineitheroftheabovescenarios,thenthefirstlayer
intheservice(layerId=0)isselected.
Examples:
//loadsthethirdlayerinthegivenPortalItem
constlayer=newFeatureLayer({
portalItem:{
id:"8d26f04f31f642b6828b7023b84c2188"
},
layerId:2
});
//Ifnotspecified,thefirstlayer(layerId:0)willbereturned
constlayer=newFeatureLayer({
portalItem:{
id:"8d26f04f31f642b6828b7023b84c2188"
}
});
//CanalsobeusedifURLpointstoserviceandnotlayer
constlayer=newFeatureLayer({
//Noticethattheurldoesn'tendwith/2
url:"http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/MonterreyBayCanyon_WFL/FeatureServer",
layerId:2
});
//Thiscodereturnsthesamelayerastheprevioussnippet
constlayer=newFeatureLayer({
//ThelayeridisspecifiedintheURL
url:"http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/MonterreyBayCanyon_WFL/FeatureServer/2",
});
legendEnabledBoolean
Indicateswhetherthelayerwillbeincludedinthelegend.
DefaultValue:true
listModeString
inherited
IndicateshowthelayershoulddisplayintheLayerListwidget.
Thepossiblevaluesarelistedbelow.
Value
Description
show
Thelayerisvisibleinthetableofcontents.
hide
Thelayerishiddeninthetableofcontents.
hide-children
IfthelayerisaGroupLayer,BuildingSceneLayer,KMLLayer,MapImageLayer,TileLayerorWMSLayer,hidethechildrenlayersfromthetableofcontents.
PossibleValues:"show"|"hide"|"hide-children"
DefaultValue:show
loadedBooleanreadonly
inherited
Indicateswhetherthelayer'sresourceshaveloaded.Whentrue,
allthepropertiesoftheobjectcanbeaccessed.
DefaultValue:false
loadErrorErrorreadonly
inherited
TheErrorobjectreturnedifanerroroccurredwhileloading.
DefaultValue:null
loadStatusStringreadonly
inherited
Representsthestatusofaloadoperation.
Value
Description
not-loaded
Theobject'sresourceshavenotloaded.
loading
Theobject'sresourcesarecurrentlyloading.
loaded
Theobject'sresourceshaveloadedwithouterrors.
failed
Theobject'sresourcesfailedtoload.SeeloadErrorformoredetails.
PossibleValues:"not-loaded"|"loading"|"failed"|"loaded"
DefaultValue:not-loaded
loadWarningsObject[]readonly
inherited
Alistofwarningswhichoccurredwhileloading.
maxScaleNumber
Themaximumscale(mostzoomedin)atwhichthelayerisvisibleintheview.
Ifthemapiszoomedinbeyondthisscale,thelayerwillnotbevisible.
Avalueof0meansthelayerdoesnothaveamaximumscale.
ThemaxScalevalueshouldalwaysbesmallerthantheminScalevalue,
andgreaterthanorequaltotheservicespecification.
DefaultValue:0
Examples:
//Thelayerwillnotbevisiblewhentheviewiszoomedinbeyondascaleof1:1,000
layer.maxScale=1000;
//Thelayer'svisibilityisnotrestrictedtoamaximumscale.
layer.maxScale=0;
minScaleNumber
Theminimumscale(mostzoomedout)atwhichthelayerisvisibleintheview.
Ifthemapiszoomedoutbeyondthisscale,thelayerwillnotbevisible.
Avalueof0meansthelayerdoesnothaveaminimumscale.
TheminScalevalueshouldalwaysbelargerthanthemaxScalevalue,
andlesserthanorequaltotheservicespecification.
DefaultValue:0
Examples:
//Thelayerwillnotbevisiblewhentheviewiszoomedoutbeyondascaleof1:3,000,000
layer.minScale=3000000;
//Thelayer'svisibilityisnotrestrictedtoaminimumscale.
layer.minScale=0;
objectIdFieldString
Thenameofanoidfieldcontaining
auniquevalueoridentifierforeachfeatureinthelayer.
ThispropertyisrequiredwhenconstructingaFeatureLayerfromacollection
ofclient-sidefeatures.Ifnotspecified,itwillbeinferred
fromthefieldsarray.
Seealso:
fields
Addanarrayofclient-sidefeatures
Example:
//Seethesamplesnippetforthesourceandfieldsproperties
constlayer=newFeatureLayer({
source:features,
fields:fields,
objectIdField:"ObjectID",//fieldnameoftheObjectIDs
geometryType:"point",
renderer:
});
opacityNumber
inherited
Theopacityofthelayer.Thisvaluecanrangebetween1and0,where0is100percent
transparentand1iscompletelyopaque.
DefaultValue:1
Example:
//Makesthelayer50%transparent
layer.opacity=0.5;
orderByObject[]
Since:ArcGISAPIforJavaScript4.21
Determinestheorderinwhichfeaturesaredrawnintheview.You
cansortfeaturesbyafieldvalueorthevaluereturnedfroman
Arcadeexpressioninascendingordescendingorder.
Whennull(default),featuresaredrawnintheordertheyarereturnedfrom
theserviceorclient.
KnownLimitations
ThispropertyonlycontrolsfeaturedrawingorderinMapView.Configuring
featuredrawingorderinSceneViewisnotsupported.
Thispropertydoesnotcontrolthedrawingorderofclusters.Itonlyappliestoindividualfeatures.
FeaturedrawingorderconfigurationsdefinedwithArcadeexpressionscannotbesavedtowebmaps.
Currently,youcanonlysortfeaturesbyonefieldorexpression.
Properties:
field
String
optional
Thenumberordatefieldwhosevalueswillbeusedtosortfeatures.
valueExpression
String
optional
AnArcadeexpression
followingthespecificationdefinedbytheArcadeFeatureZProfile.
Expressionsmayreferencefieldvaluesusingthe$featureglobalvariableandmustreturnanumberor
adaterepresentingthez-valueusedtosortfeatures.
order
String
optional
DefaultValue:ascending
Thesortorder.Ifascending,thenfeatures
withsmallerdatavalues(theyusuallyhavesmallersymbolsinsizevisualizations)willbedrawnontopoffeatures
withlargerdatavalues.Ifdescending,thenfeatures
withlargerdatavalues(usuallylargersymbolsinsizevisualizations)willbedrawnontopoffeatures
withsmallerdatavalues.Ifdatevaluesareused,thenascendingmeansfeatureswitholdervalueswill
bedrawnontopoffeatureswithmorerecentdates.Adescendingorderfordatesindicatesfeatureswithmore
recentvalueswillbedrawnontopoffeatureswitholdervalues.
PossibleValues:"ascending"|"descending"
DefaultValue:null
Seealso:
ArcadeFeatureZProfile
Examples:
//Featureswithsmallerpopulationvalueswill
//berenderedontopoflargerfeatures.
layer.orderBy=[{
field:"POPULATION"
}];
//Featureswithlargerpopulationvalueswill
//berenderedontopofsmallerfeatures.
layer.orderBy=[{
field:"POPULATION",
order:"descending"
}];
//Ordersfeaturesbydateindescendingorder.
//Themostrecentfeatureswillberendered
//ontopofolderfeatures.
layer.orderBy=[{
field:"Alarm_Date",
order:"descending"
}];
//Ordersfeaturesbystormwarningdurationindescendingorder.
//Warningswithlongerdurations
//berenderedontopofwarningswithshorterdurations.
layer.orderBy=[{
valueExpression:"DateDiff($feature.Watch_End,$feature.Watch_Start,'hours')",
order:"descending"
}];
//Ordersfeaturesbydatavaluesusedinasizevisualvariable
constsizeVariable=layer.renderer.visualVariables.find(vv=>vv.type==="size");
const{field,valueExpression}=sizeVariable;
layer.orderBy=[{
field,
valueExpression,
order:"ascending"
}];
outFieldsString[]
Anarrayoffieldnamesfromtheservicetoincludewitheachfeature.
Tofetchthevaluesfromallfieldsinthelayer,use["*"].Fieldsspecifiedin
outFieldswillberequestedalongsidewithrequiredfieldsforrendering,
labelingandsettingtheelevationinfoforthelayer.
TherequiredfieldsandoutFieldsareusedtopopulate
FeatureLayerView.availableFields.
Setthispropertytoincludethefieldsthatwillbeusedforclient-side
queries
ifthefieldsarenotpartofrequiredfieldsusedforrendering.
DefaultValue:null
Seealso:
FeatureLayerView.availableFields
fieldUtils
Examples:
//Includesallfieldsfromtheserviceinthelayer
fl.outFields=["*"];
//Getthespecifiedfieldsfromtheserviceinthelayer
//ThesefieldswillbeaddedtoFeatureLayerView.availableFields
//alongwithrenderingandlabelingfields.Usethesefields
//forclient-sidefilteringandquerying.
fl.outFields=["NAME","POP_2010","FIPS","AREA"];
//settheoutFieldsforthelayercomingfromwebmap
webmap.when(function(){
layer=webmap.layers.getItemAt(1);
layer.outFields=["*"];
});
popupEnabledBoolean
Indicateswhethertodisplaypopupswhenfeaturesinthelayerareclicked.ThelayerneedstohaveapopupTemplatetodefinewhat
informationshouldbedisplayedinthepopup.Alternatively,adefaultpopuptemplatemaybeautomaticallyusedif
Popup.defaultPopupTemplateEnabledissettotrue.
DefaultValue:true
Seealso:
createPopupTemplate
View
popupTemplatePopupTemplateautocast
Thepopuptemplateforthelayer.Whensetonthelayer,thepopupTemplate
allowsuserstoaccessattributesanddisplaytheirvaluesinthe
view'spopupwhenafeatureisselected
usingtextand/orcharts.SeethePopupTemplatesample
foranexampleofhowPopupTemplateinteractswitha
FeatureLayer.
AdefaultpopuptemplateisautomaticallyusedifnopopupTemplatehasbeendefinedwhen
Popup.defaultPopupTemplateEnabled
issettotrue.
Seealso:
createPopupTemplate
View
portalItemPortalItem
Theportalitemfromwhichthelayerisloaded.Iftheportalitemreferences
aFeatureServiceorSceneService,thenyoucanspecifyasinglelayer
toloadwiththelayerIdproperty.
Beginningwithversion4.17,itispossibletoloadtablesfromfeatureserviceitemshostedinArcGISOnlineandArcGISEnterprise.
Thisonlyappliestofeaturelayers,andwillsuccessfullyload
ifFeatureLayer.isTablereturnstrue.
Examples:
//WhilethisexampleusesFeatureLayer,thissamepatterncanbe
//usedforotherlayersthatmaybeloadedfromportalItemids.
constlyr=newFeatureLayer({
portalItem:{//autocastsasnewPortalItem()
id:"caa9bd9da1f4487cb4989824053bb847"
}//thefirstlayerintheserviceisreturned
});
//Sethostnamewhenusinganon-premiseportal(defaultisArcGISOnline)
//esriConfig.portalUrl="http://myHostName.esri.com/arcgis";
//WhilethisexampleusesFeatureLayer,thissamepatterncanbe
//usedforSceneLayers.
constlyr=newFeatureLayer({
portalItem:{//autocastsasnewPortalItem()
id:"8d26f04f31f642b6828b7023b84c2188"
},
//loadsthethirditeminthegivenfeatureservice
layerId:2
});
//ThissnippetloadsatablehostedinArcGISOnline.
consttable=newFeatureLayer({
portalItem:{//autocastsasesri/portal/PortalItem
id:"123f4410054b43d7a0bacc1533ceb8dc"
}
});
//Beforeaddingthetabletothemap,itmustfirstbeloadedandconfirmitistherighttype.
table.load().then(function(){
if(table.isTable){
map.tables.add(table);
}
});
refreshIntervalNumber
Since:ArcGISAPIforJavaScript4.6
Refreshintervalofthelayerinminutes.Valueof0indicatesnorefresh.
Ateachrefreshinterval,thedataisonlyupdatedifthelastEditDateinthelayer'smetadataisdifferentfromthelastEditDatefield.
IfthelastEditDatemetadatainfoisnotavailable,theFeatureLayerrefreshesunconditionally.
DefaultValue:0
Seealso:
refresh()
refreshevent
Example:
//thelayerwillberefreshedevery6seconds.
layer.refreshInterval=0.1;
relationshipsRelationship[]readonly
Since:ArcGISAPIforJavaScript4.9
Arrayofrelationshipssetupforthelayer.Eachobjectinthearraydescribesthelayer's
relationshipwithanotherlayerortable.
Seealso:
FeatureLayer.queryRelatedFeatures
Example:
//printoutlayer'srelationshiplengthandeachrelationshipinfotoconsole
featureLayer.when(function(){
console.log("layerrelationships",featureLayer.relationships.length);
featureLayer.relationships.forEach(function(relationship){
console.log("relationshipid:",relationship.id)
console.log("relationshipcardinality:",relationship.cardinality)
console.log("relationshipkeyfield:",relationship.keyField)
console.log("relationshipname:",relationship.name)
console.log("relationshiprelatedTableId:",relationship.relatedTableId)
});
});
rendererRendererautocast
Therendererassignedtothelayer.Therendererdefineshowto
visualizeeachfeatureinthelayer.Dependingontherenderertype,
featuresmaybevisualizedwiththesamesymbol,orwithvaryingsymbols
basedonthevaluesofprovidedattributefieldsorfunctions.
However,whencreatingaFeatureLayerfromclient-sidefeatures,thispropertymust
bespecifiedinthelayer'sconstructoralongwiththe
source,
fields,objectIdFieldproperties.
Seealso:
Creatingvisualizationsmanually
Manuallydefinedrenderers
Example:
//allfeaturesinthelayerwillbevisualizedwith
//a6ptblackmarkersymbolandathin,whiteoutline
layer.renderer={
type:"simple",//autocastsasnewSimpleRenderer()
symbol:{
type:"simple-marker",//autocastsasnewSimpleMarkerSymbol()
size:6,
color:"black",
outline:{//autocastsasnewSimpleLineSymbol()
width:0.5,
color:"white"
}
}
};
returnMBoolean
Whentrue,indicatesthatMvalueswillbereturned.When
false,indicatesthatMvalueswillneverbereturned.Thelayerview
determineswhethertoincludeMvaluesinfeaturequerieswhenthe
propertyvalueisundefined.
DefaultValue:undefined
returnZBoolean
Whentrue,indicatesthatz-valueswillalwaysbereturned.When
false,indicatesthatz-valueswillneverbereturned.Thelayerview
determineswhethertoincludez-valuesinfeaturequerieswhenthe
propertyvalueisundefined.
DefaultValue:undefined
screenSizePerspectiveEnabledBoolean
Since:ArcGISAPIforJavaScript4.4
Applyperspectivescalingtoscreen-sizepointsymbolsinaSceneView.
Whentrue,screensizedobjectssuchasicons,
labelsorcalloutsintegrate
betterinthe3Dscenebyapplyingacertainperspectiveprojectiontothe
sizingoffeatures.ThisonlyapplieswhenusingaSceneView.
layer.screenSizePerspectiveEnabled=true
layer.screenSizePerspectiveEnabled=false
KnownLimitations
Screensizeperspectiveiscurrentlynotoptimizedforsituationswherethecameraisveryneartheground,orforscenes
withpointfeatureslocatedfarfromthegroundsurface.Inthesecasesitmaybebettertoturnoffscreensizeperspective.
Asscreensizeperspectivechangesthesizebasedondistancetothecamera,itshouldbesettofalsewhenusingsizevisualvariables.
DefaultValue:true
Seealso:
Sample:Pointstylesforcities
serviceDefinitionExpressionStringreadonly
Since:ArcGISAPIforJavaScript4.16
Theservicedefinitionexpressionlimitsthefeaturesavailablefordisplayandquery.Youcandefineadditionalfiltersonthelayerinadditiontotheservicedefinitionexpression
bysettinglayer'sdefinitionExpression.Forexample,iftheservicedefinitionexpressionissettodisplaydatawhere"STATE_NAME='California'"
youcouldusedefinitionExpressiontoonlydisplayasubsetofthefeaturesinCalifornia,forexampleusing"COUNTY='SanDiego'".
Seealso:
Sethostedfeaturelayerviewdefinition
sourceCollectionautocast
Autocastsfrom
Object[]
AcollectionofGraphicobjectsusedtocreateaFeatureLayer.
ThegeometryofeachfeatureallmusthaveamatchinggeometryType.
ThispropertymustbesetwhencreatingaFeatureLayerfromclient-sidefeatures.
WhencreatingaFeatureLayerfromclient-sidefeatures,theobjectIdfieldmustbeset
eitherinthefieldsarrayorviaobjectIdField.
ThespatialReferenceandgeometryTypeproperties
aredeterminedbasedonthefeaturesprovidedtothisproperty.Ifthesourceisanempty
arrayatthetimeoflayerinitialization,thengeometryTypemustbeset.
ThesourceisnotupdatedaftertheFeatureLayerisinitialized.UseapplyEdits()methodtoadd,remove,andupdatefeatures
fromaclient-sidefeaturelayeratruntime.OnceapplyEdits()resolvessuccessfully,usequeryFeatures()
toreturnupdatedfeatures.
Seealso:
Addanarrayofclient-sidefeatures
Example:
letfeatures=[
{
geometry:{
type:"point",
x:-100,
y:38
},
attributes:{
ObjectID:1,
DepArpt:"KATL",
MsgTime:Date.now(),
FltId:"UAL1"
}
},
...
];
//geometryTypeandspatialReferenceofthelayer
//willbeinferredfromthefirstfeatureinthearray
//ifithasageometry.
letlayer=newFeatureLayer({
source:features,//autocastasaCollectionofnewGraphic()
objectIdField:"ObjectID"
});
sourceJSONObject
Since:ArcGISAPIforJavaScript4.13
Thefeatureservice'smetadataJSON
exposedbytheArcGISRESTAPI.Whilemostcommonlyusedproperties
areexposedontheFeatureLayerclassdirectly,thispropertygivesaccesstoallinformationreturned
bythefeatureservice.ThispropertyisusefulifworkinginanapplicationbuiltusinganolderversionoftheAPI
whichrequiresaccesstofeatureservicepropertiesfromamorerecentversion.
spatialReferenceSpatialReferenceautocast
Thespatialreferenceofthelayer.Whencreatingthelayerfroma
url,thespatialreferenceisreadfromtheservice.
WhencreatingaFeatureLayerfromclient-sidefeatures,thispropertyis
inferredfromthegeometriesofthefeaturesprovidedinthesource
property.
templatesFeatureTemplate[]
Since:ArcGISAPIforJavaScript4.4
Anarrayoffeaturetemplatesdefinedinthefeaturelayer.
SeeArcGISProsubtypesdocument.
timeExtentTimeExtentautocast
Since:ArcGISAPIforJavaScript4.14
Thelayer'stimeextent.Whenthelayer'suseViewTimeisfalse,thelayer
instructstheviewtoshowdatafromthelayerbasedonthistimeextent.
IftheuseViewTimeistrue,andbothlayerandviewtimeextentsareset,thenfeaturesthatfallwithin
theintersectionoftheviewandlayertimeextentswillbedisplayed.
Forexample,ifthelayer'stimeextentissettodisplayfeaturesbetween1970and1975and
theviewhasatimeextentsetto1972-1980,theeffectivetimeonthefeaturelayerwillbe1972-1975.
DefaultValue:null
Examples:
if(!layer.useViewTime){
if(layer.timeExtent){
console.log("CurrenttimeExtent:",layer.timeExtent.start,"-",layer.timeExtent.end}
}else{
console.log("Thelayerwilldisplaydatawithintheview'stimeExtent.");
console.log("Currentview.timeExtent:",view.timeExtent.start,"-",view.timeExtent.end}
}
}
//setthetimeExtentonthelayeranduseViewTimefalse
//Inthiscase,thelayerwillhonoritstimeExtentandignore
//theview'stimeExtent
constlayer=newImageryLayer({
url:"https://sampleserver6.arcgisonline.com/arcgis/rest/services/ScientificData/SeaTemperature/ImageServer",
timeExtent:{
start:newDate(2014,4,18),
end:newDate(2014,4,19)
},
useViewTime:false
});
//timeExtentissetonthelayerandtheview
//Inthiscase,thelayerwilldisplayfeaturesthatfall
//withintheintersectionofviewandlayertimeextents
//featureswithinJan1,1976-Jan1,1981willbedisplayed
constview=newMapView({
timeExtent:{
start:newDate(1976,0,1),
end:newDate(2002,0,1)
}
});
constlayer=newFeatureLayer({
url:myUrl,
timeExtent:{
start:newDate(1974,0,1),
end:newDate(1981,0,1)
}
});
timeInfoTimeInfoautocast
Since:ArcGISAPIforJavaScript4.11
TimeInfoprovidesinformationsuchasdatefieldsthatstore
start
andendtime
foreachfeatureandthefullTimeExtent
forthelayer.ThetimeInfoproperty,alongwithitsstartFieldandendFieldproperties,mustbesetatthe
timeoflayerinitializationifitisbeingsetfora
CSVLayer,
GeoJSONLayeror
FeatureLayer
initializedfromclient-sidefeatures.
ThefullTimeExtentfortimeInfois
automaticallycalculatedbasedonitsstartFieldandendFieldproperties.
ThetimeInfoparameterscannotbechangedafterthelayerisloaded.
DefaultValue:null
Example:
//creategeojsonlayerfromusgsearthquakesgeojsonfeed
constgeojsonLayer=newGeoJSONLayer({
url:"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojson",
copyright:"USGSEarthquakes",
fields:[
{"name":"mag","type":"double"},
{"name":"place","type":"string"},
{"name":"time","type":"date"},//datefield
{"name":"depth","type":"double"}
],
//timeInfocanbeusedtodotemporalqueries
//setthestartFieldandendField.
//timeExtentisautomaticallycalculatedfromthe
//thestartandenddatefields
//ThedatevaluesmustbeinmillisecondsnumberfromtheUNIXepochspecifiedinUTC.
timeInfo:{
startField:"time"
}
});
timeOffsetTimeIntervalautocast
Since:ArcGISAPIforJavaScript4.14
AtemporaryoffsetofthetimedatabasedonacertainTimeInterval.Thisallows
userstooverlayfeaturesfromtwoormoretime-awarelayerswithdifferenttimeextents.
Forexample,ifalayerhasdatarecordedfortheyear1970,anoffsetvalueof2yearswouldtemporarilyshiftthedatato
1972.Youcanthenoverlaythisdatawithdatarecordedin1972.
Atimeoffsetcanbeusedfordisplaypurposesonly.Thequeryandselectionarenotaffectedbytheoffset.
DefaultValue:null
Example:
//OffsetaCSVLayercontaininghurricanesfrom2015sothattheyappearin2019(+4years).
letlayer=newCSVLayer({
url:`hurricanes-and-storms-2015.csv`,
timeOffset:{
value:4,
unit:"years"
},
timeInfo:{
startField:"ISO_time"
},
renderer:{
type:"simple",
symbol:{
type:"simple-marker",
size:6,
color:"red",
outline:{
width:0.5,
color:"black"
}
}
}
});
titleString
ThetitleofthelayerusedtoidentifyitinplacessuchastheLegend
andLayerListwidgets.
Whenloadingalayerbyserviceurl,thetitleisderivedfromtheservicename.
Iftheservicehasseverallayers,thenthetitleofeachlayerwillbetheconcatenationoftheservicename
andthelayername.
Whenthelayerisloadedfromaportalitem,thetitleoftheportalitemwillbeusedinstead.
Finally,ifalayerisloadedaspartofawebmaporawebscene,thenthetitleofthelayerasstoredinthewebmap/webscenewillbeused.
typeStringreadonly
ForFeatureLayerthetypeisalways"feature".
typeIdFieldString
Since:ArcGISAPIforJavaScript4.4
ThenameofthefieldholdingthetypeIDorsubtypesforthefeatures.
SeeArcGISProsubtypesdocument.
typesFeatureType[]
Since:ArcGISAPIforJavaScript4.4
AnarrayofsubtypesdefinedinthefeatureserviceexposedbyArcGISRESTAPI.
Eachitemincludesinformationaboutthetype,suchasthetypeID,name,anddefinitionexpression.
urlString
TheabsoluteURLoftheRESTendpointofthelayer,non-spatialtableorservice.TheURLmayeitherpointtoa
resourceonArcGISEnterpriseorArcGISOnline.
Iftheurlpointsdirectlytoaservice,thenthelayermustbespecifiedinthe
layerIdproperty.IfnolayerIdisgiven,thenthefirstlayerintheservicewillbeloaded.
Examples:
//HostedFeatureServiceonArcGISOnline
layer.url="http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/origins/FeatureServer/0";
//LayerfromMapServiceonArcGISServer
layer.url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2";
//CanalsobeusedifURLpointstoserviceandnotlayer
constlayer=newFeatureLayer({
//Noticethattheurldoesn'tendwith/2
url:"http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/MonterreyBayCanyon_WFL/FeatureServer",
layerId:2
});
//Non-spatialtableinSanFranciscoincidentsservice.
consttable=newFeatureLayer({
url:"https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/1"
});
//tablemustbeloadedsoitcanbeusedintheapp.
table.load().then(function(){
//tableisloaded.readytobequeried.
});
useViewTimeBoolean
Since:ArcGISAPIforJavaScript4.14
Determinesifthelayerwillupdateitstemporaldatabasedontheview's
timeExtent.Whenfalse,thelayerwilldisplayitstemporal
databasedonthelayer'stimeExtent,regardlessofchangestotheview.
Ifbothviewandlayertimeextentsaresetwhilethispropertyistrue,thenthefeaturesthatfallwithin
theintersectionoftheviewandlayertimeextentswillbedisplayed.
Forexample,ifalayer'stimeextentissettodisplayfeaturesbetween1970and1975and
theviewhasatimeextentsetto1972-1980,theeffectivetimeonthefeaturelayerwillbe1972-1975.
DefaultValue:true
Example:
if(featureLayer.useViewTime){
console.log("Displayingdatabetween:",view.timeExtent.start,"-",view.timeExtent.end);
}
versionNumberreadonly
TheversionofArcGISServerinwhichthelayerispublished.
Example:
//Printstheversionnumbertotheconsole-e.g.10.2,10.3,10.41,etc.
console.log(layer.version);
visibleBoolean
inherited
IndicatesifthelayerisvisibleintheView.Whenfalse,
thelayermaystillbeaddedtoaMap
instancethatisreferencedinaview,butitsfeatureswillnotbevisibleintheview.
DefaultValue:true
Example:
//Thelayerisnolongervisibleintheview
layer.visible=false;
MethodOverview
Showinheritedmethods
Hideinheritedmethods
Name
ReturnType
Summary
Class
addAttachment()
PromisemoredetailsAddsanattachmenttoafeature.moredetailsFeatureLayer
applyEdits()
PromisemoredetailsApplieseditstofeaturesinalayer.moredetailsFeatureLayer
cancelLoad()
moredetailsCancelsaload()operationifitisalreadyinprogress.moredetailsLayer
clone()
thismoredetailsCreatesadeepcloneofthisobject.moredetailsFeatureLayer
createLayerView()
PromisemoredetailsCalledbytheviews,suchasMapViewandSceneView,whenthelayerisaddedtotheMap.layerscollectionandalayerviewmustbecreatedforit.moredetailsLayer
createPopupTemplate()
PopupTemplatemoredetailsCreatesapopuptemplateforthelayer,populatedwithallthefieldsofthelayer.moredetailsFeatureLayer
createQuery()
QuerymoredetailsCreatesqueryparameterobjectthatcanbeusedtofetchfeaturesthatsatisfythelayer'sconfigurationssuchasdefinitionExpression,gdbVersion,andhistoricMoment.moredetailsFeatureLayer
deleteAttachments()
PromisemoredetailsDeletesattachmentsfromafeature.moredetailsFeatureLayer
destroy()
moredetailsDestroysthelayerandanyassociatedresources(includingitsportalItem,ifitisapropertyonthelayer).moredetailsLayer
emit()
BooleanmoredetailsEmitsaneventontheinstance.moredetailsLayer
fetchAttributionData()
Promise