geoportal-access-lib
Version:
French Geoportal resources access library
124 lines (108 loc) • 3.63 kB
JavaScript
/**
* Single SuggestedLocation Object returned by underlying web service.
* Each suggested location represents a street address ("StreetAddress") or a place name ("PositionOfInterest").
*
* @property {String} type - Suggested location type : "StreetAddress" ou "PositionOfInterest"
* @property {Gp.Point} position - Position of the suggested location given in requested coordinates system.
* @property {String} commune - Suggested municipality
* @property {String} fullText - Full text representation of the suggested location.
* @property {String} postalCode - Suggested location postcode
* @property {Integer} classification - Number used to classify the importance of the place where is the suggested location from 1 (most important) to 7 (less important).
* @property {String} street - Street name of the suggested location ("StreetAddress" only).
* @property {String} kind - Nature of the suggested location : "prefecture", "monument", "commune", ... for instance ("PositionOfInterest" only).
*
* @namespace
* @alias Gp.Services.AutoComplete.SuggestedLocation
*/
function SuggestedLocation () {
if (!(this instanceof SuggestedLocation)) {
throw new TypeError("SuggestedLocation constructor cannot be called as a function.");
}
/* REPONSE :
{
"status" : "OK",
"results" : [
{
"country":"PositionOfInterest",
"x":-1.559185,
"y":47.952603,
"city":"Brie",
"zipcode":"35150",
"street":"corbe",
"kind":"Lieu-dit habité",
"fulltext":"corbe, 35150 Brie",
"classification":6
},
{
"country":"StreetAddress",
"x":1.538295,
"y":43.19646,
"city":"Brie",
"zipcode":"09700",
"street":"courreste",
"kind":"",
"fulltext":"courreste, 09700 Brie",
"classification":7
}
]
}
*/
/* REPONSE EN ERREUR
{
status : "ERROR",
results : [ ]
}
*/
/**
* Suggested location type : "StreetAddress" ou "PositionOfInterest"
* @type {String}
*/
this.type = null;
/**
* Position of the suggested location given in requested coordinates system.
* @type {Gp.Point}
*/
this.position = {
x : null,
y : null
};
/**
* Suggested municipality
* @type {String}
*/
this.commune = null;
/**
* Full text representation of the suggested location.
* @type {String}
*/
this.fullText = null;
/**
* Suggested location postcode
* @type {Number}
*/
this.postalCode = null;
/**
* Number used to classify the importance of the place where is the suggested location from 1 (most important) to 7 (less important).
* @type {Integer}
*/
this.classification = null;
/**
* Street name of the suggested location ("StreetAddress" only).
* @type {String}
*/
this.street = null;
/**
* Place name of the suggested location ("PositionOfInterest" only).
* @type {String}
*/
this.poi = null;
/**
* Nature of the suggested location : "prefecture", "monument", "commune", ... for instance ("PositionOfInterest" only).
* @type {String}
*/
this.kind = null;
}
SuggestedLocation.prototype = {
constructor : SuggestedLocation
};
export default SuggestedLocation;