Afficher une carte à l'aide d'une réponse Feature Service
Vous pouvez utiliser la réponse générée à partir d'une requête Feature Service (fonctionnalité) et dans le cadre d'une requête RenderMap, afficher cette fonctionnalité. Lorsque vous envoyez une requête de service de fonction, par exemple :
Requête Feature Service :
GET http://<hostname>:<port>/rest/Spatial/FeatureService/tables/features.json?q=select%20Obj,Country,Capital%20from%20%22/Samples/NamedTables/WorldTable%22%20where%20Country=%27Andorra%27
Content-type: application/json
Authorization: <Basic or Spectrum Token>
Vous recevrez une réponse Feature Service. Cependant vous souhaitez uniquement transmettre cette réponse à la demande RenderMap. Vous devez utiliser FeatureCollection complète (la fonction) que vous souhaitez afficher.
Exemple
{
"type": "FeatureCollection",
"Metadata": [
{
"type": "Geometry",
"name": "Obj",
"bbox": [
1.422111,
42.435081,
1.7793329999999998,
42.658695
],
"styleColumn": "MI_Style"
},
{
"type": "String",
"name": "Country"
},
{
"type": "String",
"name": "Capital"
}
],
"bbox": [
1.422111,
42.435081,
1.7793329999999998,
42.658695
],
"features": [
{
"type": "Feature",
"id": "9",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
1.439917,
42.606499
],
[
1.4589999999999999,
42.609055
],
[
1.470056,
42.649775999999996
],
[
1.482194,
42.653721
],
[
1.495611,
42.650196
],
[
1.554417,
42.658695
],
[
1.5949719999999998,
42.639526
],
[
1.628722,
42.635777
],
[
1.6558329999999999,
42.626304999999995
],
[
1.695417,
42.634388
],
[
1.7015829999999998,
42.628029
],
[
1.736194,
42.617722
],
[
1.728333,
42.602554
],
[
1.730667,
42.598526
],
[
1.763861,
42.587112
],
[
1.7793329999999998,
42.572860999999996
],
[
1.742611,
42.565833999999995
],
[
1.7327219999999999,
42.557026
],
[
1.723528,
42.527054
],
[
1.7235,
42.503859999999996
],
[
1.701611,
42.4925
],
[
1.670833,
42.503307
],
[
1.6644999999999999,
42.485138
],
[
1.646444,
42.470054999999995
],
[
1.628528,
42.46825
],
[
1.589472,
42.453444999999995
],
[
1.571861,
42.454639
],
[
1.548417,
42.440166
],
[
1.515417,
42.435081
],
[
1.464778,
42.441139
],
[
1.452528,
42.448277
],
[
1.448361,
42.467804
],
[
1.430361,
42.485363
],
[
1.432167,
42.490776
],
[
1.459944,
42.508026
],
[
1.464361,
42.516945
],
[
1.447944,
42.540833
],
[
1.423889,
42.542221
],
[
1.422111,
42.554943
],
[
1.4327219999999998,
42.576363
],
[
1.4266109999999999,
42.59211
],
[
1.4355559999999998,
42.597332
],
[
1.439917,
42.606499
]
]
]
]
},
"properties": {
"Country": "Andorra",
"Capital": "Andorra La Vella"
}
}
]
}
Vous pouvez désormais utiliser la requête RenderMap de Mapping Service pour afficher la fonctionnalité. La requête RenderMap POST DATA sont décrites ici : Afficher une carte. La réponse du Service de fonction (comme décrits ci-dessus) constituent le corps de la publication de la requête rest json.
Les requêtes POST HTTP se présentent au format ci-dessous :
HTTP POST: /maps/image.image type;
POST DATA: w=width;h=height;c=x,y,srs;z=zoom;s=scale;b=x1,y1,x2,y2,srs;
[r=resolution];[l=locale];[bc=background color];[bo=background opacity];
POST BODY: Content-Type:application/json {FeatureCollection}
POST http://<hostname>:<port>/rest/Spatial/MappingService/maps/image.png;w=800;h=600;b=1.42,42.23,1.77,42.85,epsg:4326;
Content-type: application/json
Authorization: <Basic or Spectrum Token>
Body: <FeatureCollection returned from Feature Service response>