[MAPSERVER-USERS] Problems with scalebar embedding and java mapscript

maurosa maurosa at IOL.IT
Mon Dec 8 14:00:52 EST 2008


Hi list 

I am experiencing problems with scalebar embedding 
after version 5.02 using java mapscript. 

Changing map extent, does not change scalebar values. 
Version 5.02 works properly. 
The error happens with version 5.20 and 5.21. 

If scalebar usage is changed after version 5.02, 
I thank you for any suggestion. 

Mauro 

This is a simple java mapscript program to reproduce the error: 

--------------------------------------------- 

System.loadLibrary("mapscript");       

//first extent: scalebar values are correct 
mapObj map = new mapObj("mymap.map");       
imageObj img = map.draw();       
img.save("mymap1.jpeg", map);       

//second extent: scalebar values are wrong 
//and are frozen to those of first image 
map.setExtent(300000, 4800000, 900000, 5200000); 
img = map.draw();       
img.save("mymap2.jpeg", map); 

//from this point on, changing map extent does 
//not change the original scalebar values any more 

--------------------------------------------- 

The following is mymap.map: 

--------------------------------------------- 

MAP 
  STATUS ON 
  EXTENT 20000 4030000 1650000 5250000 
  SIZE 700 500 
  SYMBOLSET "symbols/symbols.sym" 
  FONTSET "fonts/fonts.list" 
  IMAGETYPE JPEG 
  IMAGECOLOR 255 255 255 
  UNITS METERS 

  PROJECTION 
    "init=epsg:32632" 
  END 

  OUTPUTFORMAT 
    NAME "JPEG" 
    MIMETYPE "image/jpeg" 
    DRIVER "AGG/JPEG" 
    EXTENSION "jpg" 
    IMAGEMODE "RGB" 
    TRANSPARENT FALSE 
    FORMATOPTION "QUALITY=95" 
  END 

  SCALEBAR 
    STATUS embed 
    SIZE 200 3 
    UNITS kilometers 
    BACKGROUNDCOLOR 120 120 120 
    COLOR 200 200 200 
    STYLE 0 
    POSTLABELCACHE true 
    LABEL 
      COLOR 0 0 90 
      SIZE small 
    END 
  END 

  LAYER 
    NAME "MYLAYER" 
    STATUS ON 
    DATA "GEOMETRY FROM MYLAYER USING UNIQUE CODE SRID 8307 RELATE" 
    TYPE POLYGON 
    CONNECTIONTYPE oraclespatial 
    CONNECTION "user/password at sid" 
    PROJECTION 
      "init=epsg:4326" 
    END 
    CLASS 
      STYLE 
       OUTLINECOLOR 0 0 255 
      END 
    END 
  END 
END 

-- 
View this message in context: http://www.nabble.com/Problems-with-scalebar-embedding-and-java-mapscript-tp20901440p20901440.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list