This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
thinkgeo_cloud_javascript_client_apis [2019/02/15 19:58] benbai created |
thinkgeo_cloud_javascript_client_apis [2019/07/17 03:26] (current) kevinwan [tg.MapsQueryClient] |
||
---|---|---|---|
Line 971: | Line 971: | ||
|<span cloud_client_name>callback</span> |function | | |the callback for response | | |<span cloud_client_name>callback</span> |function | | |the callback for response | | ||
</div> | </div> | ||
+ | |||
+ | |||
+ | ===== tg.RoutingClient ===== | ||
+ | <div cloud_client_description> A class provides the methods to access the Routing APIs. Get turn-by-turn driving directions, define service areas that can be reached by car in a given time or distance, and more.</div> | ||
+ | |||
+ | |||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | |||
+ | <code javascript> | ||
+ | var routingClient = new tg.RoutingClient ('Your-Cloud-Service-Api-Key'); | ||
+ | </code> | ||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^Description ^ | ||
+ | |<span cloud_client_name>apiKey</span> |string | An API key for access to ThinkGeo Cloud services, it can be created following the [[http://wiki.thinkgeo.com/wiki/thinkgeo_cloud_quick_start_guide|guide]] | | ||
+ | </div> | ||
+ | |||
+ | <div cloud_client_synta> Return Value </div> | ||
+ | <div cloud_client_description>a Routing object to access the Routing APIs in ThinkGeo Cloud service.</div> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <div cloud_client_method> routingClient.getRoute(waypoints, callback, options) </div> | ||
+ | <div cloud_client_description>Get a route through the specified waypoints.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var waypoints = [{ | ||
+ | x: -96.872893, | ||
+ | y: 33.184352 | ||
+ | },{ | ||
+ | x: -83.441568, | ||
+ | y: 42.404719 | ||
+ | }]; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | turnByTurn: true, | ||
+ | distanceUnit: 'Meter', | ||
+ | durationUnit: 'Minute' | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | routingClient.getRoute(waypoints, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>waypoints</span> |array | | |A list of coordinates to travel in order. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>turnByTurn</span> |boolean |false |Whether to return turn-by-turn instructions or not. Defaults to false. | | ||
+ | | |<span cloud_client_name>coordinateSnapRadius</span> |double |5000 |The maximum distance of a coordinate can be snapped to the road network. Defaults to 5000 meters. | | ||
+ | | |<span cloud_client_name>coordinateSnapRadiusUnit</span> |string |meter |The unit of the radius to snap the input coordinate to road network. | | ||
+ | | |<span cloud_client_name>distanceUnit</span> |string |meter |The unit of measure in which to express the length of the route. Default to Meter. | | ||
+ | | |<span cloud_client_name>durationUnit</span> |string |minute |The unit of the time in which to express the duration of the route. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> routingClient.getServiceArea(pointY, pointX, serviceLimits, callback, options) </div> | ||
+ | <div cloud_client_description>Get the reachable service area (isochrones) for a coordinate point, based on the specified time or distance constraints.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var serviceLimits = [10, 30, 60]; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | var options = { | ||
+ | srid = 3857, | ||
+ | serviceLimitsType = 'Time', | ||
+ | durationUnit = 'minute', | ||
+ | distanceUnit = 'meter' | ||
+ | }; | ||
+ | routingClient.getServiceArea(33.184352, -96.872893, serviceLimits, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>pointY</span> |double | | |The Y coordinate of the point. | | ||
+ | |<span cloud_client_name>pointX</span> |double | | |The X coordinate of the point. | | ||
+ | |<span cloud_client_name>serviceLimits</span> |array | | |The list represents the travel distances or travel times to generate for each facility. The maximum number of <span cloud_client_name>serviceLimits</span> is 6. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>contourGranularity</span> |double |1.0 |A float in the range of (0, 1.0) to identify how much we want to remove the contours. 0 means do not remove any contour at all, 1.0 means only return the largest contour. | | ||
+ | | |<span cloud_client_name>coordinateSnapRadius</span> |double |5000 |The maximum distance of a coordinate can be snapped to the road network. | | ||
+ | | |<span cloud_client_name>coordinateSnapRadiusUnit</span> |string |meter |The unit of the radius to snap the input coordinate to road network. | | ||
+ | | |<span cloud_client_name>distanceUnit</span> |string |meter |The unit of measure in which to express the length of route. | | ||
+ | | |<span cloud_client_name>durationUnit</span> |string |minute |The unit of the time in which to express the duration of traveling the route. | | ||
+ | | |<span cloud_client_name>gridSizeInMeters</span> |double |400 |A float value in meters used as the tolerance for concave polygon. The smaller of the number is getting more accurate of the service areas but slower performance, better a value bigger than 300, but depends on the size of the result coverage. | | ||
+ | | |<span cloud_client_name>serviceAreaSeparationType</span> |string |separated |Specify whether to include the region covered by the smaller service area into the region covered by the larger service area. | | ||
+ | | |<span cloud_client_name>serviceAreaType</span> |string |polygon |Indicates whether the result is returned as polygons enveloping the accessible roads, or as linestrings surrounding those roads. | | ||
+ | | |<span cloud_client_name>serviceLimitsType</span> |string |time |Indicates the unit of the <span cloud_client_name>serviceLimits</span>. | | ||
+ | | |<span cloud_client_name>travelDirection</span> |string |from |Indicates the direction of travel to or from the coordinates. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | |||
+ | ===== tg.MapsQueryClient ===== | ||
+ | <div cloud_client_description> A class provides the methods to access the Maps Query APIs. Perform spatial query against each types of data.</div> | ||
+ | |||
+ | |||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | |||
+ | <code javascript> | ||
+ | var mapsQueryClient = new tg.MapsQueryClient ('Your-Cloud-Service-Api-Key'); | ||
+ | </code> | ||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^Description ^ | ||
+ | |<span cloud_client_name>apiKey</span> |string | An API key for access to ThinkGeo Cloud services, it can be created following the [[http://wiki.thinkgeo.com/wiki/thinkgeo_cloud_quick_start_guide|guide]] | | ||
+ | </div> | ||
+ | |||
+ | <div cloud_client_synta> Return Value </div> | ||
+ | <div cloud_client_description>a Maps Query object to access the Maps Query APIs in ThinkGeo Cloud service.</div> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesWithin(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Get the features that are within the target shape.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POLYGON((15.609372854233 56.62500500679, 1.8984353542334 42.56250500679, 30.023435354233 41.15625500679, 15.609372854233 56.62500500679))'; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | maxResults: 100, | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesWithin(queryLayer, wkt, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesContaining(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Get the features that contain the target shape.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POINT(-95.484377145767 36.93750500679)'; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | maxResults: 100, | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesContaining(queryLayer, wkt, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesIntersecting(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Get the features that intersect the target shape.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POLYGON((15.609372854233 56.62500500679, 1.8984353542334 42.56250500679, 30.023435354233 41.15625500679, 15.609372854233 56.62500500679))'; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | maxResults: 100, | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesIntersecting(queryLayer, wkt, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesOverlapping(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Get the features that overlap the target shape.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POLYGON((15.609372854233 56.62500500679, 1.8984353542334 42.56250500679, 30.023435354233 41.15625500679, 15.609372854233 56.62500500679))'; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | maxResults: 100, | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesOverlapping(queryLayer, wkt, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesTouching(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Get the features that touch the target shape.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POLYGON((7595881.1058614058 -585345.10944436956,7595881.1058614058 2704373.8120167661,-3939883.7747361474 2704373.8120167661,-3939883.7747361474 -585345.10944436956,7595881.1058614058 -585345.10944436956))'; | ||
+ | var options = { | ||
+ | srid: 3857, | ||
+ | maxResults: 100, | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesTouching(queryLayer, wkt, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesNearest(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Get the features that are nearest to the target shape.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POINT(17.367185354233 47.83594250679)'; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | maxResults: 100, | ||
+ | searchRadius: 200, | ||
+ | searchRadiusUnit: 'Kilometer', | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesNearest(queryLayer, wkt, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>searchRadius</span> |double | |The radius of the search area around the target geometry. If not specified, it's assumed that there is no limit. | | ||
+ | | |<span cloud_client_name>searchRadiusUnit</span> |string | |The unit of measure in which the <span cloud_client_name>searchRadius</span> is expressed. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesWithinDistance(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Get the features that are within a certain distance of the target shape.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POINT(17.367185354233 47.83594250679)'; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | maxResults: 100, | ||
+ | distance: 200, | ||
+ | distanceUnit: 'Kilometer', | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesWithinDistance(queryLayer, wkt, callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>distance</span> |double |200 |The distance within which to find features. | | ||
+ | | |<span cloud_client_name>distanceUnit</span> |string |"Meter" |The unit of measure in which the <span cloud_client_name>distance</span> is expressed. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
+ | <div cloud_client_method> mapsQueryClient.getFeaturesCustom(queryLayer, wkt, callback, options) </div> | ||
+ | <div cloud_client_description>Perform a custom spatial query, using the specified query layer, spatial relationship type, and query feature.</div> | ||
+ | <div cloud_client_synta> Syntax </div> | ||
+ | <code javascript> | ||
+ | var queryLayer = 'countries'; | ||
+ | var wkt = 'POLYGON((15.609372854233 56.62500500679, 1.8984353542334 42.56250500679, 30.023435354233 41.15625500679, 15.609372854233 56.62500500679))'; | ||
+ | var options = { | ||
+ | srid: 4326, | ||
+ | maxResults: 100, | ||
+ | returnFeatureAttributes: true, | ||
+ | featureAttributesToReturn: ['id', 'name'] | ||
+ | }; | ||
+ | var callback = function (status, response) { | ||
+ | console.log(response); | ||
+ | }; | ||
+ | mapsQueryClient.getFeaturesCustom(queryLayer, wkt, 'within', callback, options); | ||
+ | </code> | ||
+ | |||
+ | <div cloud_client_parameter> Parameters </div> | ||
+ | <div cloud_client_table> | ||
+ | ^Name ^Type ^ ^ ^Description ^ | ||
+ | |<span cloud_client_name>queryLayer</span> |string | | |The query layer. | | ||
+ | |<span cloud_client_name>wkt</span> |string | | |The well-known text of target shape. | | ||
+ | |<span cloud_client_name>callback</span> |function | | |the callback for response. | | ||
+ | |<span cloud_client_name>options</span> |Options | | | | ||
+ | | ^Name ^Type ^Default ^Description ^ | ||
+ | | |<span cloud_client_name>srid</span> |integer | |The SRID (coordinate system ID) in which to input and output the result. Mutually exclusive from the Proj4String parameter. | | ||
+ | | |<span cloud_client_name>proj4String</span> |string |"+proj=longlat +datum=WGS84 +no_defs" |The Proj4 projection string (coordinate system) in which to input and output the result. Mutually exclusive from the Srid parameter. Defaults to “+proj=longlat +datum=WGS84 +no_defs”. | | ||
+ | | |<span cloud_client_name>distance</span> |double |200 |The distance within which to find features. | | ||
+ | | |<span cloud_client_name>distanceUnit</span> |string |"Meter" |The unit of measure in which the <span cloud_client_name>distance</span> is expressed. | | ||
+ | | |<span cloud_client_name>searchRadius</span> |double | |The radius of the search area around the target geometry. If not specified, it's assumed that there is no limit. | | ||
+ | | |<span cloud_client_name>searchRadiusUnit</span> |string | |The unit of measure in which the <span cloud_client_name>searchRadius</span> is expressed. | | ||
+ | | |<span cloud_client_name>maxResults</span> |integer |100 |The maximum number of features to return. | | ||
+ | | |<span cloud_client_name>returnFeatureAttributes</span> |boolean |true |If true, specifies that the feature attribute column names and values will be returned in the response. | | ||
+ | | |<span cloud_client_name>featureAttributesToReturn</span> |array | |If <span cloud_client_name>returnFeatureAttributes</span> is true, this allows the user to specify which a specific subset of attributes to be returned. | | ||
+ | </div> | ||
+ | |||
+ | |||
===== tg.BaseClient===== | ===== tg.BaseClient===== |