[Cartoweb-users] Zoom tools do not make anything

Pierre GIRAUD pierre.giraud at camptocamp.com
Wed Feb 22 10:54:45 EST 2006


Hello,

First, your problem is due to incoherence between the scales defined in 
location.ini and the scale given to cartoweb by mapscript (mapserver).

If you add "{t}Current scale:{/t} 1:{$currentScale}" to your template 
you'll note that given scale is incorrects, it doesn't correspond to 
those defined in the location.ini
On first load, the scale is lower than the minscale so user cannot zoomin.

Having a try with similar datasets and extents, I got it working using 
"UNITS DD" in the mapfile (MAP object). (Your extent values are given in 
DD). With this Mapserver gives a more comprehensive scale and then 
Cartoweb is able to manage the scale list.
You should try it.

Second possibility is to project your map in a cartesian system with 
meter units for your map and its extent.

Regards

Pierre

Cristhiano Vasconcellos wrote:

> The map is showed but the zoom in/out tools do not make anything.
> The url of the application:
> http://ndige01.ccr.ufsm.br/cartoweb3/htdocs/ufsm.php
> Could someone help me?
>  
> Thanks a lot
>  
> The map file is the following:
>  
> MAP
>   NAME "ufsm"
>   EXTENT -180.00 0.00 -60.00 90.00
>   IMAGETYPE PNG
>   IMAGECOLOR 255 255 255
>   STATUS ON
>   UNITS METERS             #modificado era METERS
>   FONTSET "fonts.txt"
>   SYMBOLSET "symbols.txt"
>   SHAPEPATH "/home/mapdata/"
>  
>   OUTPUTFORMAT
>     NAME png
>     DRIVER "GD/PNG"
>     MIMETYPE "image/png"
>     IMAGEMODE PC256
>     EXTENSION "png"
>     FORMATOPTION "INTERLACE=OFF"
>     TRANSPARENT ON
>   END
>  
>   OUTPUTFORMAT
>     NAME jpeg
>     DRIVER "GD/JPEG"
>     MIMETYPE "image/jpeg"
>     IMAGEMODE RGB
>     EXTENSION "jpg"
>     FORMATOPTION "INTERLACE=OFF"
>     FORMATOPTION "QUALITY=80"
>   END
>  
>   #keymap mapinha de referencia para clicar e posicionar no mapa principal
>   #comentei para tirá-lo
>  REFERENCE
>    IMAGE images/img_referencia.gif
>    EXTENT -180.00 0.00 -60.00 90.00
>    STATUS ON
>    COLOR -1 -1 -1
>    OUTLINECOLOR 200 200 200
>    SIZE 140 97
>  END
>  
>   SCALEBAR
>     POSTLABELCACHE TRUE
>     STYLE 0
>     UNITS kilometers
>     SIZE 350 3
>     TRANSPARENT TRUE
>     COLOR 77 77 88
>     IMAGECOLOR 242 255 195
>     BACKGROUNDCOLOR 222 222 222
>     LABEL
>       TYPE BITMAP
>       SIZE SMALL
>       COLOR 0 0 0
>       ! POSITION UR
>       BUFFER 10
>     END
>   END
>  
>   LEGEND
>     KEYSIZE 20 15
>   END
>  
>  
>  
> #layers *******************************
> LAYER
>       NAME "urbanareas"
>       DATA "urbanap020"
>       STATUS on
>       TYPE polygon
>       LABELCACHE on #desenha o label so depois que todas as camadas 
> forem desenhadas
>       LABELITEM 'NAME'
>     ! ;  CLASS
>             NAME "Urban Areas" #este nome aparece na legenda
>             STYLE
>                   COLOR 212 192 100 #como eh um poligono a cor eh de 
> preenchimento
>             END #style
>             LABEL
>                   COLOR 0 0 0
>                   SIZE small
>             END #label
>       END # class Urban Areas
> END # layer urbanareas
>  
> LAYER
>       NAME "lakes"
>       DATA "hydrogp020"
>       STATUS on
>       TYPE polygon
>       LABELCACHE on
>       LABELITEM "NAME" #indica qual campo no shape originará os 
> rótulos no mapa
>       CLASSITEM "FEATURE" #indica qual campo no shapefile sera pesquisado
>       MAXFEATURES 100 #número máximo de objetos a serem desenhados
>       CLASS
>             NAME "Lakes"
>             EXPRESSION 'Lake' #critério de restrição tipo where 
> feature = 'Lake'
>             STYLE
>                   SIZE 1
>                   COLOR 0 0 255
>             END
>             LABEL
>                   MINFEATURESIZE auto
>                   COLOR 0 0 0
>                   SIZE small
>             END
>       END
> END
>  
> LAYER
>       NAME "states" #opcional, mas se quiser manipular no html tem q ter
>       DATA "statesp020"
>       STATUS on
>       TYPE polygon
>       LABELCACHE on
>       CLASS
>             STYLE
>                   OUTLINECOLOR 0 0 0
>             END
>       END
> END
>  
> LAYER
>       NAME "roads"
>       DATA "roadtrl020"
>       STATUS on
>       TYPE line
>       LABELCACHE on
>       LABELITEM "NAME"
>       CLASSITEM "FEATURE"
>       CLASS
>             NAME "Principal Highway"
>             EXPRESSION /Principal Highway*/   # serve de critério é 
> uma expressão regular
>             STYLE
>                   SIZE 1
>                   COLOR 0 0 0
>             END
>             LABEL
>                   COLOR 0 0 0
>                   SIZE small
>             END
>       END
> END
>  
> ###########
>   # outline #
>   ########### 
>   LAYER
>     NAME "cartoweb_point_outline"
>     TYPE POINT
>     CLASS
>       STYLE
>         SYMBOL "triangle"
>         COLOR 0 0 0
>         SIZE 12
>       END
>       STYLE
>         SYMBOL "triangle"
>         COLOR 205 0 0
>         SIZE 10
>       END
>       LABEL
>         TYPE TRUETYPE
>         FONT "Vera"
>         SIZE 7
>         COLOR 0 0 0
>         OUTLINECOLOR 255 255 255
>         POSITION lc
>       END
>     END
>   END
>  
>   LAYER
>     NAME "cartoweb_line_outline"
>     TYPE LINE
>     CLASS
>       STYLE
>         COLOR 0 0 0
>         SYMBOL "line-dashed"
>         SIZE 2
>       END
>       LABEL
>         TYPE TRUETYPE
>         FONT "Vera"
>         SIZE 7
>         COLOR 0 0 0
>         OUTLINECOLOR 255 255 255
>         ANGLE auto
>         POSITION uc
>       END
>     END
>   END
>  
>   LAYER
>     NAME "cartoweb_polygon_outline"
>     TYPE POLYGON
>     TRANSPARENCY 60
>     CLASS
>       STYLE
>         COLOR 255 153 0
>         OUTLINECOLOR 0 0 0
>       END
>       LABEL
>         TYPE TRUETYPE
>         FONT "Vera"
>         SIZE 7
>         OUTLINECOLOR 255 255 255
>         COLOR 0 0 0
>         POSITION cc
>       END
>     END
>   END
>  
> END
>  
>  
>
> ------------------------------------------------------------------------
> Yahoo! Acesso Grátis
> Internet rápida e grátis. Instale o discador agora! 
> <http://us.rd.yahoo.com/mail/br/tagline/homepage_set/*http://br.acesso.yahoo.com> 
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Cartoweb-users mailing list
>Cartoweb-users at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/cartoweb-users
>


-- 
_________________________________________________________
Pierre GIRAUD
Géomaticien, Analyste

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex 

Tel : 00 33 4 79 44 44 93
Mail : pierre.giraud at camptocamp.com
http://www.camptocamp.com  




More information about the Cartoweb-users mailing list