Render Map Using a Feature Service Response

You can use the response generated from a Feature Service request (a feature) and as part of a RenderMap request, render this feature. When you send a feature service request, for example:

Feature service request:

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>

You will receive a Feature Service response. However you only want to pass part of this response on to the RenderMap request. You need to use the complete FeatureCollection (the feature) that you want to render. For example:

Note: This is not the complete FeatureCollection. Some of the geometry has been remove for readability.
 	

{
    "type": "FeatureCollection",
    "Metadata": [
        {
            "type": "Geometry",
            "name": "Obj",
            "bbox": [
                1.422111,
                42.435081,
                1.779333,
                42.658695
            ],
            "styleColumn": "MI_Style"
        },
        {
            "type": "String",
            "name": "Country"
        },
        {
            "type": "String",
            "name": "Capital"
        }
    ],
    "bbox": [
        1.422111,
        42.435081,
        1.779333,
        42.658695
    ],
    "features": [
        {
            "type": "Feature",
            "id": "9",
            "geometry": {
                "type": "MultiPolygon",
                "coordinates": [
                    [
                        [
                            [
                                1.439917,
                                42.606499
                            ]

		......					                           [
                                1.439917,
                                42.606499
                            ]
                        ]
                    ]
                ]
            },
            "properties": {
                "Country": "Andorra",
                "Capital": "Andorra La Vella"
            }
        }
    ]
}

Now you can use the Mapping Service RenderMap request to render the feature. The RenderMap request POST DATA are described here: Render Map. The Feature Service response (as descibed above) will make up the json POST BODY of the rest request.

The following format is used for HTTP POST requests:


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];[rd=rendering];[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>