0

I could able to configure a MapFish print in GeoServer and also did some printing map from OSM. I need to print a map which is from ESRI Mapserver. Is there any way to do it?

Working example:

layers: [ 

          { 

            baseURL: 'http://tile.openstreetmap.org',     
            singleTile: false,     
            type: 'OSM', 
             maxExtent: 
                [-20037508.3392,-20037508.3392,20037508.3392,20037508.3392],           
            tileSize: [256, 256],     
            extension: 'png',            
            resolutions: [    
             156543.03390625,    
             78271.516953125,    
             39135.7584765625,    
             19567.87923828125,    
             9783.939619140625,    
             4891.9698095703125,    
             2445.9849047851562,    
             1222.9924523925781,     
             611.4962261962891,    
             305.74811309814453,    
             152.87405654907226,    
             76.43702827453613,    
             38.218514137268066,    
             19.109257068634033,    
             9.554628534317017,    
             4.777314267158508,    
             2.388657133579254,
             1.194328566789627,    
             0.5971642833948135,    
             0.29858214169740677,    
             0.14929107084870338    
           ]    
         },         
   ],

Not working example:

layers: [ 

              { 

                baseURL: 'http://localhost:69/arcgis/rest/services/Pub/BaseMapEng_LightGray_GCS/MapServer/tile/${z}/${y}/${x}',     
               type:'xyz',                    
                 maxExtent: 
                    [-20037508.3392,-20037508.3392,20037508.3392,20037508.3392],           
                tileSize: [256, 256],     
                extension: 'png',            
                resolutions: [    
                 156543.03390625,    
                 78271.516953125,    
                 39135.7584765625,    
                 19567.87923828125,    
                 9783.939619140625,    
                 4891.9698095703125,    
                 2445.9849047851562,    
                 1222.9924523925781,     
                 611.4962261962891,    
                 305.74811309814453,    
                 152.87405654907226,    
                 76.43702827453613,    
                 38.218514137268066,    
                 19.109257068634033,    
                 9.554628534317017,    
                 4.777314267158508,    
                 2.388657133579254,
                 1.194328566789627,    
                 0.5971642833948135,    
                 0.29858214169740677,    
                 0.14929107084870338    
               ]    
             },         
       ],

getting error as

enter image description here

I'm getting this error :

Error while generating PDF:
org.mapfish.print.InvalidJsonValueException: spec.layers[0].baseURL has an invalid value: http://localhost:69/arcgis/rest/services/Pub/BaseMapEng_LightGray_GCS/MapServer/tile/${z}/${y}/${x} (Illegal character in path at index 86: http://localhost:69/arcgis/rest/services/Pub/BaseMapEng_LightGray_GCS/MapServer/tile/${z}/${y}/${x})
  • Please Edit the question to contain the error message as ASCII text. This will make the message legible on all devices and searchable by others. – Vince Jul 11 '18 at 12:01
  • @Vince i did edited – AhammadaliPK Jul 11 '18 at 12:32
0

Remove the $ signs from your URL, and add .png to get tiles data. try:

"http://localhost:69/arcgis/rest/services/Pub/BaseMapEng_LightGray_GCS/MapServer/tile/{z}/{y}/{x}.png"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.