[ka-Map-users] Loading dynamic data

Pje pjebra at gmail.com
Tue Oct 17 14:56:58 EDT 2006


Hi,

I'm trying to load a layer depending on which user is logged. Today,
I'm doing that:

1. index.php
<body onload="myOnLoad('<?=$user?>');">
...

2. kaMap.js
function kaMap( szID, user) {
...
this.init = "init.php?user="+user;
...
if (this.tileSource == 'nocache') {
    var src = this._map.kaMap.server +
        this._map.kaMap.tileURL.replace('tile.php', 'tile_nocache.php') +
        q + 'map=' + this._map.name +
        '&t=' + t +
        '&l=' + l +
        '&user=' + user +
        szScale + szForce + szGroup + szImageformat;
...

3. init.php, tile.php, tile_nocache.php

$user = $_GET["user"];

foreach($aszMapFiles as $key => $aszMapFile) {
    $oMap = ms_newMapObj( $aszMapFile['path'] );

    /* here i create the layer based in the user that is logged on*/
    $aLayer = ms_newLayerObj($oMap);
    $aLayer->set("connectiontype", MS_POSTGIS);
    $aLayer->set("data", "SELECT geom FROM table WHERE user = $user");
...

I will need to load data not only based on the user logged. So, there
is a good way to do that? Anyone already did that?


More information about the ka-Map-users mailing list