I guess you are using epsg 900913, which is not a good projection for 
measures...Using openlayers geodesic works for measuring, but on the 
server side when generating the image, geodesic is not used
If geoserver doesn't have a "geodesic" support, you don't have many 
choices...

1- implement a geodesic in geoserver.
2- change your map projection for an appropriate one. Not possible though 
if you are using google map

We have the same issue. The workaround is to generate a wms query with 
bbox, scale using another projection thant 900913
Steve





Robert Buckley <robertdbuck...@yahoo.com>@geoext.org 
Envoyé par : users-boun...@geoext.org
2011-09-06 04:58

A
users@geoext.org
cc

Objet
[Polluriel potentiel]  [Users] Printing with geoext








Hi,

I have tried most things now to get a solution to my problem that the 
scalebar is at the wrong scale when I export to pdf throught the mapfish 
print module.

The Openlayers measure control is set to geodesic and so is the openlayers 
scalebar. 

I have played with the client projections, config.yaml, geodesic etc...but 
the pdf scalebar is always wrong. How do I find the problem?


can anyone suggest somewhere to look?


yours,

Rob


// map

var d = new OpenLayers.Projection("EPSG:4326");
var e = new OpenLayers.Projection("EPSG:900913");
var f = new OpenLayers.Map("map", {
        projection: d,
        displayProjection: e,
        units: "m",
        maxResolution: 156543.0339,
        maxExtent: new OpenLayers.Bounds(1069506.899621, 6727760.984838, 
1268243.173127, 6945347.635727),
        controls: [
new OpenLayers.Control.MouseDefaults, 
new OpenLayers.Control.PanZoomBar, 
new OpenLayers.Control.ScaleLine({
            geodesic: false
        })]
    });

My printCapabilities can be seen here.
http://maps.zgb.de/geoserver/pdf/info.json?var=printCapabilities

the app here
http://maps.zgb.de/www/eeg/wind.html

my config.yaml looks like this.

dpis: [75, 150, 300]

scales:
    - 524288000
    - 262144000
    - 131072000
    - 65536000
    - 32768000
    - 16384000
    - 8192000
    - 4096000
    - 2048000
    - 1024000
    - 866688
    - 512000
    - 256000
    - 128000
    - 64000
    - 32000
    - 16000
    - 8000
    - 4000
    - 2000
    - 1000

hosts:
    - !localMatch
        dummy: true
    - !ipMatch
        ip: 0.0.0.0
        mask: 0.0.0.0
    - !dnsMatch
        host: tile.openstreetmap.org
    - !dnsMatch
        host: maps.zgb.de
        post: 80
layouts:

    A4:
        metaData: &commonMetaData
            title: "${mapTitle}"
            author: "Robert Buckley"
            keywords: "map,print"
        mainPage:
            pageSize: A4
            rotation: true
            items:
                - !image
                    maxWidth: 50
                    maxHeight: 60
                    spacingAfter: 10
                    align: center
                    url: http://maps.zgb.de/www/images/LogoZGB.gif
                - !text
                    text: "${mapTitle}"
                    fontSize: 12
                    spacingAfter: 30
                    align: center
                - !map
                    spacingAfter: 10
                    width: 480
                    height: 590
#                - !scalebar
 #                   type: bar
  #                  maxSize: 100
   #                 barBgColor: white
    #                fontSize: 8
     #               align: right
      #              spacingAfter: 10
                - !text
                    text: '${comment}'
                    align: left
                    fontSize: 14
                    spacingAfter: 10
                - !text
                    fontEncoding: Cp1252
                    font: Helvetica
                    fontSize: 9
                    align: right
                    text: 'Alle Rechte, Aenderungen und Irrtuemer 
vorbehalten. www.zgb.de  ${now MM.dd.yyyy}'

_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to