[ka-Map-users] Changing map layer dinamically
Damiano Morosi
damiano.morosi at atac.roma.it
Fri Nov 24 05:46:00 EST 2006
Your idea is very interesting. I tried to do as you said, putting all
the things in my mapfile, i.e., "tile-source" "nocache" in metadata and
putting CONNECTION "%conn%" to make a test.
After this, in my js:
layers = myKaMap.getCurrentMap().getAllLayers();
for(var i=0; i < layers.length; i++) {
layers[i].replacementVariables = {conn: 'test.ovf'};
}
It seems logic, but it doesn't work as I try to load the map. This piece
of code is called inside the myMapInitialized function: is it right?
Thanks,
Damiano
Pje ha scritto:
> You can do that using mapfile variables and setting you layer metadata
> to tile_source "nocache". So, when you click on a link, you send the
> parameter to your mapfile and refresh your layer.
>
> To specify values for variable replacement on the client side, add a
> replacementVariables object to your JavaScript _layer object (e.g.
> myLayer.replacementVariables = {key1: 'value1', key2: 'value2'}).
> Variable replacement currently works for layer->data, layer->connection,
> layer->filter, and for class->expression.
>
> You can see how it works here:
> http://mapserver.gis.umn.edu/docs/reference/mapfile/variable_sub
> <http://mapserver.gis.umn.edu/docs/reference/mapfile/variable_sub>
>
> On 11/23/06, *Damiano Morosi* <damiano.morosi at atac.roma.it
> <mailto:damiano.morosi at atac.roma.it>> wrote:
>
> Hi,
>
> I would like to change the layer in my kaMap by clicking on a link or
> selecting a voice in a combobox.
> Is there some javascript API to do such thing without too much reverse
> engineering of ka-map?
> Thanks,
>
> Damiano
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org <mailto:ka-Map-users at lists.maptools.org>
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
More information about the ka-Map-users
mailing list