Cached Services in Service API

If you want to work with cached services in the Service API, there are two possibilities:

1.Using an ordinary request (e.g. ../synservice?project=world_redlands_rk) will return an image where the contents of any cached map service (ArcGIS Server compact or exploded, bing maps (WGS84 web mercator auxiliary sphere), OpenStreetMap tile server (WGS84 web mercator auxiliary sphere)) will be displayed or merged with any dynamic map service image above (JSON response e.g.:

{"MAP": {
 "url": http://w-ws-fleischer:8080/v10_x_x/output/testproject_dev-sessions_20120413_100055_147_0d.jpg,
 "x": 1846848.5,
 "y": 6119083.5,
 "scale": 1155583.4197443968,
 "width": 800,
 "height": 600,
 "upp": 305.748724638135
}}

2. Using two additional parameters:

map_adv (true|false): Activating (true) map advanced mode to get the URLs of the dynamic map service (or URL to merged image of multiple dynamic map services) and the tile URLs of every tile of the cached map services separately. This enables the client application to blend or merge the contents by itself.

mapmargin (0-4): Defines the margin of the map image by multiplying the factor (0-4) with 256 pixels. All tiles outside the requested map image but inside the margin will also be fetched.

Sample request: ../synservice?project=world_redlands_rk&map_adv=true&margin=0    

Sample response:

 

{"MAP": {
 "url": http://w-ws-fleischer:8080/v10_x_x/output/testproject_dev-sessions_20120413_095740_526_03.png, // URL to dynamic map service image - needs to be png for transparency

 "x": 1846848.5,
 "y": 6119083.5,
 "scale": 1155583.4197443968,
 "width": 1508,
 "height": 643,
 "upp": 305.748724638135,
 "MAPINFOS": [ // start tile services
   { //tile service 1

           "tile_width": 256,
           "tile_height": 256,
           "xoff_px": -166,

    yoff_px": -145,

    transparency": 0,
     "z_index": 2,
     "TILES": [ //start tiles

       {
         "c": 0,
         "r": 0,
         "v": true,
         "url": http://c.tile.openstreetmap.org/9/276/176.png"
       },
       ...

       {
         "c": 6,
         "r": 3,
         "v": true,
         "url": http://c.tile.openstreetmap.org/9/282/179.png"
       }
     ]
   },
   { //tile service 2

    tile_width": 256,
     "tile_height": 256,
     "xoff_px": -166,
     "yoff_px": -145,
     "transparency": 0,
     "z_index": 1,
     "TILES": [
       {
         "c": 0,
         "r": 0,
         "v": true,
         "url": http://t5.tiles.virtualearth.net/tiles/h120230100.jpeg?g=557&mkt=de-DE&key=123"
       },
       ...
       {
         "c": 6,
         "r": 3,
         "v": true,
         "url": http://t7.tiles.virtualearth.net/tiles/h120231032.jpeg?g=557&mkt=de-DE&key=123"
       }
     ]
   }
 ]
}}