[mapserver-users] mapserver-chameleon framework, warning?

elisabeth theresia dbee_kawai at yahoo.com
Sat Aug 7 07:58:58 PDT 2010


Hi all,

i want to used chameleon framework for webgis, then Chameleon already installed 
with checking in localhost MS4W-MapServer 4 Windows:

bla...
bla...
;
;
Application
Chameleon 2.4 URL:


Chameleon Administration.
>Chameleon Documentation.
>Chameleon HelpViewer.
>Chameleon Sample Applications.
>CWC2 Service Instance.(But that makes me confuse that when i clicked them above, 
>just warning in browser: 
>
Forbidden
You don't have permission to access /chameleon/admin/ on this server.)


but, i still try, write down mapfile then initialize.phtml with cwc2.css, then i 
got warning like this :

"Warning:  session_start() [function.session-start]: Cannot send session cache 
limiter - headers already sent (output started at 
I:\ms4w\Apache\htdocs\appweb\index.phtml:4) in 
i:\ms4w\Apache\htdocs\chameleon\htdocs\common\session\session.phpon line 509

Notice :  Undefined variable:  szMapFile in 
I:\ms4w\Apache\htdocs\appweb\index.phtmlon line 21"


anyone can help me or explain what happened?

here the mapfile:
MAP
NAME kelurahan
IMAGETYPE JPEG
EXTENT -123.950500 -183.224900 299.457000 145.260600
STATUS ON
UNITS KILOMETERS
SIZE 600 500
IMAGECOLOR 366 366 366
FONTSET "i:\Spatial\font\font.dat"
#SHAPEPATH"i:/ms4w/Apache/htdocs/appweb/shp/"

WEB 
    TEMPLATE "i:\ms4w\Apache\htdocs\script\tmpl_cham.html"
    IMAGEPATH "i:\ms4w\Apache\htdocs\temp\" 
    IMAGEURL "http://localhost/temp/"
END
#mulai pendefinisian layers

    LAYER 
    NAME tbk_bjsr_gender
    STATUS DEFAULT
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "user=x password=x dbname=dbSpatialSura host=localhost port=5432"
    DATA "the_geom FROM tbk_bjsr_gender USING UNIQUE kode_kel"
    MINSCALE 100000
        CLASS
        NAME "Jum laki2"
            EXPRESSION ([ljum_bj]=1874) 
            STYLE
            COLOR 255 50 50
            OUTLINECOLOR 0 0 0
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END #CLASS
        CLASS
        NAME "jum perempuan"
            EXPRESSION([pjum_bj]=2240)
            STYLE
            COLOR 255 155 150
            OUTLINECOLOR 19 19 19
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END#CLASS
    END #LAYER

    LAYER
    NAME tbk_jeb_gender
    STATUS DEFAULT
    TYPE POLYGON
    CONNECTIONTYPE POSTGIS
    CONNECTION "user=x password=x dbname=dbSpatialSura host=localhost port=5432"
    DATA "the_geom FROM tbk_jeb_gender USING UNIQUE kode_kel"
    MINSCALE 100000
        CLASS
        NAME "ljum_jeb"
            EXPRESSION ([ljum_jeb]=3941) 
            STYLE
            COLOR 255 50 50
            OUTLINECOLOR 0 0 0
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END #CLASS
        CLASS
        NAME "pjum_jeb"
            EXPRESSION([pjum_jeb]=6292)
            STYLE
            COLOR 255 155 150
            OUTLINECOLOR 19 19 19
            WIDTH 2
            ANTIALIAS TRUE
            END#STYLE
        END#CLASS
    END #LAYER

SCALEBAR 
    STATUS ON #dg template
    LABEL
        SIZE Medium
        COLOR 0 0 0
        OUTLINECOLOR 255 255 255
    END# LABEL
    STYLE 1
    INTERVALS 3
    SIZE 200 5
    COLOR 0 0 0 
    BACKGROUNDCOLOR 255 255 255
    OUTLINECOLOR 0 0 0
    UNITS KILOMETERS
    POSITION LR
    TRANSPARENT TRUE
    END # SCALEBAR
    
LEGEND # BLOK LEGENDA
    IMAGECOLOR 255 255 204 # kuning Muda
    KEYSIZE 18 9
    KEYSPACING 3 5
    POSTLABELCACHE TRUE
    STATUS ON # template
    TRANSPARENT OFF
    LABEL # LABEL LEGENDA    
        TYPE TRUETYPE
        FONT ARIAL
        COLOR 0 0 0
        SIZE 6
        ANTIALIAS TRUE
    END #LABEL
    TEMPLATE "i:\ms4w\Apache\htdocs\dbee_html\legenda.html"
END # AKHIR BLOK LEGENDA

END #map

here the template: 
<HTML>
<HEAD>
<TITLE>Membuat Widget Chameleon</TITLE>
<link href="I:/ms4w/Apache/htdocs/script/cwc2.css" rel="stylesheet" 
type="text/css">
</HEAD>
<body onLoad="CWC2OnLoadFunction()">
    <form>
    <table border="0" cellpadding="2" cellspacing="0">
    <tr>
    <td colspan="3" align="center">
    <CWC2 TYPE="MapDHTML"
        VISIBLE="true"
        WIDTH="400"
        HEIGHT="300"
        ALLOWRESIZE="true"
        MARQUEECOLOR="#FF3333"
        MARQUEWIDTH="2"
        MINSCALE="1">
       </td>
       </tr>
       </table>
       </form>
</body>
</HTML>      



Here the initialize.phtml:
<HTML>
<HEAD><TITLE>Membuat WIDGET Chameleon</TITLE>
<BODY>
<?php
include("i:/ms4w/Apache/htdocs/chameleon/htdocs/chameleon.php");
    $szTemplate="i:/ms4w/Apache/htdocs/dbee_html/tmpl_cham.html";
    $szMapfile="i:/Spatial/mapfile/kelur_cham.map";
    class SampleApp extends Chameleon
    {
        function SampleApp()
        {
            parent::Chameleon();
            $this->moMapSession=new MapSession_RW;
            $this->moMapSession->setTempDir
        (getSessionSavePath());
        }
    }
    
    $oApp= new SampleApp();
    $oApp->registerSkin('skins/sample');
    $oApp->CWCInitialize($szTemplate, $szMapFile);
    $oApp->CWCExecute();

?>

</BODY>
</HTML>


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100807/0d05ac0d/attachment.htm>


More information about the MapServer-users mailing list