ElevationProfile | API Reference | ArcGIS API for JavaScript 3.41

文章推薦指數: 80 %
投票人數:10人

The Elevation Profile widget allows a user to create an elevation profile based on a polyline geometry input parameter or existing features. ArcGISDevelopers Features Pricing Documentation YourName SignOut Home Guide APIReference SampleCode Community HideTableofContents APIReferenceOverview Setupadevelopmentenvironment PreferredArgumentAliases esri basemaps Color config Credential domUtils Graphic graphicsUtils IdentityManager IdentityManagerBase ImageSpatialReference InfoTemplate InfoWindowBase kernel lang Map OperationBase request ServerInfo SnappingManager SpatialReference TimeExtent UndoManager units urlUtils esri/arcadeProfiles fieldCalculateProfile labelingProfile popupProfile visualizationProfile esri/arcgis OAuthInfo Portal PortalComment PortalFolder PortalGroup PortalItem PortalQueryResult PortalRating PortalUser utils esri/dijit AttributeInspector Attribution Basemap BasemapGallery BasemapLayer BasemapToggle BookmarkItem Bookmarks ClassedColorSlider ClassedSizeSlider ColorInfoSlider ColorPicker Directions ElevationProfile FeatureTable Gallery Gauge Geocoder HeatmapSlider HistogramTimeSlider HomeButton HorizontalSlider ImageServiceMeasure InfoWindow InfoWindowLite LayerList LayerSwipe Legend LocateButton Measurement ObliqueViewer OpacitySlider OverviewMap Popup PopupMobile PopupTemplate Print RendererSlider Scalebar Search SizeInfoSlider SymbolStyler TimeSlider VisibleScaleRangeSlider esri/dijit/analysis AggregatePoints AnalysisBase CalculateDensity ChooseBestFacilities ConnectOriginsToDestinations CreateBuffers CreateDriveTimeAreas CreateViewshed CreateWatersheds DeriveNewLocations DissolveBoundaries EnrichLayer ExtractData FindExistingLocations FindHotSpots FindNearest FindSimilarLocations InterpolatePoints MergeLayers OverlayLayers PlanRoutes SummarizeNearby SummarizeWithin TraceDownstream esri/dijit/editing Add AttachmentEditor Cut Delete Editor TemplatePicker Union Update esri/dijit/geoenrichment DataBrowser Infographic InfographicsCarousel InfographicsOptions InfographicsOptionsItem esri/dijit/geoenrichment/ReportPlayer DataProviderGE PlayerCommands PlayerResizeModes PlayerThemes PlayerViewModes PlayerZoomBehaviors ReportPlayer esri/dijit/util busyIndicator esri/geometry Circle coordinateFormatter Extent geodesicUtils GeographicTransformation GeographicTransformationStep Geometry geometryEngine geometryEngineAsync jsonUtils mathUtils Multipoint normalizeUtils Point Polygon Polyline projection scaleUtils ScreenPoint screenUtils webMercatorUtils esri/layer/pixelFilters StretchFilter esri/layers ArcGISDynamicMapServiceLayer ArcGISImageServiceLayer ArcGISImageServiceVectorLayer ArcGISTiledMapServiceLayer CodedValueDomain CSVLayer DataAdapterFeatureLayer DataSource DimensionalDefinition Domain DynamicLayerInfo DynamicMapServiceLayer FeatureEditResult FeatureLayer FeatureTemplate FeatureType Field GeoRSSLayer GraphicsLayer ImageParameters ImageServiceParameters InheritedDomain JoinDataSource KMLFolder KMLGroundOverlay KMLLayer LabelClass LabelLayer Layer LayerDataSource LayerDrawingOptions LayerInfo LayerMapSource LayerSource LayerTimeOptions LOD MapImage MapImageLayer MosaicRule OpenStreetMapLayer PixelBlock QueryDataSource RangeDomain RasterDataSource RasterFunction RasterLayer StreamLayer TableDataSource TiledMapServiceLayer TileInfo TimeInfo TimeReference VectorTileLayer WCSConnection WCSCoverageDescription WCSLayer WebTiledLayer WFSLayer WMSLayer WMSLayerInfo WMTSLayer WMTSLayerInfo esri/plugins FeatureLayerStatistics spatialIndex esri/process Processor SpatialIndex esri/renderers BlendRenderer ClassBreaksRenderer DotDensityRenderer HeatmapRenderer jsonUtils Renderer ScaleDependentRenderer SimpleRenderer smartMapping SymbolAger TemporalRenderer TimeClassBreaksAger TimeRampAger UniqueValueRenderer VectorFieldRenderer esri/styles basic choropleth heatmap relationship size type esri/support expressionUtils esri/symbols CartographicLineSymbol FillSymbol Font jsonUtils LineSymbol MarkerSymbol PictureFillSymbol PictureMarkerSymbol SimpleFillSymbol SimpleLineSymbol SimpleMarkerSymbol Symbol TextSymbol esri/tasks AddressCandidate AlgorithmicColorRamp AreasAndLengthsParameters BufferParameters ClassBreaksDefinition ClassificationDefinition ClosestFacilityParameters ClosestFacilitySolveResult ClosestFacilityTask ColorRamp DataFile DataLayer Date DensifyParameters DirectionsFeatureSet DistanceParameters FeatureSet FindParameters FindResult FindTask GeneralizeParameters GenerateRendererParameters GenerateRendererTask GeometryService Geoprocessor GPMessage IdentifyParameters IdentifyResult IdentifyTask ImageServiceIdentifyParameters ImageServiceIdentifyResult ImageServiceIdentifyTask ImageServiceMeasureParameters ImageServiceMeasureTask JobInfo LegendLayer LengthsParameters LinearUnit Locator MultipartColorRamp NAMessage NAOutputLine NAOutputPolygon NATravelDirection NATypes NAUTurn OffsetParameters ParameterValue PrintParameters PrintTask PrintTemplate ProjectParameters Query QueryTask RasterData RelationParameters RelationshipQuery RouteParameters RouteResult RouteTask ServiceAreaParameters ServiceAreaSolveResult ServiceAreaTask StatisticDefinition TrimExtendParameters UniqueValueDefinition esri/tasks/datareviewer BatchValidationJob BatchValidationJobInfo BatchValidationParameters BatchValidationTask DashboardResult DashboardTask GetResultsQueryParameters ReviewerAttributes ReviewerFilters ReviewerLifecycle ReviewerResultsTask ReviewerSession SessionOptions esri/tasks/geoenrichment AddressStudyArea DriveBuffer DriveUnits GeographyLevel GeographyQuery GeographyQueryBase GeometryStudyArea IntersectingGeographies RingBuffer StandardGeographyQueryTask StandardGeographyStudyArea StudyArea SubGeographyQuery esri/tasks/locationproviders CoordinatesLocationProvider GeometryLocationProvider LocationProviderBase LocationProviderClientBase LocationProviderRemoteBase LocatorLocationProvider QueryTaskLocationProvider StandardGeographyQueryLocationProvider esri/toolbars Draw Edit ImageServiceMeasureTool Navigation esri/virtualearth VEAddress VEGeocoder VEGeocodeResult VETiledLayer esri/workers WorkerClient Printthispage Class:ElevationProfile [AMDModuleRequire|LegacyModuleRequire] Constructors|CSS|Properties|Methods|Events require(["esri/dijit/ElevationProfile"],function(ElevationProfile){/*codegoeshere*/}); Description (Addedatv3.14)(Currentlyinbeta)TheElevationProfilewidgetallowsausertocreateanelevationprofilebasedonapolylinegeometryinputparameterorexistingfeatures.NOTE:Currentlythereisaknownissuewhencreatinganelevationprofilethatcrossestheinternationaldatelinemultipletimes.Thismaycauseinaccurateresults.Also,itisonlysupportedusingAMD-stylecodingsyntax. Samples Searchforsamplesthatusethisclass. Constructors NameSummary newElevationProfile(options,srcNode)CreateanewElevationProfilewidgetusingthegivenDOMnode. CSSesri/dijit/ElevationProfile|Downloadsource Properties NameTypeSummary measureUnitsStringThemeasurementunitofthepolylinegeometry. profileGeometryGeometryThepolylineinputgeometryusedtocreatetheelevationprofile. titleStringThetitleoftheresultingelevationprofile. Methods NameReturntypeSummary clearProfile()NoneClearstheelevationprofilechart. destroy()NoneDestroythewidget. startup()NoneFinalizesthecreationoftheElevationProfilewidget. Events[OnStyleEvents|ConnectStyleEvent]AllOnStyleeventlistenersreceiveasingleeventobject.Additionally,theeventobjectalsocontainsa'target'propertywhosevalueistheobjectwhichfiredtheevent.Events NameEventObjectSummary clear-profileFireswhentheelevationprofileiscleared. elevation-values{ data: }Firesaftertheprofileisgenerated. loadFireswhenthewidgethasfullyloaded. title-changedFireswhenthetitleoftheelevationprofileischanged. update-profile{ profileResults: }Fireswhentheelevationprofileisupdated. OldEvents NameSummary ConstructorDetails newElevationProfile(options,srcNode) CreateanewElevationProfilewidgetusingthegivenDOMnode.Parameters: options Required Seeoptionstablebelowforthefulldescriptionsofthepropertiesneededforthisobject. srcNode Required ReferenceoridoftheHTMLelementwherethewidgetshouldberendered. optionsproperties: chartOptions Optional Thisobjectcontainspropertiesusedtorenderthechart.SeetheobjectspecificationstablebelowforthestructureofthechartOptionsobject. map Required Referencetothemap.Ifnomapisspecified,thevalueisnull. profileTaskUrl Required TheURLtotheelevationprofileservice. scalebarUnits Optional Themeasurementunitofthescalebarunits.Foralisting,pleaserefertoesri/unitsforadditionalhelp. ObjectSpecifications: axisFontColor Required TheHexadecimalfontcolorofthechartaxis. axisLabelFontSize Required Fontsizeofthelabelsalongthechartaxis. axisMajorTickColor Required TheHexadecimalfontcolorofthechart'stickmarks. axisTitleFontSize Required Fontsizeofthetitlealongthechartaxis. busyIndicatorBackgroundColor Required Thebackgroundcolorusedforthebusyindicator. busyIndicatorBackgroundOpacity Required Thetransparencyvalueofthebusyindicator. busyIndicatorFadeDuration Required Thefadedurationvalueofthebusyindicator. busyIndicatorImageUrl Required Urloftheimageusedtodisplayabusyindicator. chartTitleFontSize Required Fontsizeofthetitle. elevationBottomColor Required TheHexadecimalfontcolorofthebottomelevationline. elevationLineColor Required TheHexadecimalfontcoloroftheelevationprofileline. elevationMarkerStrokeColor Required TheHexadecimalfontcoloroftheindicatorthatappearsonthechartshowingtheelevationpeakforthatlocation.Defaultcolorisred. //thischangestheelevationMarkerStrokeColortocyan elevationMarkerStrokeColor:"#00FFFF" elevationMarkerSymbol Required Astringvaluerepresentingthescalablevectorgraphicusedforthesymbolthatdisplaysonthechartshowingtheelevationpeakforthatlocation.DefaultisX.Theseareoutlinedbelow. elevationMarkerSymbol:"m-6-6,l1212,m0-12,l-1212" /* CIRCLE:"m-3,0c0,-46,-46,0m-6,0c0,46,46,0", SQUARE:"m-3,-3l0,66,00,-6z", DIAMOND:"m0,-3l3,3-3,3-3,-3z", CROSS:"m0,-3l0,6m-3,-3l6,0", X:"m-3,-3l6,6m0,-6l-6,6", TRIANGLE:"m-3,3l3,-63,6z", TRIANGLE_INVERTED:"m-3,-3l3,63,-6z */ TochangethecolorusetheelevationStrokeMarkerColorconstructoroption. elevationTopColor Required TheHexadecimalfontcolorofthetopelevationline. indicatorFillColorSize Required TheHexadecimalfontcolorusedforthechartindicatorfill. indicatorFontColor Required TheHexadecimalfontcolorofthechartindicator. mapIndicatorSymbol Required EitheraSimpleMarkerSymbolorPictureMarkerSymbolindicatingwhatdisplaysonthepolylineandshowsthelocationofthatpointontheprofile.EithertypeofsymbolcanbedefinedasanobjectorviaJSON. //Thefollowingsnippetdisplaysasemi-transparentgreensquarewitharedborderusingtheSimpleMarkerSymbolobject varsms=newSimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE,10, newSimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, newColor([255,0,0]),1), newColor([0,255,0,0.25])); varprofileParams={ map:map, chartOptions:{ mapIndicatorSymbol:sms } //ThefollowingsnippetdisplaysabluecirclewithawhiteborderusingJSON varprofileParams={ map:map, chartOptions:{ mapIndicatorSymbol:{ type:"esriSMS", style:"esriSMSCircle", color:[0,183,235], size:12, outline:{ type:"esriSLS", style:"esriSLSolid", color:[255,255,255], width:1 } } }, profileTaskUrl:"https://elevation.arcgis.com/arcgis/rest/services/Tools/ElevationSync/GPServer", scalebarUnits:Units.MILES }; epWidget=newElevationsProfileWidget(profileParams,dom.byId("profileChartNode")); skyBottomColor Required TheHexadecimalfontcolorofthebottombackgroundskyofthechart. skyTopColor Required TheHexadecimalfontcolorofthetopbackgroundskyofthechart. title Required Thetitleoftheprofilechart. titleFontColor Required TheHexadecimalfontcolorofthecharttitle. waterBottomColor Required TheHexadecimalfontcolorofthebottomwaterline. waterLineColor Required TheHexadecimalfontcolorofthewaterline. waterTopColor Required TheHexadecimalfontcolorofthetopwaterline. Sample: require([ "esri/map","esri/dijit/ElevationProfile",... ],function(Map,ElevationProfile,...){ varmap=newMap(...); //Chartoptions varchartOptions={ title:"MyElevationProfileChart", chartTitleFontSize:14, axisTitleFontSize:11, axisLabelFontSize:9, indicatorFontColor:'#eee', indicatorFillColor:'#666', busyIndicatorBackgroundColor:"#666", titleFontColor:'#eee', axisFontColor:'#ccc', axisMajorTickColor:'#333', skyTopColor:"#B0E0E6", skyBottomColor:"#4682B4", waterLineColor:"#eee", waterTopColor:"#ADD8E6", waterBottomColor:"#0000FF", elevationLineColor:"#D2B48C", elevationTopColor:"#8B4513", elevationBottomColor:"#CD853F", elevationMarkerStrokeColor:"#FF0000", elevationMarkerSymbol:"m-6-6,l1212,m0-12,l-1212" }; varelevationProfile=newElevationProfile({ map:map, profileTaskUrl:"http://elevation.arcgis.com/arcgis/rest/services/Tools/ElevationSync/GPServer", scalebarUnits:Units.MILES, chartOptions:chartOptions },"elevationProfileDOM"); }); Thefollowing PropertyDetails measureUnits Themeasurementunitofthepolylinegeometry.SupportedvaluesincludeesriMiles,esriKilometers,esriMeters,esriNauticalMiles,esriYardsandesriFeet. profileGeometry Thepolylineinputgeometryusedtocreatetheelevationprofile. title Thetitleoftheresultingelevationprofile.(Addedatv3.15)Defaultvalue:"ElevationProfile"Sample: //Thischangesthetitleoftheelevationprofile epWidget.set("title","Newtitle"); MethodDetails clearProfile() Clearstheelevationprofilechart. destroy() Destroythewidget.Callthismethodwhenthewidgetisnolongerneededbytheapplication. startup() FinalizesthecreationoftheElevationProfilewidget.Callstartup()aftercreatingthewidgetwhenyouarereadyforuserinteraction.Sample: varelevationProfile=newElevationProfile({ map:map, profileTaskUrl:"http://elevation.arcgis.com/arcgis/rest/services/Tools/ElevationSync/GPServer", scalebarUnits:Units.MILES, chartOptions:chartOptions }); elevationProfile.startup(); EventDetails [OnStyleEvents|ConnectStyleEvent] clear-profile Fireswhentheelevationprofileiscleared.Sample: require([ ... ],function(...) on(elevationprofile,'clear-profile',function(){ console.log('clearedprofile'); }); ... }); elevation-values Firesaftertheprofileisgenerated.Itistheaggregationofelevationgainedandlost.(Addedatv3.18)EventObjectProperties: data Anobjectcontainingtheresultsoftheaggregatedandlostelevationdata. { aggregateElevationGainForward:Aggregateelevationgainedmovingforward, aggregateElevationLossForward:Aggregateelevationlossmovingforward, aggregateElevationGainReverse:Aggregateelevationgainedinreverse, aggregateElevationLossReverse:Aggregateelevationlossinreverse } Sample: require([ ... ],function(...) on(epWidget,"elevation-values",function(data){ console.log( "ForwardGained:"+data.aggregateElevationGainForward+ "ForwardLoss:"+data.aggregateElevationLossForward+ "ReverseGained:"+data.aggregateElevationGainReverse+ "ReverseLoss:"+data.aggregateElevationLossReverse ); }); ... }); load Fireswhenthewidgethasfullyloaded.Sample: on(widget,'load',function(evt){}) title-changed Fireswhenthetitleoftheelevationprofileischanged(Addedatv3.15)Sample: require([ ... ],function(...) on(elevationprofile,'title-changed',function(){ console.log('titlechanged'); }); ... }); update-profile Fireswhentheelevationprofileisupdated.EventObjectProperties: profileResults Anobjectcontainingtheresultsoftheupdatedelevationprofile. { geometry:, elevations:, distances:, samplingDistance: } Sample: require([ ... ],function(...) on(elevationprofile,'update-profile',function(e){ console.log('updateprofile',e); }); ... }); Reportanerroronthispage. Copyright©2022Esri.Allrightsreserved.|Privacy|Termsofuse ShowModal Keyboardshortcuts Sitewideshortcuts ? Bringupthishelpdialog esc Dismissthishelpdialog gh GotoHome gg GotoGuide ga GotoAPIReference gs GotoSampleCode gt Scrolltotopofpage spacebar Scrollpagedown shiftspacebar Scrollpageup gb Scrolltobottomofpage APIReference /FocussearchcGotoConstructorspGotoPropertiesmGotoMethodseGotoEvents



請為這篇文章評分?