[Mapserver-users] Image not visible

Norbert Thieme norbert.thieme at ilmenau.baw.de
Sun Apr 25 23:54:10 PDT 2004


Hi,

did you try to use the map->save function? With this you get a mapfile 
out of your current mapobject. There you can look if everything is correct.

Regards,
Norbert


Attri, Abhishek schrieb:
> Hi All,
> 
>  
> 
> I am trying to use mapscript to display a simple image. When I add the 
> layers and classes in the mapfile, I get the image. But, when I try to 
> create the layers and classes through the mapscript, I get the image 
> which is not visible. Can somebody help me find out what I am doing wrong?
> 
>  
> 
> Here is the code for mapfile and mapscript file:-
> 
>  
> 
> NAME FIRSTMAP
> 
> SIZE 500 500
> 
> STATUS ON
> 
> SYMBOLSET ../symbols/symbols35.sym
> 
> EXTENT -88.50 30.23 -84.88 35.02
> 
> UNITS MILES
> 
> SHAPEPATH "../data"
> 
>  
> 
> WEB
> 
> IMAGEPATH "/home/tech/abhi/WWW/tmp/"
> 
> IMAGEURL "/tmp/"
> 
> END
> 
>  
> 
> END
> 
>  
> 
>  
> 
>  
> 
>  
> 
> ===================================================================================
> 
>  
> 
> <?php
> 
>  
> 
> dl('php_mapscript.so');
> 
>  
> 
>     $map_path="/home/tech/abhi/WWW/ms/map_files/";
> 
>     $map_file="./Newcounty.map";
> 
>     $map = ms_newMapObj($map_path.$map_file);
> 
>  
> 
>  
> 
>  
> 
>     // create layer
> 
>     $layer = ms_newLayerObj($map);
> 
>     $layer->{name} = "Counties";
> 
>     $layer->{type} = MS_POLYGON;
> 
>     $layer->{status} = MS_ON;
> 
>     $layer->{data} = "./counties";
> 
>  
> 
>  
> 
>     // create class
> 
>     $class = ms_newClassObj($layer);
> 
>         $class->{status}= MS_ON;
> 
>         $class->{name}= "Myclass";
> 
>             $style = ms_newStyleObj($class);
> 
>             $style->{color}->{red}= 110;
> 
>             $style->{color}->{blue}= 50;
> 
>             $style->{color}->{green}= 100;
> 
>  
> 
>             $style->{outlinecolor}->{red}= 200;
> 
>             $style->{outlinecolor}->{blue}= 200;
> 
>             $style->{outlinecolor}->{green}= 200;
> 
>  
> 
>             $style->{symbol} =0;
> 
>  
> 
>     //Draw Image
> 
>     $image=$map->draw();
> 
>     $image_url=$image->saveWebImage();
> 
>  
> 
> ?>
> 
> <HTML>
> 
> <HEAD>
> 
> <TITLE>Map 1</TITLE>
> 
> </HEAD>
> 
> <BODY>
> 
> <center>
> 
> <TABLE>
> 
> <TR><td>
> 
> <INPUT TYPE=IMaGe name=mapa src=<?php echo $image_url?>>
> 
> </td></TR>
> 
> </TABLE>
> 
> <center>
> 
> </BODY>
> 
> </HMTL>
> 
>  
> 
> With thanks in advance,
> 
>  
> 
> Abhishek
> 
>  
> 




More information about the MapServer-users mailing list