require(["esri/tasks/locationproviders/GeometryLocationProvider"], function(GeometryLocationProvider) { /* code goes here */ });
Description
(Added at v3.12)
(Currently in beta)
The GeometryLocationProvider class uses the field in the data that has geometry as a JSON to generate the corresponding geometry.
Samples
Search for
samples that use this class.
Class hierarchy
esri/tasks/locationproviders/LocationProviderBase
|_esri/tasks/locationproviders/LocationProviderClientBase
|_esri/tasks/locationproviders/GeometryLocationProvider
Constructors
Properties
Methods
Events
[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
Constructor Details
Creates a new instance of the GeometryLocationProvider object.
Parameters:
<Object > options |
Required |
Define the properties to use when creating the class. See options descriptions for further information. |
options
properties:
<String > geometryField |
Required |
The attribute field in the graphic object that contains the JSON string representing the geometry. |
<String > geometryType |
Required |
The geometry type of the returned features. Use one of the following geometry types: "esriGeometryPoint" | "esriGeometryPolyline" | "esriGeometryPolygon". |
Sample:
require([
"esri/tasks/locationproviders/GeometryLocationProvider",...
], function(GeometryLocationProvider,...) {
var locationProvider: new GeometryLocationProvider({
geometryField: "GeomJson",
geometryType: "esriGeometryPoint"
});
...
locationProvider.locate(graphicsArray).then(function(results) {
...
});
});
Property Details
The attribute field in the graphic object that contains the JSON string representing the geometry.
The geometry type of the returned features.
Known values: "esriGeometryPoint" | "esriGeometryPolygon" | "esriGeometryPolyline"
The Spatial Reference of the input geometries. Default is assumed to be WGS84 (WKID: 4326).
Default value: SpatialReference({wkid:4326})
Returns true when the load event has been fired.
Known values: true | false
Method Details
Assigns geometries to the array of Graphic objects.
Parameters:
<Graphic[] > features |
Required |
An array of Graphic objects. |
<Object > options |
Optional |
Optional parameters. See the Object Specifications table below for the structure of the options object. |
Object Specifications: <options
>
<SpatialReference > outSpatialReference |
Required |
Spatial reference of the output geometry. Defaults to 4326 when not provided. |
<Boolean > useExistingGeometries |
Required |
A property to notify whether geometry should be located for Graphic object that already has a geometry. The default value is false . |
Event Details
[ On Style Events | Connect Style Event ]
Fires when an error occurs during locate.
Fires after the provider has loaded. The locate method can be called after this event.
Fires when the locate has completed.
Event Object Properties:
<Graphic[] > failed |
An array of the features that failed to complete successfully. |
<Graphic[] > features |
An array of the completed features. |
Fires when the locate() method is in progress.
Fires when an error occurs during locate.
Fires after the provider has loaded. The locate method can be called after this event.
Fires when the locate has completed.
Event Object Properties:
<Graphic[] > features |
An array of the completed features. |
<Graphic[] > failed |
An array of the features that failed to complete successfully. |
(Need clarification) Fires when the locate is in progress.